Add junit test for retrieving a resource without file extension - Fixes gh-20302

This commit is contained in:
Mohammed Ammer
2020-02-24 19:36:39 +01:00
parent 740153b5aa
commit 8ce1b45519
2 changed files with 8 additions and 0 deletions

View File

@@ -175,6 +175,13 @@ public class ResourceControllerTests {
assertThat(resource).isEqualToIgnoringNewLines("foo: dev_bar/spam");
}
@Test
public void resourceWithoutFileExtension() throws Exception {
this.environmentRepository.setSearchLocations("classpath:/test");
String resource = this.controller.retrieve("foo", "bar", "dev", "foo", true);
assertThat(resource).isEqualToIgnoringNewLines("foo: dev_bar");
}
@Test
public void resourceWithSlash() throws Exception {
this.environmentRepository.setSearchLocations("classpath:/test");

View File

@@ -0,0 +1 @@
foo: dev_bar