Search in sources :

Example 1 with CustomDdlUpdateRequest

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

the class CustomDdlRestControllerTest method testUpdateCustomDdl.

@Test
public void testUpdateCustomDdl() {
    CustomDdlUpdateRequest request = customDdlServiceTestHelper.createCustomDdlUpdateRequest(TEST_DDL_2);
    CustomDdlKey customDdlKey = new CustomDdlKey(NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, FORMAT_VERSION, CUSTOM_DDL_NAME);
    CustomDdl customDdl = new CustomDdl(ID, new CustomDdlKey(NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, FORMAT_VERSION, CUSTOM_DDL_NAME), TEST_DDL_2);
    when(customDdlService.updateCustomDdl(customDdlKey, request)).thenReturn(customDdl);
    // Update the custom DDL.
    CustomDdl updatedCustomDdl = customDdlRestController.updateCustomDdl(NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, FORMAT_VERSION, CUSTOM_DDL_NAME, request);
    // Verify the external calls.
    verify(customDdlService).updateCustomDdl(customDdlKey, request);
    verifyNoMoreInteractions(customDdlService);
    // Validate the returned object.
    assertEquals(customDdl, updatedCustomDdl);
}
Also used : CustomDdlUpdateRequest(org.finra.herd.model.api.xml.CustomDdlUpdateRequest) CustomDdl(org.finra.herd.model.api.xml.CustomDdl) CustomDdlKey(org.finra.herd.model.api.xml.CustomDdlKey) Test(org.junit.Test)

Example 2 with CustomDdlUpdateRequest

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

the class CustomDdlServiceTestHelper method createCustomDdlUpdateRequest.

/**
 * Creates a custom DDL update request.
 *
 * @return the newly created custom DDL update request
 */
public CustomDdlUpdateRequest createCustomDdlUpdateRequest(String ddl) {
    CustomDdlUpdateRequest request = new CustomDdlUpdateRequest();
    request.setDdl(ddl);
    return request;
}
Also used : CustomDdlUpdateRequest(org.finra.herd.model.api.xml.CustomDdlUpdateRequest)

Aggregations

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