use of org.finra.herd.model.api.xml.CustomDdlCreateRequest 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.CustomDdlCreateRequest in project herd by FINRAOS.
the class CustomDdlServiceTestHelper method createCustomDdlCreateRequest.
/**
* Creates a custom DDL create request.
*
* @return the newly created custom DDL create request
*/
public CustomDdlCreateRequest createCustomDdlCreateRequest(String namespaceCode, String businessObjectDefinitionName, String businessObjectFormatUsage, String businessObjectFormatFileType, Integer businessObjectFormatVersion, String customDdlName, String ddl) {
CustomDdlCreateRequest request = new CustomDdlCreateRequest();
request.setCustomDdlKey(new CustomDdlKey(namespaceCode, businessObjectDefinitionName, businessObjectFormatUsage, businessObjectFormatFileType, businessObjectFormatVersion, customDdlName));
request.setDdl(ddl);
return request;
}
Aggregations