@Test
public void testCreateDataProvider() throws Exception
{

    DataProviderCreateRequest dataProviderCreateRequest = new DataProviderCreateRequest(DATA_PROVIDER_NAME);
    // Create a data provider.
    DataProvider dataProvider = new DataProvider(DATA_PROVIDER_NAME);
    when(dataProviderService.createDataProvider(dataProviderCreateRequest)).thenReturn(dataProvider);
    DataProvider resultDataProvider = dataProviderRestController.createDataProvider(new DataProviderCreateRequest(DATA_PROVIDER_NAME));
    // Validate the returned object.
    assertEquals(new DataProvider(DATA_PROVIDER_NAME), resultDataProvider);
    // Verify the external calls.
    verify(dataProviderService).createDataProvider(dataProviderCreateRequest);
    verifyNoMoreInteractions(dataProviderService);
    // Validate the returned object.
    assertEquals(dataProvider, resultDataProvider);
}