test_class.declarator: processor
test_class.modifier: private
test_class.original_string: private IpTranslatorProcessor processor;
test_class.type: IpTranslatorProcessor
test_class.var_name: processor
test_class.declarator: slackMessage
test_class.modifier: private
test_class.original_string: private SlackMessage slackMessage;
test_class.type: SlackMessage
test_class.var_name: slackMessage
test_class.file: cerberus-ip-translator-lambda/src/test/java/com.nike.cerberus.lambda.waf/IpTranslatorProcessorTest.java
test_class.identifier: IpTranslatorProcessorTest
test_case.body: @Test
    public void test_that_getIpsFromSlackMessage_returns_ips_as_expected() {
      List<String> ips = processor.getIpsFromSlackMessage(slackMessage);
      assertEquals(ImmutableList.of("52.71.59.82"), ips);
    }
test_case.class_method_signature: IpTranslatorProcessorTest.test_that_getIpsFromSlackMessage_returns_ips_as_expected()
test_case.full_signature: @Test public void test_that_getIpsFromSlackMessage_returns_ips_as_expected()
test_case.identifier: test_that_getIpsFromSlackMessage_returns_ips_as_expected
test_case.invocations: getIpsFromSlackMessage assertEquals of
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void test_that_getIpsFromSlackMessage_returns_ips_as_expected()
focal_class.declarator: log = Logger.getLogger(getClass())
focal_class.original_string: Logger log = Logger.getLogger(getClass());
focal_class.type: Logger
focal_class.var_name: log
focal_class.declarator: cerberusMetadataLookup = new CerberusMetadataLookup()
focal_class.modifier: private
focal_class.original_string: private CerberusMetadataLookup cerberusMetadataLookup = new CerberusMetadataLookup();
focal_class.type: CerberusMetadataLookup
focal_class.var_name: cerberusMetadataLookup
focal_class.declarator: slackMessageSender = new SlackMessageSender()
focal_class.modifier: private
focal_class.original_string: private SlackMessageSender slackMessageSender = new SlackMessageSender();
focal_class.type: SlackMessageSender
focal_class.var_name: slackMessageSender
focal_class.file: cerberus-ip-translator-lambda/src/main/java/com.nike.cerberus.lambda.waf/IpTranslatorProcessor.java
focal_class.identifier: IpTranslatorProcessor
focal_class.class_method_signature: IpTranslatorProcessor.processMessageIfFromRateLimiter(SlackMessage message)
focal_class.full_signature: public void processMessageIfFromRateLimiter(SlackMessage message)
focal_class.identifier: processMessageIfFromRateLimiter
focal_class.modifiers: public
focal_class.parameters: (SlackMessage message)
focal_class.return: void
focal_class.signature: void processMessageIfFromRateLimiter(SlackMessage message)
focal_class.class_method_signature: IpTranslatorProcessor.isMessageFromRateLimiter(SlackMessage message)
focal_class.full_signature: protected boolean isMessageFromRateLimiter(SlackMessage message)
focal_class.identifier: isMessageFromRateLimiter
focal_class.modifiers: protected
focal_class.parameters: (SlackMessage message)
focal_class.return: boolean
focal_class.signature: boolean isMessageFromRateLimiter(SlackMessage message)
focal_class.class_method_signature: IpTranslatorProcessor.getEnvironmentFromSlackMessage(SlackMessage message)
focal_class.full_signature: protected String getEnvironmentFromSlackMessage(SlackMessage message)
focal_class.identifier: getEnvironmentFromSlackMessage
focal_class.modifiers: protected
focal_class.parameters: (SlackMessage message)
focal_class.return: String
focal_class.signature: String getEnvironmentFromSlackMessage(SlackMessage message)
focal_class.class_method_signature: IpTranslatorProcessor.translateIpToMetadata(SlackMessage message, String environment)
focal_class.full_signature: private void translateIpToMetadata(SlackMessage message, String environment)
focal_class.identifier: translateIpToMetadata
focal_class.modifiers: private
focal_class.parameters: (SlackMessage message, String environment)
focal_class.return: void
focal_class.signature: void translateIpToMetadata(SlackMessage message, String environment)
focal_class.class_method_signature: IpTranslatorProcessor.getIpsFromSlackMessage(SlackMessage message)
focal_class.full_signature: protected List<String> getIpsFromSlackMessage(SlackMessage message)
focal_class.identifier: getIpsFromSlackMessage
focal_class.modifiers: protected
focal_class.parameters: (SlackMessage message)
focal_class.return: List<String>
focal_class.signature: List<String> getIpsFromSlackMessage(SlackMessage message)
focal_class.class_method_signature: IpTranslatorProcessor.parseAndTranslateIpAddressToMetadata(String ipAddress, String environment)
focal_class.full_signature: private List<Map<String,String>> parseAndTranslateIpAddressToMetadata(String ipAddress, String environment)
focal_class.identifier: parseAndTranslateIpAddressToMetadata
focal_class.modifiers: private
focal_class.parameters: (String ipAddress, String environment)
focal_class.return: List<Map<String,String>>
focal_class.signature: List<Map<String,String>> parseAndTranslateIpAddressToMetadata(String ipAddress, String environment)
focal_method.body: protected List<String> getIpsFromSlackMessage(SlackMessage message) {
          String text = message.getText();
          List<String> parsedIps = new LinkedList<>();
  
          Arrays.stream(text.split("\\n"))
                  .filter(i -> i.startsWith("IP addresses added to auto block list:"))
                  .findFirst().ifPresent(ipAddedLine -> {
              ipAddedLine = StringUtils.removeStart(ipAddedLine, "IP addresses added to auto block list: ");
              ipAddedLine = StringUtils.removeEnd(ipAddedLine.trim(), ",");
              String[] ips = ipAddedLine.split(",");
              Arrays.stream(ips).forEach(ipLine -> {
                  parsedIps.add(ipLine.trim().split("\\s")[0]);
              });
          });
  
          return parsedIps.stream().filter(StringUtils::isNotBlank).collect(Collectors.toList());
      }
focal_method.class_method_signature: IpTranslatorProcessor.getIpsFromSlackMessage(SlackMessage message)
focal_method.full_signature: protected List<String> getIpsFromSlackMessage(SlackMessage message)
focal_method.identifier: getIpsFromSlackMessage
focal_method.invocations: getText ifPresent findFirst filter stream split startsWith removeStart removeEnd trim split forEach stream add split trim collect filter stream toList
focal_method.modifiers: protected
focal_method.parameters: (SlackMessage message)
focal_method.return: List<String>
focal_method.signature: List<String> getIpsFromSlackMessage(SlackMessage message)