Issue #4173 - Adding more testcases for raw root-ish Resources

Signed-off-by: Joakim Erdfelt <joakim.erdfelt@gmail.com>
This commit is contained in:
Joakim Erdfelt 2019-11-04 16:01:43 -06:00
parent f4298c12c4
commit 6ac925631c
No known key found for this signature in database
GPG Key ID: 2D0E1FB8FE4B68B4
1 changed files with 16 additions and 0 deletions

View File

@ -142,6 +142,22 @@ public class WebInfConfigurationTest
assertThat(containerResources.get(0).toString(), containsString("jetty-util"));
}
public static Stream<Arguments> rawResourceNames()
{
return Stream.of(
Arguments.of("/", ""),
Arguments.of("/a", "a")
);
}
@ParameterizedTest
@MethodSource("rawResourceNames")
public void testTinyGetResourceBaseName(String rawPath, String expectedName) throws IOException
{
Resource resource = Resource.newResource(rawPath);
assertThat(WebInfConfiguration.getResourceBaseName(resource), is(expectedName));
}
public static Stream<Arguments> baseResourceNames()
{
return Stream.of(