test_class.declarator: emailService
test_class.original_string: EmailService emailService;
test_class.type: EmailService
test_class.var_name: emailService
test_class.declarator: STUB_SECRET = "stub-secret"
test_class.modifier: private static final
test_class.original_string: private static final String STUB_SECRET = "stub-secret";
test_class.type: String
test_class.var_name: STUB_SECRET
test_class.declarator: STUB_KEY = "stub-key"
test_class.modifier: private static final
test_class.original_string: private static final String STUB_KEY = "stub-key";
test_class.type: String
test_class.var_name: STUB_KEY
test_class.file: antenna/src/test/java/com/oneops/antenna/senders/aws/EmailServiceTest.java
test_class.identifier: EmailServiceTest
test_case.body: @Test
      public void postMessage() {
          NotificationMessage msg = new NotificationMessage();
          EmailSubscriber sub = mock(EmailSubscriber.class);
          when(sub.getEmail()).thenReturn(null);
          boolean result = this.emailService.postMessage(msg, sub);
          assertTrue(result);
      }
test_case.class_method_signature: EmailServiceTest.postMessage()
test_case.full_signature: @Test public void postMessage()
test_case.identifier: postMessage
test_case.invocations: mock thenReturn when getEmail postMessage assertTrue
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void postMessage()
focal_class.declarator: logger = Logger.getLogger(EmailService.class)
focal_class.modifier: private static
focal_class.original_string: private static Logger logger = Logger.getLogger(EmailService.class);
focal_class.type: Logger
focal_class.var_name: logger
focal_class.declarator: fromAddress = "info@oneops.com"
focal_class.modifier: private static final
focal_class.original_string: private static final String fromAddress = "info@oneops.com";
focal_class.type: String
focal_class.var_name: fromAddress
focal_class.declarator: awsAccessKey
focal_class.modifier: private
focal_class.original_string: private String awsAccessKey;
focal_class.type: String
focal_class.var_name: awsAccessKey
focal_class.declarator: awsSecretKey
focal_class.modifier: private
focal_class.original_string: private String awsSecretKey;
focal_class.type: String
focal_class.var_name: awsSecretKey
focal_class.declarator: emailClient
focal_class.modifier: private
focal_class.original_string: private AmazonSimpleEmailServiceClient emailClient;
focal_class.type: AmazonSimpleEmailServiceClient
focal_class.var_name: emailClient
focal_class.file: antenna/src/main/java/com/oneops/antenna/senders/aws/EmailService.java
focal_class.identifier: EmailService
focal_class.interfaces: implements NotificationSender
focal_class.class_method_signature: EmailService.getAwsAccessKey()
focal_class.full_signature: public String getAwsAccessKey()
focal_class.identifier: getAwsAccessKey
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String getAwsAccessKey()
focal_class.class_method_signature: EmailService.setAwsAccessKey(String awsAccessKey)
focal_class.full_signature: public void setAwsAccessKey(String awsAccessKey)
focal_class.identifier: setAwsAccessKey
focal_class.modifiers: public
focal_class.parameters: (String awsAccessKey)
focal_class.return: void
focal_class.signature: void setAwsAccessKey(String awsAccessKey)
focal_class.class_method_signature: EmailService.getAwsSecretKey()
focal_class.full_signature: public String getAwsSecretKey()
focal_class.identifier: getAwsSecretKey
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: String
focal_class.signature: String getAwsSecretKey()
focal_class.class_method_signature: EmailService.setAwsSecretKey(String awsSecretKey)
focal_class.full_signature: public void setAwsSecretKey(String awsSecretKey)
focal_class.identifier: setAwsSecretKey
focal_class.modifiers: public
focal_class.parameters: (String awsSecretKey)
focal_class.return: void
focal_class.signature: void setAwsSecretKey(String awsSecretKey)
focal_class.class_method_signature: EmailService.init()
focal_class.full_signature: public void init()
focal_class.identifier: init
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void init()
focal_class.class_method_signature: EmailService.postMessage(NotificationMessage msg,
                                 BasicSubscriber subscriber)
focal_class.full_signature: @Override public boolean postMessage(NotificationMessage msg,
                                 BasicSubscriber subscriber)
focal_class.identifier: postMessage
focal_class.modifiers: @Override public
focal_class.parameters: (NotificationMessage msg,
                                 BasicSubscriber subscriber)
focal_class.return: boolean
focal_class.signature: boolean postMessage(NotificationMessage msg,
                                 BasicSubscriber subscriber)
focal_class.class_method_signature: EmailService.sendEmail(EmailMessage eMsg)
focal_class.full_signature: public boolean sendEmail(EmailMessage eMsg)
focal_class.identifier: sendEmail
focal_class.modifiers: public
focal_class.parameters: (EmailMessage eMsg)
focal_class.return: boolean
focal_class.signature: boolean sendEmail(EmailMessage eMsg)
focal_class.class_method_signature: EmailService.buildEMessage(NotificationMessage nmsg, List<String> toAddresses)
focal_class.full_signature: private EmailMessage buildEMessage(NotificationMessage nmsg, List<String> toAddresses)
focal_class.identifier: buildEMessage
focal_class.modifiers: private
focal_class.parameters: (NotificationMessage nmsg, List<String> toAddresses)
focal_class.return: EmailMessage
focal_class.signature: EmailMessage buildEMessage(NotificationMessage nmsg, List<String> toAddresses)
focal_class.class_method_signature: EmailService.processTemplate(NotificationMessage msg)
focal_class.full_signature: private void processTemplate(NotificationMessage msg)
focal_class.identifier: processTemplate
focal_class.modifiers: private
focal_class.parameters: (NotificationMessage msg)
focal_class.return: void
focal_class.signature: void processTemplate(NotificationMessage msg)
focal_method.body: @Override
      public boolean postMessage(NotificationMessage msg,
                                 BasicSubscriber subscriber) {
  
          EmailSubscriber esub;
          if (subscriber instanceof EmailSubscriber) {
              esub = (EmailSubscriber) subscriber;
          } else {
              throw new ClassCastException("invalid subscriber " + subscriber.getClass().getName());
          }
  
          List<String> emails = new ArrayList<>();
          if (esub.getEmail() != null) {
              emails.add(esub.getEmail());
          }
          if (emails.size() > 0) {
              EmailMessage emsg = buildEMessage(msg, emails);
              return sendEmail(emsg);
          }
  
          return true;
      }
focal_method.class_method_signature: EmailService.postMessage(NotificationMessage msg,
                                 BasicSubscriber subscriber)
focal_method.full_signature: @Override public boolean postMessage(NotificationMessage msg,
                                 BasicSubscriber subscriber)
focal_method.identifier: postMessage
focal_method.invocations: getName getClass getEmail add getEmail size buildEMessage sendEmail
focal_method.modifiers: @Override public
focal_method.parameters: (NotificationMessage msg,
                                 BasicSubscriber subscriber)
focal_method.return: boolean
focal_method.signature: boolean postMessage(NotificationMessage msg,
                                 BasicSubscriber subscriber)