use of org.finra.herd.model.api.xml.DataProviderCreateRequest in project herd by FINRAOS.
the class DataProviderServiceTest method testCreateDataProviderLowerCaseParameters.
@Test
public void testCreateDataProviderLowerCaseParameters() {
// Create a data provider using lower case input parameters.
DataProvider resultDataProvider = dataProviderService.createDataProvider(new DataProviderCreateRequest(DATA_PROVIDER_NAME.toLowerCase()));
// Validate the returned object.
assertEquals(new DataProvider(DATA_PROVIDER_NAME.toLowerCase()), resultDataProvider);
}
use of org.finra.herd.model.api.xml.DataProviderCreateRequest in project herd by FINRAOS.
the class DataProviderServiceTest method testCreateDataProviderTrimParameters.
@Test
public void testCreateDataProviderTrimParameters() {
// Create a data provider using input parameters with leading and trailing empty spaces.
DataProvider resultDataProvider = dataProviderService.createDataProvider(new DataProviderCreateRequest(addWhitespace(DATA_PROVIDER_NAME)));
// Validate the returned object.
assertEquals(new DataProvider(DATA_PROVIDER_NAME), resultDataProvider);
}
use of org.finra.herd.model.api.xml.DataProviderCreateRequest in project herd by FINRAOS.
the class DataProviderServiceTest method testCreateDataProviderAlreadyExists.
@Test
public void testCreateDataProviderAlreadyExists() throws Exception {
// Create and persist a data provider.
dataProviderDaoTestHelper.createDataProviderEntity(DATA_PROVIDER_NAME);
// Try to create a data provider when it already exists.
try {
dataProviderService.createDataProvider(new DataProviderCreateRequest(DATA_PROVIDER_NAME));
fail("Should throw an AlreadyExistsException when data provider already exists.");
} catch (AlreadyExistsException e) {
assertEquals(String.format("Unable to create data provider \"%s\" because it already exists.", DATA_PROVIDER_NAME), e.getMessage());
}
}
Aggregations