Search in sources :

Example 6 with AllowedAttributeValuesInformation

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);
}
Also used : AllowedAttributeValuesDeleteRequest(org.finra.herd.model.api.xml.AllowedAttributeValuesDeleteRequest) AttributeValueListKey(org.finra.herd.model.api.xml.AttributeValueListKey) AllowedAttributeValuesInformation(org.finra.herd.model.api.xml.AllowedAttributeValuesInformation) Test(org.junit.Test)

Example 7 with AllowedAttributeValuesInformation

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);
}
Also used : AttributeValueListKey(org.finra.herd.model.api.xml.AttributeValueListKey) AllowedAttributeValuesInformation(org.finra.herd.model.api.xml.AllowedAttributeValuesInformation) Test(org.junit.Test)

Aggregations

AllowedAttributeValuesInformation (org.finra.herd.model.api.xml.AllowedAttributeValuesInformation)7 AttributeValueListKey (org.finra.herd.model.api.xml.AttributeValueListKey)7 Test (org.junit.Test)6 ArrayList (java.util.ArrayList)3 AllowedAttributeValueEntity (org.finra.herd.model.jpa.AllowedAttributeValueEntity)3 AttributeValueListEntity (org.finra.herd.model.jpa.AttributeValueListEntity)3 NamespaceEntity (org.finra.herd.model.jpa.NamespaceEntity)3 AllowedAttributeValuesCreateRequest (org.finra.herd.model.api.xml.AllowedAttributeValuesCreateRequest)2 AllowedAttributeValuesDeleteRequest (org.finra.herd.model.api.xml.AllowedAttributeValuesDeleteRequest)2