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