use of org.finra.herd.model.api.xml.AttributeValueListKeys in project herd by FINRAOS.
the class AttributeValueListServiceTest method testGetAttributeValueLists.
@Test
public void testGetAttributeValueLists() {
// Create a set of authorized namespaces.
Set<String> authorizedNamespaces = new HashSet<>();
authorizedNamespaces.add(NAMESPACE);
// Create an attribute value list key.
List<AttributeValueListKey> attributeValueListKeys = Arrays.asList(new AttributeValueListKey(ATTRIBUTE_VALUE_LIST_NAMESPACE, ATTRIBUTE_VALUE_LIST_NAME));
// Mock calls to external methods.
when(namespaceSecurityHelper.getAuthorizedNamespaces(NamespacePermissionEnum.READ)).thenReturn(authorizedNamespaces);
when(attributeValueListDao.getAttributeValueLists(authorizedNamespaces)).thenReturn(attributeValueListKeys);
// Call the method under test.
AttributeValueListKeys result = attributeValueListService.getAttributeValueLists();
// Verify the external calls.
verify(namespaceSecurityHelper).getAuthorizedNamespaces(NamespacePermissionEnum.READ);
verify(attributeValueListDao).getAttributeValueLists(authorizedNamespaces);
verifyNoMoreInteractionsHelper();
// Validate the result.
assertEquals(new AttributeValueListKeys(attributeValueListKeys), result);
}
use of org.finra.herd.model.api.xml.AttributeValueListKeys 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.AttributeValueListKeys in project herd by FINRAOS.
the class AttributeValueListServiceTest method testGetAttributeValueListsNoAuthorizedNamespaces.
@Test
public void testGetAttributeValueListsNoAuthorizedNamespaces() {
// Create an empty set of authorized namespaces.
Set<String> authorizedNamespaces = new HashSet<>();
// Mock calls to external methods.
when(namespaceSecurityHelper.getAuthorizedNamespaces(NamespacePermissionEnum.READ)).thenReturn(authorizedNamespaces);
// Call the method under test.
AttributeValueListKeys result = attributeValueListService.getAttributeValueLists();
// Verify the external calls.
verify(namespaceSecurityHelper).getAuthorizedNamespaces(NamespacePermissionEnum.READ);
verifyNoMoreInteractionsHelper();
// Validate the result.
assertEquals(new AttributeValueListKeys(), result);
}
Aggregations