}
public void testEncode()
{
MockControl control = newControl(ServiceEncoding.class);
ServiceEncoding encoding = (ServiceEncoding) control.getMock();
encoding.getParameterValue(ServiceConstants.SERVICE);
control.setReturnValue(Tapestry.ASSET_SERVICE);
encoding.getParameterValue(AssetService.PATH);
control.setReturnValue("/foo/bar/Baz.gif");
encoding.getParameterValue(AssetService.DIGEST);
control.setReturnValue("12345");
encoding.setServletPath("/assets/12345/foo/bar/Baz.gif");
encoding.setParameterValue(AssetService.PATH, null);
encoding.setParameterValue(AssetService.DIGEST, null);
encoding.setParameterValue(ServiceConstants.SERVICE, null);
replayControls();
AssetEncoder encoder = new AssetEncoder();
encoder.setPath("/assets/");