config.setAll( new HttpMethodConfiguration() );
TestWagon wagon = new TestWagon();
wagon.setHttpConfiguration( config );
HeadMethod method = new HeadMethod();
wagon.setHeaders( method );
// these are the default headers.
// method.addRequestHeader( "Cache-control", "no-cache" );
// method.addRequestHeader( "Cache-store", "no-store" );
// method.addRequestHeader( "Pragma", "no-cache" );
// method.addRequestHeader( "Expires", "0" );
// method.addRequestHeader( "Accept-Encoding", "gzip" );
Header header = method.getRequestHeader( "Cache-control" );
assertNotNull( header );
assertEquals( "no-cache", header.getValue() );
header = method.getRequestHeader( "Cache-store" );
assertNotNull( header );
assertEquals( "no-store", header.getValue() );
header = method.getRequestHeader( "Pragma" );
assertNotNull( header );
assertEquals( "no-cache", header.getValue() );
header = method.getRequestHeader( "Expires" );
assertNotNull( header );
assertEquals( "0", header.getValue() );
header = method.getRequestHeader( "Accept-Encoding" );
assertNotNull( header );
assertEquals( "gzip", header.getValue() );
}