use of org.finra.herd.model.api.xml.AttributeValueListKey in project herd by FINRAOS.
the class AttributeValueListRestControllerTest method testCreateAttributeValueList.
@Test
public void testCreateAttributeValueList() {
// 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);
// Create an attribute value list create request.
AttributeValueListCreateRequest request = new AttributeValueListCreateRequest(attributeValueListKey);
// Mock calls to external methods.
when(attributeValueListService.createAttributeValueList(request)).thenReturn(attributeValueList);
// Call the method under test.
AttributeValueList result = attributeValueListRestController.createAttributeValueList(request);
// Verify the external calls.
verify(attributeValueListService).createAttributeValueList(request);
verifyNoMoreInteractions(attributeValueListService);
// Validate the result.
assertEquals(attributeValueList, result);
}
use of org.finra.herd.model.api.xml.AttributeValueListKey in project herd by FINRAOS.
the class AttributeValueListRestControllerTest method testGetAttributeValueLists.
@Test
public void testGetAttributeValueLists() {
// Create an attribute value list key.
AttributeValueListKeys attributeValueListKeys = new AttributeValueListKeys(Arrays.asList(new AttributeValueListKey(ATTRIBUTE_VALUE_LIST_NAMESPACE, ATTRIBUTE_VALUE_LIST_NAME)));
// Mock calls to external methods.
when(attributeValueListService.getAttributeValueLists()).thenReturn(attributeValueListKeys);
// Call the method under test.
AttributeValueListKeys result = attributeValueListRestController.getAttributeValueLists();
// Verify the external calls.
verify(attributeValueListService).getAttributeValueLists();
verifyNoMoreInteractions(attributeValueListService);
// Validate the result.
assertEquals(attributeValueListKeys, result);
}
use of org.finra.herd.model.api.xml.AttributeValueListKey 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);
}
use of org.finra.herd.model.api.xml.AttributeValueListKey in project herd by FINRAOS.
the class AllowedAttributeValueRestControllerTest method testCreateAllowedAttributeValue.
@Test
public void testCreateAllowedAttributeValue() {
// Create attribute value list key.
AttributeValueListKey attributeValueListKey = new AttributeValueListKey(NAMESPACE_CODE, ATTRIBUTE_VALUE_LIST_NAME);
AllowedAttributeValuesCreateRequest request = new AllowedAttributeValuesCreateRequest(attributeValueListKey, Arrays.asList(ALLOWED_ATTRIBUTE_VALUE));
// Create the allowed attribute values information.
AllowedAttributeValuesInformation allowedAttributeValuesInformation = new AllowedAttributeValuesInformation();
allowedAttributeValuesInformation.setAttributeValueListKey(attributeValueListKey);
allowedAttributeValuesInformation.setAllowedAttributeValues(Arrays.asList(ALLOWED_ATTRIBUTE_VALUE));
// Mock calls to external method.
when(allowedAttributeValueService.createAllowedAttributeValues(request)).thenReturn(allowedAttributeValuesInformation);
// Call the method under test.
AllowedAttributeValuesInformation response = allowedAttributeValueRestController.createAllowedAttributeValues(request);
// Verify the external calls.
verify(allowedAttributeValueService).createAllowedAttributeValues(request);
verifyNoMoreInteractions(allowedAttributeValueService);
// Validate the response.
assertEquals(allowedAttributeValuesInformation, response);
}
use of org.finra.herd.model.api.xml.AttributeValueListKey in project herd by FINRAOS.
the class AllowedAttributeValueRestControllerTest method testDeleteAllowedAttributeValue.
@Test
public void testDeleteAllowedAttributeValue() {
// Create attribute value list key.
AttributeValueListKey attributeValueListKey = new AttributeValueListKey(NAMESPACE_CODE, ATTRIBUTE_VALUE_LIST_NAME);
AllowedAttributeValuesDeleteRequest request = new AllowedAttributeValuesDeleteRequest(attributeValueListKey, Arrays.asList(ALLOWED_ATTRIBUTE_VALUE));
// Create the allowed attribute values information.
AllowedAttributeValuesInformation allowedAttributeValuesInformation = new AllowedAttributeValuesInformation();
allowedAttributeValuesInformation.setAttributeValueListKey(attributeValueListKey);
allowedAttributeValuesInformation.setAllowedAttributeValues(Arrays.asList(ALLOWED_ATTRIBUTE_VALUE));
// Mock calls to external method.
when(allowedAttributeValueService.deleteAllowedAttributeValues(request)).thenReturn(allowedAttributeValuesInformation);
// Call the method under test.
AllowedAttributeValuesInformation response = allowedAttributeValueRestController.deleteAllowedAttributeValues(request);
// Verify the external calls.
verify(allowedAttributeValueService).deleteAllowedAttributeValues(request);
verifyNoMoreInteractions(allowedAttributeValueService);
// Validate the response.
assertEquals(allowedAttributeValuesInformation, response);
}
Aggregations