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