Search in sources :

Example 1 with DataProvider

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

the class DataProviderRestControllerTest method testCreateDataProvider.

@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);
}
Also used : DataProvider(org.finra.herd.model.api.xml.DataProvider) DataProviderCreateRequest(org.finra.herd.model.api.xml.DataProviderCreateRequest) Test(org.junit.Test)

Example 2 with DataProvider

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

the class DataProviderRestControllerTest method testGetDataProvider.

@Test
public void testGetDataProvider() throws Exception {
    DataProvider dataProvider = new DataProvider(DATA_PROVIDER_NAME);
    DataProviderKey dataProviderKey = new DataProviderKey(DATA_PROVIDER_NAME);
    when(dataProviderService.getDataProvider(dataProviderKey)).thenReturn(dataProvider);
    // Retrieve the data provider.
    DataProvider resultDataProvider = dataProviderRestController.getDataProvider(DATA_PROVIDER_NAME);
    // Verify the external calls.
    verify(dataProviderService).getDataProvider(dataProviderKey);
    verifyNoMoreInteractions(dataProviderService);
    // Validate the returned object.
    assertEquals(dataProvider, resultDataProvider);
}
Also used : DataProvider(org.finra.herd.model.api.xml.DataProvider) DataProviderKey(org.finra.herd.model.api.xml.DataProviderKey) Test(org.junit.Test)

Example 3 with DataProvider

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

the class DataProviderServiceTest method testGetDataProviderLowerCaseParameters.

@Test
public void testGetDataProviderLowerCaseParameters() {
    // Create and persist a data provider entity.
    dataProviderDaoTestHelper.createDataProviderEntity(DATA_PROVIDER_NAME);
    // Retrieve the data provider using lower case input parameters.
    DataProvider resultDataProvider = dataProviderService.getDataProvider(new DataProviderKey(DATA_PROVIDER_NAME.toLowerCase()));
    // Validate the returned object.
    assertEquals(new DataProvider(DATA_PROVIDER_NAME), resultDataProvider);
}
Also used : DataProvider(org.finra.herd.model.api.xml.DataProvider) DataProviderKey(org.finra.herd.model.api.xml.DataProviderKey) Test(org.junit.Test)

Example 4 with DataProvider

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

the class DataProviderServiceTest method testCreateDataProviderUpperCaseParameters.

@Test
public void testCreateDataProviderUpperCaseParameters() {
    // Create a data provider using upper case input parameters.
    DataProvider resultDataProvider = dataProviderService.createDataProvider(new DataProviderCreateRequest(DATA_PROVIDER_NAME.toUpperCase()));
    // Validate the returned object.
    assertEquals(new DataProvider(DATA_PROVIDER_NAME.toUpperCase()), resultDataProvider);
}
Also used : DataProvider(org.finra.herd.model.api.xml.DataProvider) DataProviderCreateRequest(org.finra.herd.model.api.xml.DataProviderCreateRequest) Test(org.junit.Test)

Example 5 with DataProvider

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

the class DataProviderServiceTest method testGetDataProvider.

@Test
public void testGetDataProvider() throws Exception {
    // Create and persist a data provider entity.
    dataProviderDaoTestHelper.createDataProviderEntity(DATA_PROVIDER_NAME);
    // Retrieve the data provider.
    DataProvider resultDataProvider = dataProviderService.getDataProvider(new DataProviderKey(DATA_PROVIDER_NAME));
    // Validate the returned object.
    assertEquals(new DataProvider(DATA_PROVIDER_NAME), resultDataProvider);
}
Also used : DataProvider(org.finra.herd.model.api.xml.DataProvider) DataProviderKey(org.finra.herd.model.api.xml.DataProviderKey) Test(org.junit.Test)

Aggregations

DataProvider (org.finra.herd.model.api.xml.DataProvider)16 Test (org.junit.Test)15 DataProviderKey (org.finra.herd.model.api.xml.DataProviderKey)10 DataProviderCreateRequest (org.finra.herd.model.api.xml.DataProviderCreateRequest)5