Rename ResolvedResource to HttpResource

`ResolvedResource` is a rather generic name - changing the extended
interface to something more meaningful: `HttpResource`.
For now, implementations are linked with the resource handling chain,
but this aspect has been removed from the interface documentation.

Issue: SPR-14264
This commit is contained in:
Brian Clozel
2016-09-09 18:18:09 +02:00
parent 2f2e6dffb4
commit 4588b6c9f4
14 changed files with 82 additions and 94 deletions

View File

@@ -111,8 +111,8 @@ public class GzipResourceResolverTests {
Resource resource = new ClassPathResource("test/"+gzFile, getClass());
assertEquals(resource.getDescription(), resolved.getDescription());
assertEquals(new ClassPathResource("test/" + file).getFilename(), resolved.getFilename());
assertTrue("Expected " + resolved + " to be of type " + ResolvedResource.class,
resolved instanceof ResolvedResource);
assertTrue("Expected " + resolved + " to be of type " + HttpResource.class,
resolved instanceof HttpResource);
}
@Test
@@ -126,8 +126,8 @@ public class GzipResourceResolverTests {
Resource resource = new ClassPathResource("test/"+gzFile, getClass());
assertEquals(resource.getDescription(), resolved.getDescription());
assertEquals(new ClassPathResource("test/"+file).getFilename(), resolved.getFilename());
assertTrue("Expected " + resolved + " to be of type " + ResolvedResource.class,
resolved instanceof ResolvedResource);
assertTrue("Expected " + resolved + " to be of type " + HttpResource.class,
resolved instanceof HttpResource);
}
@Test
@@ -141,8 +141,8 @@ public class GzipResourceResolverTests {
Resource gzResource = new ClassPathResource("test/"+gzFile, getClass());
assertEquals(gzResource.getDescription(), resolved.getDescription());
assertEquals(new ClassPathResource("test/" + file).getFilename(), resolved.getFilename());
assertTrue("Expected " + resolved + " to be of type " + ResolvedResource.class,
resolved instanceof ResolvedResource);
assertTrue("Expected " + resolved + " to be of type " + HttpResource.class,
resolved instanceof HttpResource);
// resolved resource is now cached in CachingResourceResolver
@@ -152,8 +152,8 @@ public class GzipResourceResolverTests {
Resource resource = new ClassPathResource("test/"+file, getClass());
assertEquals(resource.getDescription(), resolved.getDescription());
assertEquals(new ClassPathResource("test/" + file).getFilename(), resolved.getFilename());
assertFalse("Expected " + resolved + " to *not* be of type " + ResolvedResource.class,
resolved instanceof ResolvedResource);
assertFalse("Expected " + resolved + " to *not* be of type " + HttpResource.class,
resolved instanceof HttpResource);
}
@Test // SPR-13149
@@ -165,8 +165,8 @@ public class GzipResourceResolverTests {
Resource gzResource = new ClassPathResource("test/"+gzFile, getClass());
assertEquals(gzResource.getDescription(), resolved.getDescription());
assertEquals(new ClassPathResource("test/" + file).getFilename(), resolved.getFilename());
assertTrue("Expected " + resolved + " to be of type " + ResolvedResource.class,
resolved instanceof ResolvedResource);
assertTrue("Expected " + resolved + " to be of type " + HttpResource.class,
resolved instanceof HttpResource);
}
}

View File

@@ -150,8 +150,8 @@ public class VersionResourceResolverTests {
Resource actual = this.resolver.resolveResourceInternal(request, versionFile, this.locations, this.chain);
assertEquals(expected.getFilename(), actual.getFilename());
verify(this.versionStrategy, times(1)).getResourceVersion(expected);
assertThat(actual, instanceOf(ResolvedResource.class));
assertEquals("\"" + version + "\"", ((ResolvedResource)actual).getResponseHeaders().getETag());
assertThat(actual, instanceOf(HttpResource.class));
assertEquals("\"" + version + "\"", ((HttpResource)actual).getResponseHeaders().getETag());
}
@Test