use of org.finra.herd.model.api.xml.BusinessObjectDataDdlCollectionRequest in project herd by FINRAOS.
the class BusinessObjectDataServiceTest method testBusinessObjectDataServiceMethodsNewTx.
/**
* This method is to get the coverage for the business object data service method that starts the new transaction.
*/
@Test
public void testBusinessObjectDataServiceMethodsNewTx() throws Exception {
BusinessObjectDataAvailabilityRequest businessObjectDataAvailabilityRequest = new BusinessObjectDataAvailabilityRequest();
try {
businessObjectDataServiceImpl.checkBusinessObjectDataAvailability(businessObjectDataAvailabilityRequest);
fail("Should throw an IllegalArgumentException.");
} catch (IllegalArgumentException e) {
assertEquals("A namespace must be specified.", e.getMessage());
}
BusinessObjectDataAvailabilityCollectionRequest businessObjectDataAvailabilityCollectionRequest = new BusinessObjectDataAvailabilityCollectionRequest();
try {
businessObjectDataServiceImpl.checkBusinessObjectDataAvailabilityCollection(businessObjectDataAvailabilityCollectionRequest);
fail("Should throw an IllegalArgumentException.");
} catch (IllegalArgumentException e) {
assertEquals("At least one business object data availability request must be specified.", e.getMessage());
}
BusinessObjectDataCreateRequest businessObjectDataCreateRequest = new BusinessObjectDataCreateRequest();
try {
businessObjectDataServiceImpl.createBusinessObjectData(businessObjectDataCreateRequest);
fail("Should throw an IllegalArgumentException.");
} catch (IllegalArgumentException e) {
assertEquals("A namespace must be specified.", e.getMessage());
}
try {
businessObjectDataServiceImpl.getBusinessObjectData(new BusinessObjectDataKey(), null, NO_BDATA_STATUS, NO_INCLUDE_BUSINESS_OBJECT_DATA_STATUS_HISTORY, NO_INCLUDE_STORAGE_UNIT_STATUS_HISTORY);
fail("Should throw an IllegalArgumentException.");
} catch (IllegalArgumentException e) {
assertEquals("A namespace must be specified.", e.getMessage());
}
try {
businessObjectDataServiceImpl.generateBusinessObjectDataDdl(new BusinessObjectDataDdlRequest());
fail("Should throw an IllegalArgumentException.");
} catch (IllegalArgumentException e) {
assertEquals("A namespace must be specified.", e.getMessage());
}
try {
businessObjectDataServiceImpl.generateBusinessObjectDataDdlCollection(new BusinessObjectDataDdlCollectionRequest());
fail("Should throw an IllegalArgumentException.");
} catch (IllegalArgumentException e) {
assertEquals("At least one business object data DDL request must be specified.", e.getMessage());
}
try {
businessObjectDataServiceImpl.invalidateUnregisteredBusinessObjectData(new BusinessObjectDataInvalidateUnregisteredRequest());
} catch (IllegalArgumentException e) {
assertEquals("The namespace is required", e.getMessage());
}
try {
businessObjectDataServiceImpl.retryStoragePolicyTransition(new BusinessObjectDataKey(), new BusinessObjectDataRetryStoragePolicyTransitionRequest());
} catch (IllegalArgumentException e) {
assertEquals("A namespace must be specified.", e.getMessage());
}
try {
businessObjectDataServiceImpl.restoreBusinessObjectData(new BusinessObjectDataKey(), EXPIRATION_IN_DAYS);
} catch (IllegalArgumentException e) {
assertEquals("A namespace must be specified.", e.getMessage());
}
}
use of org.finra.herd.model.api.xml.BusinessObjectDataDdlCollectionRequest in project herd by FINRAOS.
the class BusinessObjectDataServiceGenerateBusinessObjectDataDllCollectionTest method testGenerateBusinessObjectDataDdlCollectionMissingRequiredParameters.
@Test
public void testGenerateBusinessObjectDataDdlCollectionMissingRequiredParameters() {
BusinessObjectDataDdlCollectionRequest request;
// Try to generate business object data ddl collection collection when business object data ddl collection request is null.
try {
businessObjectDataService.generateBusinessObjectDataDdlCollection(null);
fail("Should throw an IllegalArgumentException when business object data DDL collection request is null.");
} catch (IllegalArgumentException e) {
assertEquals("A business object data DDL collection request must be specified.", e.getMessage());
}
// Try to generate business object data ddl collection collection when business object data ddl request is not specified.
request = businessObjectDataServiceTestHelper.getTestBusinessObjectDataDdlCollectionRequest();
for (List<BusinessObjectDataDdlRequest> businessObjectDataDdlRequests : Arrays.asList(null, new ArrayList<BusinessObjectDataDdlRequest>())) {
request.setBusinessObjectDataDdlRequests(businessObjectDataDdlRequests);
try {
businessObjectDataService.generateBusinessObjectDataDdlCollection(request);
fail("Should throw an IllegalArgumentException when business object data DDL request is not specified.");
} catch (IllegalArgumentException e) {
assertEquals("At least one business object data DDL request must be specified.", e.getMessage());
}
}
// Try to generate business object data ddl collection collection when business object data ddl request is null.
request = businessObjectDataServiceTestHelper.getTestBusinessObjectDataDdlCollectionRequest();
request.getBusinessObjectDataDdlRequests().set(0, null);
try {
businessObjectDataService.generateBusinessObjectDataDdlCollection(request);
fail("Should throw an IllegalArgumentException when business object data DDL request is null.");
} catch (IllegalArgumentException e) {
assertEquals("A business object data DDL request must be specified.", e.getMessage());
}
}
Aggregations