use of org.finra.herd.model.api.xml.CustomDdl in project herd by FINRAOS.
the class CustomDdlServiceTest method testCreateCustomDdl.
@Test
public void testCreateCustomDdl() {
// 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);
// Create a custom DDL.
CustomDdl resultCustomDdl = customDdlService.createCustomDdl(customDdlServiceTestHelper.createCustomDdlCreateRequest(NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, FORMAT_VERSION, CUSTOM_DDL_NAME, TEST_DDL));
// Validate the returned object.
customDdlServiceTestHelper.validateCustomDdl(null, NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, FORMAT_VERSION, CUSTOM_DDL_NAME, TEST_DDL, resultCustomDdl);
}
use of org.finra.herd.model.api.xml.CustomDdl in project herd by FINRAOS.
the class CustomDdlServiceTest method testGetCustomDdl.
@Test
public void testGetCustomDdl() {
// Create and persist a custom DDL entity.
CustomDdlEntity customDdlEntity = customDdlDaoTestHelper.createCustomDdlEntity(NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, FORMAT_VERSION, CUSTOM_DDL_NAME, TEST_DDL);
// Retrieve the custom DDL.
CustomDdl resultCustomDdl = customDdlService.getCustomDdl(new CustomDdlKey(NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, FORMAT_VERSION, CUSTOM_DDL_NAME));
// Validate the returned object.
customDdlServiceTestHelper.validateCustomDdl(customDdlEntity.getId(), NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, FORMAT_VERSION, CUSTOM_DDL_NAME, TEST_DDL, resultCustomDdl);
}
use of org.finra.herd.model.api.xml.CustomDdl in project herd by FINRAOS.
the class CustomDdlServiceTest method testDeleteCustomDdlLowerCaseParameters.
@Test
public void testDeleteCustomDdlLowerCaseParameters() {
// Create and persist a custom DDL entity using upper case values.
CustomDdlEntity customDdlEntity = customDdlDaoTestHelper.createCustomDdlEntity(NAMESPACE.toUpperCase(), BDEF_NAME.toUpperCase(), FORMAT_USAGE_CODE.toUpperCase(), FORMAT_FILE_TYPE_CODE.toUpperCase(), FORMAT_VERSION, CUSTOM_DDL_NAME.toUpperCase(), TEST_DDL.toUpperCase());
// Validate that this custom DDL exists.
CustomDdlKey customDdlKey = new CustomDdlKey(NAMESPACE.toUpperCase(), BDEF_NAME.toUpperCase(), FORMAT_USAGE_CODE.toUpperCase(), FORMAT_FILE_TYPE_CODE.toUpperCase(), FORMAT_VERSION, CUSTOM_DDL_NAME.toUpperCase());
assertNotNull(customDdlDao.getCustomDdlByKey(customDdlKey));
// Delete the custom DDL using lower case input parameters.
CustomDdl deletedCustomDdl = customDdlService.deleteCustomDdl(new CustomDdlKey(NAMESPACE.toLowerCase(), BDEF_NAME.toLowerCase(), FORMAT_USAGE_CODE.toLowerCase(), FORMAT_FILE_TYPE_CODE.toLowerCase(), FORMAT_VERSION, CUSTOM_DDL_NAME.toLowerCase()));
// Validate the returned object.
customDdlServiceTestHelper.validateCustomDdl(customDdlEntity.getId(), NAMESPACE.toUpperCase(), BDEF_NAME.toUpperCase(), FORMAT_USAGE_CODE.toUpperCase(), FORMAT_FILE_TYPE_CODE.toUpperCase(), FORMAT_VERSION, CUSTOM_DDL_NAME.toUpperCase(), TEST_DDL.toUpperCase(), deletedCustomDdl);
// Ensure that this custom DDL is no longer there.
assertNull(customDdlDao.getCustomDdlByKey(customDdlKey));
}
use of org.finra.herd.model.api.xml.CustomDdl in project herd by FINRAOS.
the class CustomDdlServiceTest method testDeleteCustomDdl.
@Test
public void testDeleteCustomDdl() {
// Create and persist a custom DDL entity.
CustomDdlEntity customDdlEntity = customDdlDaoTestHelper.createCustomDdlEntity(NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, FORMAT_VERSION, CUSTOM_DDL_NAME, TEST_DDL);
// Validate that this custom DDL exists.
CustomDdlKey customDdlKey = new CustomDdlKey(NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, FORMAT_VERSION, CUSTOM_DDL_NAME);
assertNotNull(customDdlDao.getCustomDdlByKey(customDdlKey));
// Delete this custom DDL.
CustomDdl deletedCustomDdl = customDdlService.deleteCustomDdl(new CustomDdlKey(NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, FORMAT_VERSION, CUSTOM_DDL_NAME));
// Validate the returned object.
customDdlServiceTestHelper.validateCustomDdl(customDdlEntity.getId(), NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, FORMAT_VERSION, CUSTOM_DDL_NAME, TEST_DDL, deletedCustomDdl);
// Ensure that this custom DDL is no longer there.
assertNull(customDdlDao.getCustomDdlByKey(customDdlKey));
}
use of org.finra.herd.model.api.xml.CustomDdl in project herd by FINRAOS.
the class CustomDdlServiceTest method testUpdateCustomDdlTrimParameters.
@Test
public void testUpdateCustomDdlTrimParameters() {
// Create and persist a custom DDL entity.
CustomDdlEntity customDdlEntity = customDdlDaoTestHelper.createCustomDdlEntity(NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, FORMAT_VERSION, CUSTOM_DDL_NAME, TEST_DDL);
// Update the custom DDL using input parameters with leading and trailing empty spaces.
CustomDdl updatedCustomDdl = customDdlService.updateCustomDdl(new CustomDdlKey(addWhitespace(NAMESPACE), addWhitespace(BDEF_NAME), addWhitespace(FORMAT_USAGE_CODE), addWhitespace(FORMAT_FILE_TYPE_CODE), FORMAT_VERSION, addWhitespace(CUSTOM_DDL_NAME)), customDdlServiceTestHelper.createCustomDdlUpdateRequest(addWhitespace(TEST_DDL_2)));
// Validate the returned object.
customDdlServiceTestHelper.validateCustomDdl(customDdlEntity.getId(), NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, FORMAT_VERSION, CUSTOM_DDL_NAME, TEST_DDL_2, updatedCustomDdl);
}
Aggregations