test_class.file: herd-code/herd-service/src/test/java/org/finra/herd/service/helper/AwsServiceHelperTest.java
test_class.identifier: AwsServiceHelperTest
test_class.superclass: extends AbstractServiceTest
test_case.body: @Test
      public void testHandleAmazonException()
      {
          try
          {
              AmazonServiceException amazonServiceException = new AmazonServiceException(ERROR_MESSAGE);
              awsServiceHelper.handleAmazonException(amazonServiceException, MESSAGE_TEXT);
              fail();
          }
          catch (AmazonServiceException amazonServiceException)
          {
              assertThat("Error message not correct.", amazonServiceException.getMessage().contains(ERROR_MESSAGE), is(true));
          }
      }
test_case.class_method_signature: AwsServiceHelperTest.testHandleAmazonException()
test_case.full_signature: @Test public void testHandleAmazonException()
test_case.identifier: testHandleAmazonException
test_case.invocations: handleAmazonException fail assertThat contains getMessage is
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testHandleAmazonException()
focal_class.file: herd-code/herd-service/src/main/java/org/finra/herd/service/helper/AwsServiceHelper.java
focal_class.identifier: AwsServiceHelper
focal_class.class_method_signature: AwsServiceHelper.handleAmazonException(AmazonServiceException amazonServiceException, String message)
focal_class.full_signature: public void handleAmazonException(AmazonServiceException amazonServiceException, String message)
focal_class.identifier: handleAmazonException
focal_class.modifiers: public
focal_class.parameters: (AmazonServiceException amazonServiceException, String message)
focal_class.return: void
focal_class.signature: void handleAmazonException(AmazonServiceException amazonServiceException, String message)
focal_method.body: public void handleAmazonException(AmazonServiceException amazonServiceException, String message) throws IllegalArgumentException, ObjectNotFoundException
      {
          if (amazonServiceException.getStatusCode() == HttpStatus.SC_BAD_REQUEST)
          {
              throw new IllegalArgumentException(message + " Reason: " + amazonServiceException.getMessage(), amazonServiceException);
          }
          else if (amazonServiceException.getStatusCode() == HttpStatus.SC_NOT_FOUND)
          {
              throw new ObjectNotFoundException(message + " Reason: " + amazonServiceException.getMessage(), amazonServiceException);
          }
  
          throw amazonServiceException;
      }
focal_method.class_method_signature: AwsServiceHelper.handleAmazonException(AmazonServiceException amazonServiceException, String message)
focal_method.full_signature: public void handleAmazonException(AmazonServiceException amazonServiceException, String message)
focal_method.identifier: handleAmazonException
focal_method.invocations: getStatusCode getMessage getStatusCode getMessage
focal_method.modifiers: public
focal_method.parameters: (AmazonServiceException amazonServiceException, String message)
focal_method.return: void
focal_method.signature: void handleAmazonException(AmazonServiceException amazonServiceException, String message)