Search in sources :

Example 6 with CustomDdlKeys

use of org.finra.herd.model.api.xml.CustomDdlKeys in project herd by FINRAOS.

the class CustomDdlServiceTest method testGetCustomDdlsCustomDdlsNoExist.

@Test
public void testGetCustomDdlsCustomDdlsNoExist() {
    // Create and persist a business object format entity.
    businessObjectFormatDaoTestHelper.createBusinessObjectFormatEntity(NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, FORMAT_VERSION, FORMAT_DESCRIPTION, true, PARTITION_KEY);
    // Retrieve a list of custom DDL keys, when none of the custom DDLs exist.
    CustomDdlKeys resultCustomDdlKeys = customDdlService.getCustomDdls(new BusinessObjectFormatKey(NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, FORMAT_VERSION));
    // Validate the returned object.
    assertNotNull(resultCustomDdlKeys);
    assertEquals(0, resultCustomDdlKeys.getCustomDdlKeys().size());
}
Also used : CustomDdlKeys(org.finra.herd.model.api.xml.CustomDdlKeys) BusinessObjectFormatKey(org.finra.herd.model.api.xml.BusinessObjectFormatKey) Test(org.junit.Test)

Example 7 with CustomDdlKeys

use of org.finra.herd.model.api.xml.CustomDdlKeys in project herd by FINRAOS.

the class CustomDdlServiceTest method testGetCustomDdlsLowerCaseParameters.

@Test
public void testGetCustomDdlsLowerCaseParameters() {
    // List of test custom DDL names.
    List<String> testCustomDdlNames = Arrays.asList(CUSTOM_DDL_NAME, CUSTOM_DDL_NAME_2);
    // Create and persist a custom DDL entities using upper case values.
    for (String customDdlName : testCustomDdlNames) {
        customDdlDaoTestHelper.createCustomDdlEntity(NAMESPACE.toUpperCase(), BDEF_NAME.toUpperCase(), FORMAT_USAGE_CODE.toUpperCase(), FORMAT_FILE_TYPE_CODE.toUpperCase(), FORMAT_VERSION, customDdlName.toUpperCase(), TEST_DDL.toUpperCase());
    }
    // Retrieve a list of custom DDL keys using lower case input parameters.
    CustomDdlKeys resultCustomDdlKeys = customDdlService.getCustomDdls(new BusinessObjectFormatKey(NAMESPACE.toLowerCase(), BDEF_NAME.toLowerCase(), FORMAT_USAGE_CODE.toLowerCase(), FORMAT_FILE_TYPE_CODE.toLowerCase(), FORMAT_VERSION));
    // Validate the returned object.
    assertNotNull(resultCustomDdlKeys);
    assertEquals(testCustomDdlNames.size(), resultCustomDdlKeys.getCustomDdlKeys().size());
    for (int i = 0; i < testCustomDdlNames.size(); i++) {
        assertEquals(new CustomDdlKey(NAMESPACE.toUpperCase(), BDEF_NAME.toUpperCase(), FORMAT_USAGE_CODE.toUpperCase(), FORMAT_FILE_TYPE_CODE.toUpperCase(), FORMAT_VERSION, testCustomDdlNames.get(i).toUpperCase()), resultCustomDdlKeys.getCustomDdlKeys().get(i));
    }
}
Also used : CustomDdlKeys(org.finra.herd.model.api.xml.CustomDdlKeys) BusinessObjectFormatKey(org.finra.herd.model.api.xml.BusinessObjectFormatKey) CustomDdlKey(org.finra.herd.model.api.xml.CustomDdlKey) Test(org.junit.Test)

Aggregations

CustomDdlKeys (org.finra.herd.model.api.xml.CustomDdlKeys)7 BusinessObjectFormatKey (org.finra.herd.model.api.xml.BusinessObjectFormatKey)6 Test (org.junit.Test)6 CustomDdlKey (org.finra.herd.model.api.xml.CustomDdlKey)5 NamespacePermission (org.finra.herd.model.annotation.NamespacePermission)1