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);
}
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;
}
Aggregations