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());
}
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));
}
}
Aggregations