Search in sources :

Example 1 with CustomDdlCreateRequest

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);
}
Also used : CustomDdlCreateRequest(org.finra.herd.model.api.xml.CustomDdlCreateRequest) CustomDdl(org.finra.herd.model.api.xml.CustomDdl) CustomDdlKey(org.finra.herd.model.api.xml.CustomDdlKey) Test(org.junit.Test)

Example 2 with CustomDdlCreateRequest

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;
}
Also used : CustomDdlCreateRequest(org.finra.herd.model.api.xml.CustomDdlCreateRequest) CustomDdlKey(org.finra.herd.model.api.xml.CustomDdlKey)

Aggregations

CustomDdlCreateRequest (org.finra.herd.model.api.xml.CustomDdlCreateRequest)2 CustomDdlKey (org.finra.herd.model.api.xml.CustomDdlKey)2 CustomDdl (org.finra.herd.model.api.xml.CustomDdl)1 Test (org.junit.Test)1