Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package de.agilecoders.wicket.logging;
 
 import org.junit.Test;
 
 import static org.hamcrest.CoreMatchers.equalTo;
 import static org.hamcrest.CoreMatchers.is;
 import static org.hamcrest.MatcherAssert.assertThat;

Tests the ILogCleaner.DefaultLogCleaner class.

Author(s):
miha
public class LogCleanerTest {
    @Test
    public void stringGetsCleaned() {
        assertThat(new ILogCleaner.DefaultLogCleaner().clean("v\ra\nlu\te"), is(equalTo("value")));
    }
    @Test
    public void stringValueGetsCleaned() {
        assertThat(new ILogCleaner.DefaultLogCleaner().clean(StringValue.valueOf("v\ra\nlu\te")), is(equalTo("value")));
    }
    @Test
    public void pathStringGetsCleaned() {
        assertThat(new ILogCleaner.DefaultLogCleaner().toCleanPath(Url.parse("http://url\r.to/path/page").toString(..)), is(equalTo("/path/page")));
    }
    @Test
    public void pathStringValueGetsCleaned() {
        assertThat(new ILogCleaner.DefaultLogCleaner().toCleanPath(StringValue.valueOf(Url.parse("http://\nurl.to/path/page").toString(..))), is(equalTo("/path/page")));
    }
New to GrepCode? Check out our FAQ X