@Test public void createNew_WHEN_ValidPattern_THEN_ShouldInitInternalPatternSuccessfully() { final Map<String, String> validPatterns = new HashMap<String, String>(); validPatterns.put("org.test.controller.gather.status.400", "^\\Qorg.test.controller.gather.status.400\\E$"); validPatterns.put("org.test.controller.*.status.400", "^\\Qorg.test.controller.\\E([^.]*)\\Q.status.400\\E$"); validPatterns.put("org.test.controller.*.status.*", "^\\Qorg.test.controller.\\E([^.]*)\\Q.status.\\E([^.]*)\\Q\\E$"); validPatterns.put("*.test.controller.*.status.*", "^\\Q\\E([^.]*)\\Q.test.controller.\\E([^.]*)\\Q.status.\\E([^.]*)\\Q\\E$"); for (Map.Entry<String, String> expected : validPatterns.entrySet()) { final GraphiteNamePattern pattern = new GraphiteNamePattern(expected.getKey()); Assertions.assertThat(pattern.getPatternString()).isEqualTo(expected.getValue()); } }
String getPatternString() { return this.patternStr; }
GraphiteNamePattern { String getPatternString() { return this.patternStr; } }
GraphiteNamePattern { String getPatternString() { return this.patternStr; } GraphiteNamePattern(final String pattern); }
GraphiteNamePattern { String getPatternString() { return this.patternStr; } GraphiteNamePattern(final String pattern);  }
GraphiteNamePattern { String getPatternString() { return this.patternStr; } GraphiteNamePattern(final String pattern);   }