use of org.finra.herd.model.api.xml.GlobalAttributeDefinitionKeys in project herd by FINRAOS.
the class GlobalAttributeDefinitionServiceTest method testGetGlobalAttributeDefinitions.
@Test
public void testGetGlobalAttributeDefinitions() {
// Create a list of global attribute definitions keys.
List<GlobalAttributeDefinitionKey> globalAttributeDefinitionKeys = Arrays.asList(new GlobalAttributeDefinitionKey(GLOBAL_ATTRIBUTE_DEFINITON_LEVEL, GLOBAL_ATTRIBUTE_DEFINITON_NAME), new GlobalAttributeDefinitionKey(GLOBAL_ATTRIBUTE_DEFINITON_LEVEL, GLOBAL_ATTRIBUTE_DEFINITON_NAME_2));
// Mock calls to external methods.
when(globalAttributeDefinitionDao.getAllGlobalAttributeDefinitionKeys()).thenReturn(globalAttributeDefinitionKeys);
// Call the method under test.
GlobalAttributeDefinitionKeys response = globalAttributeDefinitionService.getGlobalAttributeDefinitionKeys();
// Verify the external calls.
verify(globalAttributeDefinitionDao).getAllGlobalAttributeDefinitionKeys();
verifyNoMoreInteractionsHelper();
// Validate the response.
assertEquals(new GlobalAttributeDefinitionKeys(globalAttributeDefinitionKeys), response);
}
use of org.finra.herd.model.api.xml.GlobalAttributeDefinitionKeys in project herd by FINRAOS.
the class GlobalAttributeDefinitionRestControllerTest method testGetGlobalAttributeDefinitions.
@Test
public void testGetGlobalAttributeDefinitions() {
// Create a list of global attribute definition keys.
GlobalAttributeDefinitionKeys globalAttributeDefinitionKeys = new GlobalAttributeDefinitionKeys(Arrays.asList(new GlobalAttributeDefinitionKey(GLOBAL_ATTRIBUTE_DEFINITON_LEVEL, GLOBAL_ATTRIBUTE_DEFINITON_NAME), new GlobalAttributeDefinitionKey(GLOBAL_ATTRIBUTE_DEFINITON_LEVEL, GLOBAL_ATTRIBUTE_DEFINITON_NAME_2)));
// Mock calls to external methods.
when(globalAttributeDefinitionService.getGlobalAttributeDefinitionKeys()).thenReturn(globalAttributeDefinitionKeys);
// Call the method under test.
GlobalAttributeDefinitionKeys response = globalAttributeDefinitionRestController.getGlobalAttributeDefinitions();
// Verify the external calls.
verify(globalAttributeDefinitionService).getGlobalAttributeDefinitionKeys();
verifyNoMoreInteractions(globalAttributeDefinitionService);
// Validate the response.
assertEquals(new GlobalAttributeDefinitionKeys(Arrays.asList(new GlobalAttributeDefinitionKey(GLOBAL_ATTRIBUTE_DEFINITON_LEVEL, GLOBAL_ATTRIBUTE_DEFINITON_NAME), new GlobalAttributeDefinitionKey(GLOBAL_ATTRIBUTE_DEFINITON_LEVEL, GLOBAL_ATTRIBUTE_DEFINITON_NAME_2))), response);
}
use of org.finra.herd.model.api.xml.GlobalAttributeDefinitionKeys in project herd by FINRAOS.
the class AttributeHelper method getGlobalAttributesDefinitionForFormat.
/**
* Return all the format level global attribute definitions
*
* @return global attribute definition keys
*/
public List<GlobalAttributeDefinitionKey> getGlobalAttributesDefinitionForFormat() {
List<GlobalAttributeDefinitionKey> globalAttributeDefinitionKeys = new ArrayList<>();
GlobalAttributeDefinitionKeys globalAttributesDefinitions = globalAttributeDefinitionService.getGlobalAttributeDefinitionKeys();
for (GlobalAttributeDefinitionKey globalAttributeDefinitionKey : globalAttributesDefinitions.getGlobalAttributeDefinitionKeys()) {
if (GlobalAttributeDefinitionLevelEntity.GlobalAttributeDefinitionLevels.BUS_OBJCT_FRMT.name().equalsIgnoreCase(globalAttributeDefinitionKey.getGlobalAttributeDefinitionLevel())) {
globalAttributeDefinitionKeys.add(globalAttributeDefinitionKey);
}
}
return globalAttributeDefinitionKeys;
}
Aggregations