use of org.finra.herd.model.api.xml.CustomDdlKey in project herd by FINRAOS.
the class CustomDdlServiceTest method testGetCustomDdlLowerCaseParameters.
@Test
public void testGetCustomDdlLowerCaseParameters() {
// 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());
// Get the custom DDL using lower case input parameters.
CustomDdl resultCustomDdl = customDdlService.getCustomDdl(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(), resultCustomDdl);
}
use of org.finra.herd.model.api.xml.CustomDdlKey in project herd by FINRAOS.
the class CustomDdlRestControllerTest method testGetCustomDdls.
@Test
public void testGetCustomDdls() {
BusinessObjectFormatKey businessObjectFormatKey = new BusinessObjectFormatKey(NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, FORMAT_VERSION);
CustomDdlKeys customDdlKeys = new CustomDdlKeys(Arrays.asList(new CustomDdlKey(NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, FORMAT_VERSION, "ddl")));
when(customDdlService.getCustomDdls(businessObjectFormatKey)).thenReturn(customDdlKeys);
// Retrieve a list of custom DDL keys.
CustomDdlKeys resultCustomDdlKeys = customDdlRestController.getCustomDdls(NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, FORMAT_VERSION);
// Verify the external calls.
verify(customDdlService).getCustomDdls(businessObjectFormatKey);
verifyNoMoreInteractions(customDdlService);
// Validate the returned object.
assertEquals(customDdlKeys, resultCustomDdlKeys);
}
use of org.finra.herd.model.api.xml.CustomDdlKey in project herd by FINRAOS.
the class CustomDdlRestControllerTest method testCreateCustomDdl.
@Test
public void testCreateCustomDdl() {
CustomDdlCreateRequest request = customDdlServiceTestHelper.createCustomDdlCreateRequest(NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, FORMAT_VERSION, CUSTOM_DDL_NAME, TEST_DDL);
CustomDdl customDdl = new CustomDdl(ID, new CustomDdlKey(NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, FORMAT_VERSION, CUSTOM_DDL_NAME), TEST_DDL);
when(customDdlService.createCustomDdl(request)).thenReturn(customDdl);
// Create a custom DDL.
CustomDdl resultCustomDdl = customDdlRestController.createCustomDdl(request);
// 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);
// Verify the external calls.
verify(customDdlService).createCustomDdl(request);
verifyNoMoreInteractions(customDdlService);
// Validate the returned object.
assertEquals(customDdl, resultCustomDdl);
}
use of org.finra.herd.model.api.xml.CustomDdlKey in project herd by FINRAOS.
the class CustomDdlRestControllerTest method testGetCustomDdl.
@Test
public void testGetCustomDdl() {
CustomDdl customDdl = new CustomDdl(ID, new CustomDdlKey(NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, FORMAT_VERSION, CUSTOM_DDL_NAME), TEST_DDL);
CustomDdlKey customDdlKey = new CustomDdlKey(NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, FORMAT_VERSION, CUSTOM_DDL_NAME);
when(customDdlService.getCustomDdl(customDdlKey)).thenReturn(customDdl);
// Retrieve the custom DDL.
CustomDdl resultCustomDdl = customDdlRestController.getCustomDdl(NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, FORMAT_VERSION, CUSTOM_DDL_NAME);
// Validate the returned object.
customDdlServiceTestHelper.validateCustomDdl(resultCustomDdl.getId(), NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, FORMAT_VERSION, CUSTOM_DDL_NAME, TEST_DDL, resultCustomDdl);
// Verify the external calls.
verify(customDdlService).getCustomDdl(customDdlKey);
verifyNoMoreInteractions(customDdlService);
// Validate the returned object.
assertEquals(customDdl, resultCustomDdl);
}
use of org.finra.herd.model.api.xml.CustomDdlKey in project herd by FINRAOS.
the class CustomDdlRestControllerTest method testDeleteCustomDdl.
@Test
public void testDeleteCustomDdl() {
CustomDdlKey customDdlKey = new CustomDdlKey(NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, FORMAT_VERSION, CUSTOM_DDL_NAME);
CustomDdl customDdl = new CustomDdl(ID, customDdlKey, TEST_DDL);
when(customDdlService.deleteCustomDdl(customDdlKey)).thenReturn(customDdl);
// Delete this custom DDL.
CustomDdl deletedCustomDdl = customDdlRestController.deleteCustomDdl(NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, FORMAT_VERSION, CUSTOM_DDL_NAME);
// Validate the returned object.
customDdlServiceTestHelper.validateCustomDdl(customDdl.getId(), NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, FORMAT_VERSION, CUSTOM_DDL_NAME, TEST_DDL, deletedCustomDdl);
// Verify the external calls.
verify(customDdlService).deleteCustomDdl(customDdlKey);
verifyNoMoreInteractions(customDdlService);
// Validate the returned object.
assertEquals(customDdl, deletedCustomDdl);
}
Aggregations