@Test
public void testDeleteDataProvider() throws Exception
{

    // Create a data provider key.
    DataProviderKey dataProviderKey = new DataProviderKey(DATA_PROVIDER_NAME);
    DataProvider dataProvider = new DataProvider(DATA_PROVIDER_NAME);
    when(dataProviderService.deleteDataProvider(dataProviderKey)).thenReturn(dataProvider);
    DataProvider deletedDataProvider = dataProviderRestController.deleteDataProvider(DATA_PROVIDER_NAME);
    // Verify the external calls.
    verify(dataProviderService).deleteDataProvider(dataProviderKey);
    verifyNoMoreInteractions(dataProviderService);
    // Validate the returned object.
    assertEquals(dataProvider, deletedDataProvider);
}