Search in sources :

Example 1 with GlobalAttributeDefinitionKeys

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

Example 2 with GlobalAttributeDefinitionKeys

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

Example 3 with GlobalAttributeDefinitionKeys

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;
}
Also used : ArrayList(java.util.ArrayList) GlobalAttributeDefinitionKey(org.finra.herd.model.api.xml.GlobalAttributeDefinitionKey) GlobalAttributeDefinitionKeys(org.finra.herd.model.api.xml.GlobalAttributeDefinitionKeys)

Aggregations

GlobalAttributeDefinitionKey (org.finra.herd.model.api.xml.GlobalAttributeDefinitionKey)3 GlobalAttributeDefinitionKeys (org.finra.herd.model.api.xml.GlobalAttributeDefinitionKeys)3 Test (org.junit.Test)2 ArrayList (java.util.ArrayList)1