return resource(path, new ByteArrayInputStream(content.getBytes()));
}
public ResourcesBuilder resource(String path, InputStream content) {
Resource r = mock(Resource.class);
when(r.path()).thenReturn(path);
when(r.name()).thenReturn(path.substring(path.lastIndexOf('/')+1));
when(r.getType()).thenReturn(Type.RESOURCE);
when(r.lastmodified()).thenReturn( System.currentTimeMillis() );
when(r.in()).thenReturn(content);
when(r.out()).thenReturn(new ByteArrayOutputStream());