@Test public void sanitized_text_contains_one_sanitizer_message() { YamlSanitizerContext context = new YamlSanitizerContext(); supportToTest.sanitize("{{.A_VARIABLE}}", context); assertTrue(context.hasSanitizerMessage()); assertEquals(1, context.getSanitizerMessages().size()); }
public String sanitize(String source, YamlSanitizerContext context) { int index = source.indexOf(GO_TEMPLATE_START); if (index == -1) { return source; } String sourceNoLeading = sanitizeGoTemplatesWithoutContentBefore(source); String sourceResult = sanitizeGoTemplatesAfterCharacters(context, sourceNoLeading); return sourceResult; }
GoTemplateSanitizer implements YamlSanitizer { public String sanitize(String source, YamlSanitizerContext context) { int index = source.indexOf(GO_TEMPLATE_START); if (index == -1) { return source; } String sourceNoLeading = sanitizeGoTemplatesWithoutContentBefore(source); String sourceResult = sanitizeGoTemplatesAfterCharacters(context, sourceNoLeading); return sourceResult; } }
GoTemplateSanitizer implements YamlSanitizer { public String sanitize(String source, YamlSanitizerContext context) { int index = source.indexOf(GO_TEMPLATE_START); if (index == -1) { return source; } String sourceNoLeading = sanitizeGoTemplatesWithoutContentBefore(source); String sourceResult = sanitizeGoTemplatesAfterCharacters(context, sourceNoLeading); return sourceResult; }  }
GoTemplateSanitizer implements YamlSanitizer { public String sanitize(String source, YamlSanitizerContext context) { int index = source.indexOf(GO_TEMPLATE_START); if (index == -1) { return source; } String sourceNoLeading = sanitizeGoTemplatesWithoutContentBefore(source); String sourceResult = sanitizeGoTemplatesAfterCharacters(context, sourceNoLeading); return sourceResult; }  String sanitize(String source, YamlSanitizerContext context); }
GoTemplateSanitizer implements YamlSanitizer { public String sanitize(String source, YamlSanitizerContext context) { int index = source.indexOf(GO_TEMPLATE_START); if (index == -1) { return source; } String sourceNoLeading = sanitizeGoTemplatesWithoutContentBefore(source); String sourceResult = sanitizeGoTemplatesAfterCharacters(context, sourceNoLeading); return sourceResult; }  String sanitize(String source, YamlSanitizerContext context); static final Pattern PATTERN_CURLYBRACES_OPEN; static final Pattern PATTERN_CURLYBRACES_CLOSE; static final Pattern PATTERN_TO_REDUCED_INSIDE; }