UrlRewriteProcessor processor = new UrlRewriteProcessor();
UrlRewriteRulesDescriptor config = UrlRewriteRulesDescriptorFactory.load(
"xml", getTestResourceReader( "rewrite.xml", "UTF-8" ) );
processor.initialize( environment, config );
Template inputUrl = Parser.parse( "test-scheme://test-host:1/test-input-path" );
Template outputUrl = processor.rewrite( null, inputUrl, UrlRewriter.Direction.IN );
assertThat( "Expect rewrite to produce a new URL",
outputUrl, notNullValue() );
assertThat(
"Expect rewrite to contain the correct path.",
outputUrl.toString(), is( "test-scheme://test-host:1/test-output-path" ) );
processor.destroy();
}