Search in sources :

Example 6 with AttributeValueList

use of org.finra.herd.model.api.xml.AttributeValueList in project herd by FINRAOS.

the class AttributeValueListRestControllerTest method testDeleteAttributeValueList.

@Test
public void testDeleteAttributeValueList() {
    // Create an attribute value list key.
    AttributeValueListKey attributeValueListKey = new AttributeValueListKey(ATTRIBUTE_VALUE_LIST_NAMESPACE, ATTRIBUTE_VALUE_LIST_NAME);
    // Create an attribute value list.
    AttributeValueList attributeValueList = new AttributeValueList(ATTRIBUTE_VALUE_LIST_ID, attributeValueListKey);
    // Mock calls to external methods.
    when(attributeValueListService.deleteAttributeValueList(attributeValueListKey)).thenReturn(attributeValueList);
    // Call the method under test.
    AttributeValueList result = attributeValueListRestController.deleteAttributeValueList(ATTRIBUTE_VALUE_LIST_NAMESPACE, ATTRIBUTE_VALUE_LIST_NAME);
    // Verify the external calls.
    verify(attributeValueListService).deleteAttributeValueList(attributeValueListKey);
    verifyNoMoreInteractions(attributeValueListService);
    // Validate the result.
    assertEquals(attributeValueList, result);
}
Also used : AttributeValueList(org.finra.herd.model.api.xml.AttributeValueList) AttributeValueListKey(org.finra.herd.model.api.xml.AttributeValueListKey) Test(org.junit.Test)

Example 7 with AttributeValueList

use of org.finra.herd.model.api.xml.AttributeValueList in project herd by FINRAOS.

the class AttributeValueListRestControllerTest method testGetAttributeValueList.

@Test
public void testGetAttributeValueList() {
    // Create an attribute value list key.
    AttributeValueListKey attributeValueListKey = new AttributeValueListKey(ATTRIBUTE_VALUE_LIST_NAMESPACE, ATTRIBUTE_VALUE_LIST_NAME);
    // Create an attribute value list.
    AttributeValueList attributeValueList = new AttributeValueList(ATTRIBUTE_VALUE_LIST_ID, attributeValueListKey);
    // Mock calls to external methods.
    when(attributeValueListService.getAttributeValueList(attributeValueListKey)).thenReturn(attributeValueList);
    // Call the method under test.
    AttributeValueList result = attributeValueListRestController.getAttributeValueList(ATTRIBUTE_VALUE_LIST_NAMESPACE, ATTRIBUTE_VALUE_LIST_NAME);
    // Verify the external calls.
    verify(attributeValueListService).getAttributeValueList(attributeValueListKey);
    verifyNoMoreInteractions(attributeValueListService);
    // Validate the result.
    assertEquals(attributeValueList, result);
}
Also used : AttributeValueList(org.finra.herd.model.api.xml.AttributeValueList) AttributeValueListKey(org.finra.herd.model.api.xml.AttributeValueListKey) Test(org.junit.Test)

Aggregations

AttributeValueList (org.finra.herd.model.api.xml.AttributeValueList)7 AttributeValueListKey (org.finra.herd.model.api.xml.AttributeValueListKey)7 Test (org.junit.Test)6 AttributeValueListEntity (org.finra.herd.model.jpa.AttributeValueListEntity)3 NamespaceEntity (org.finra.herd.model.jpa.NamespaceEntity)3 AttributeValueListCreateRequest (org.finra.herd.model.api.xml.AttributeValueListCreateRequest)2