@Test public void testGetSeverity() { assertThat(cut.getSeverity("@severity-high request")).isEqualTo("high"); assertThat(cut.getSeverity("@severity-sanity-check request")).isEqualTo("sanity-check"); assertThat(cut.getSeverity("@severity-high folder", "request")).isEqualTo("high"); assertThat(cut.getSeverity("@severity-high folder", "@severity-medium request")).isEqualTo("medium"); assertThat(cut.getSeverity("base-folder", "@severity-sanity-check folder", "@severity-medium sub-folder", "request")).isEqualTo("medium"); assertThat(cut.getSeverity("@severity-SANITY-CHECK request")).isEmpty(); assertThat(cut.getSeverity("high request")).isEmpty(); assertThat(cut.getSeverity("@severity-sanity-check Some ")).isEqualTo("sanity-check"); assertThat(cut.getSeverity("@severity-higher-sanity-check- Some ")).isEqualTo("higher-sanity-check"); assertThat(cut.getSeverity("@severity-high- Some ")).isEqualTo("high"); }
String getSeverity(String... path) { for (int i = path.length - 1; i >= 0; i--) { final Matcher matcher = SEVERITY_PATTERN.matcher(path[i]); if (matcher.matches()) { return matcher.group(1).substring(Tag.SEVERITY_PREFIX.length()); } } return ""; }
PostmanService { String getSeverity(String... path) { for (int i = path.length - 1; i >= 0; i--) { final Matcher matcher = SEVERITY_PATTERN.matcher(path[i]); if (matcher.matches()) { return matcher.group(1).substring(Tag.SEVERITY_PREFIX.length()); } } return ""; } }
PostmanService { String getSeverity(String... path) { for (int i = path.length - 1; i >= 0; i--) { final Matcher matcher = SEVERITY_PATTERN.matcher(path[i]); if (matcher.matches()) { return matcher.group(1).substring(Tag.SEVERITY_PREFIX.length()); } } return ""; }  }
PostmanService { String getSeverity(String... path) { for (int i = path.length - 1; i >= 0; i--) { final Matcher matcher = SEVERITY_PATTERN.matcher(path[i]); if (matcher.matches()) { return matcher.group(1).substring(Tag.SEVERITY_PREFIX.length()); } } return ""; }  void parse(JsonParser parser, NewmanParsingResult result); List<ExecutedScenario> postProcess(Run run, NewmanParsingResult result, String newmanReportPath, AtomicInteger requestPosition); void deleteTempFiles(NewmanParsingResult newmanParsingResult); }
PostmanService { String getSeverity(String... path) { for (int i = path.length - 1; i >= 0; i--) { final Matcher matcher = SEVERITY_PATTERN.matcher(path[i]); if (matcher.matches()) { return matcher.group(1).substring(Tag.SEVERITY_PREFIX.length()); } } return ""; }  void parse(JsonParser parser, NewmanParsingResult result); List<ExecutedScenario> postProcess(Run run, NewmanParsingResult result, String newmanReportPath, AtomicInteger requestPosition); void deleteTempFiles(NewmanParsingResult newmanParsingResult); static final String FOLDER_DELIMITER; }