use of org.finra.herd.model.api.xml.AllowedAttributeValuesInformation 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);
}
use of org.finra.herd.model.api.xml.AllowedAttributeValuesInformation in project herd by FINRAOS.
the class AllowedAttributeValueRestControllerTest method testGetAllowedAttributeValue.
@Test
public void testGetAllowedAttributeValue() {
// Create attribute value list key.
AttributeValueListKey attributeValueListKey = new AttributeValueListKey(NAMESPACE_CODE, ATTRIBUTE_VALUE_LIST_NAME);
// 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.getAllowedAttributeValues(attributeValueListKey)).thenReturn(allowedAttributeValuesInformation);
// Call the method under test.
AllowedAttributeValuesInformation response = allowedAttributeValueRestController.getAllowedAttributeValues(NAMESPACE_CODE, ATTRIBUTE_VALUE_LIST_NAME);
// Verify the external calls.
verify(allowedAttributeValueService).getAllowedAttributeValues(attributeValueListKey);
verifyNoMoreInteractions(allowedAttributeValueService);
// Validate the response.
assertEquals(allowedAttributeValuesInformation, response);
}
Aggregations