Search in sources :

Example 21 with CustomDdl

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

the class CustomDdlServiceTest method testDeleteCustomDdlTrimParameters.

@Test
public void testDeleteCustomDdlTrimParameters() {
    // 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 the custom DDL using input parameters with leading and trailing empty spaces.
    CustomDdl deletedCustomDdl = customDdlService.deleteCustomDdl(new CustomDdlKey(addWhitespace(NAMESPACE), addWhitespace(BDEF_NAME), addWhitespace(FORMAT_USAGE_CODE), addWhitespace(FORMAT_FILE_TYPE_CODE), FORMAT_VERSION, addWhitespace(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));
}
Also used : CustomDdlEntity(org.finra.herd.model.jpa.CustomDdlEntity) CustomDdl(org.finra.herd.model.api.xml.CustomDdl) CustomDdlKey(org.finra.herd.model.api.xml.CustomDdlKey) Test(org.junit.Test)

Aggregations

CustomDdl (org.finra.herd.model.api.xml.CustomDdl)21 Test (org.junit.Test)20 CustomDdlKey (org.finra.herd.model.api.xml.CustomDdlKey)17 CustomDdlEntity (org.finra.herd.model.jpa.CustomDdlEntity)12 CustomDdlCreateRequest (org.finra.herd.model.api.xml.CustomDdlCreateRequest)1 CustomDdlUpdateRequest (org.finra.herd.model.api.xml.CustomDdlUpdateRequest)1