use of com.google.template.soy.data.LoggingAdvisingAppendable in project closure-templates by google.
the class SanitizersTest method testFilterNoAutoescapeStreamingText.
@Test
public void testFilterNoAutoescapeStreamingText() throws IOException {
BufferingAppendable buffer = LoggingAdvisingAppendable.buffering();
LoggingAdvisingAppendable escapingBuffer = Sanitizers.filterNoAutoescapeStreaming(buffer);
escapingBuffer.setSanitizedContentKind(ContentKind.TEXT);
assertThat(buffer.getAndClearBuffer()).isEqualTo("zSoyz");
escapingBuffer.append("foo");
assertThat(buffer.getAndClearBuffer()).isEmpty();
}
use of com.google.template.soy.data.LoggingAdvisingAppendable in project closure-templates by google.
the class SanitizersTest method testFilterNoAutoescapeStreamingNoContentKind.
@Test
public void testFilterNoAutoescapeStreamingNoContentKind() throws IOException {
BufferingAppendable buffer = LoggingAdvisingAppendable.buffering();
LoggingAdvisingAppendable escapingBuffer = Sanitizers.filterNoAutoescapeStreaming(buffer);
escapingBuffer.append("foo");
assertThat(buffer.getAndClearBuffer()).isEqualTo("foo");
}
use of com.google.template.soy.data.LoggingAdvisingAppendable in project closure-templates by google.
the class SanitizersTest method testFilterNoAutoescapeStreamingHtml.
@Test
public void testFilterNoAutoescapeStreamingHtml() throws IOException {
BufferingAppendable buffer = LoggingAdvisingAppendable.buffering();
LoggingAdvisingAppendable escapingBuffer = Sanitizers.filterNoAutoescapeStreaming(buffer);
escapingBuffer.setSanitizedContentKind(ContentKind.HTML);
escapingBuffer.append("foo");
assertThat(buffer.getAndClearBuffer()).isEqualTo("foo");
}
Aggregations