Search in sources :

Example 16 with BusinessObjectDataStatusUpdateRequest

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

the class BusinessObjectDataStatusServiceTest method testBusinessObjectDataStatusServiceMethodsNewTransactionPropagation.

/**
 * This method is to get coverage for the business object data status service methods that have an explicit annotation for transaction propagation.
 */
@Test
public void testBusinessObjectDataStatusServiceMethodsNewTransactionPropagation() {
    // Create a business object data key.
    BusinessObjectDataKey businessObjectDataKey = new BusinessObjectDataKey(BDEF_NAMESPACE, BDEF_NAME, FORMAT_USAGE_CODE, FORMAT_FILE_TYPE_CODE, FORMAT_VERSION, PARTITION_VALUE, SUBPARTITION_VALUES, DATA_VERSION);
    // Try to retrieve a business object data status when specified business object data instance does not exist.
    try {
        businessObjectDataStatusServiceImpl.getBusinessObjectDataStatus(businessObjectDataKey, NO_PARTITION_KEY);
        fail("Should throw an ObjectNotFoundException when not able to find business object data.");
    } catch (ObjectNotFoundException e) {
        assertEquals(businessObjectDataServiceTestHelper.getExpectedBusinessObjectDataNotFoundErrorMessage(businessObjectDataKey, NO_BDATA_STATUS), e.getMessage());
    }
    // Try to update a business object data status when specified business object data instance does not exist.
    try {
        businessObjectDataStatusServiceImpl.updateBusinessObjectDataStatus(businessObjectDataKey, new BusinessObjectDataStatusUpdateRequest(BDATA_STATUS_2));
        fail("Should throw an ObjectNotFoundException when not able to find business object data.");
    } catch (ObjectNotFoundException e) {
        assertEquals(businessObjectDataServiceTestHelper.getExpectedBusinessObjectDataNotFoundErrorMessage(businessObjectDataKey, NO_BDATA_STATUS), e.getMessage());
    }
}
Also used : ObjectNotFoundException(org.finra.herd.model.ObjectNotFoundException) BusinessObjectDataStatusUpdateRequest(org.finra.herd.model.api.xml.BusinessObjectDataStatusUpdateRequest) BusinessObjectDataKey(org.finra.herd.model.api.xml.BusinessObjectDataKey) Test(org.junit.Test)

Aggregations

BusinessObjectDataStatusUpdateRequest (org.finra.herd.model.api.xml.BusinessObjectDataStatusUpdateRequest)16 Test (org.junit.Test)14 BusinessObjectDataKey (org.finra.herd.model.api.xml.BusinessObjectDataKey)13 BusinessObjectDataStatusUpdateResponse (org.finra.herd.model.api.xml.BusinessObjectDataStatusUpdateResponse)10 ObjectNotFoundException (org.finra.herd.model.ObjectNotFoundException)3 UploadSingleInitiationResponse (org.finra.herd.model.api.xml.UploadSingleInitiationResponse)2 UploadDownloadServiceImpl (org.finra.herd.service.impl.UploadDownloadServiceImpl)2 StringWriter (java.io.StringWriter)1 JAXBContext (javax.xml.bind.JAXBContext)1 Marshaller (javax.xml.bind.Marshaller)1 HttpPut (org.apache.http.client.methods.HttpPut)1 URIBuilder (org.apache.http.client.utils.URIBuilder)1 StringEntity (org.apache.http.entity.StringEntity)1 CloseableHttpClient (org.apache.http.impl.client.CloseableHttpClient)1