@Test
 public void shouldEnsureTrackingToolLinkContainsIDForTheMatchingRegexGroup() {
   TrackingTool trackingTool = new TrackingTool("http://no-id.com", "some-regex");
   trackingTool.validate(null);
   ConfigErrors configErrors = trackingTool.errors();
   List<String> errors = configErrors.getAllOn(TrackingTool.LINK);
   assertThat(errors.size(), is(1));
   assertThat(
       errors,
       hasItem(
           "Link must be a URL containing '${ID}'. Go will replace the string '${ID}' with the first matched group from the regex at run-time."));
 }
Esempio n. 2
0
 public void addError(String fieldName, String message) {
   errors.add(fieldName, message);
 }