Polish WebJarsResourceResolver
Follow up to accb8519fd - same fix when resolving missing resources or
resolving a public URL for these resources.
This commit is contained in:
@@ -99,7 +99,7 @@ public class WebJarsResourceResolverTests {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void resolverUrlWebJarResourceNotFound() {
|
||||
public void resolveUrlWebJarResourceNotFound() {
|
||||
String file = "/something/something.js";
|
||||
given(this.chain.resolveUrlPath(file, this.locations)).willReturn(null);
|
||||
|
||||
@@ -123,6 +123,18 @@ public class WebJarsResourceResolverTests {
|
||||
verify(this.chain, times(1)).resolveResource(this.request, file, this.locations);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void resolveResourceNotFound() {
|
||||
String file = "/something/something.js";
|
||||
given(this.chain.resolveUrlPath(file, this.locations)).willReturn(null);
|
||||
|
||||
Resource actual = this.resolver.resolveResource(this.request, file, this.locations, this.chain);
|
||||
|
||||
assertNull(actual);
|
||||
verify(this.chain, times(1)).resolveResource(this.request, file, this.locations);
|
||||
verify(this.chain, never()).resolveResource(this.request, null, this.locations);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void resolveResourceWebJar() {
|
||||
Resource expected = mock(Resource.class);
|
||||
|
||||
Reference in New Issue
Block a user