Skip to content

Commit 7c1e56c

Browse files
committed
fix(tests): correct stale RootConverter version-prefix stub
1 parent b6bc9f8 commit 7c1e56c

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

dspace-server-webapp/src/test/java/org/dspace/app/rest/converter/RootConverterTest.java

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,18 @@ public void testCorrectInternalUrlSetFromConfigurationService() throws Exception
8989

9090
@Test
9191
public void testConfigurableVersionPrefix() throws Exception {
92-
when(configurationService.getProperty("dspace.version.prefix", "DSpace")).thenReturn("CLARIN-DSpace");
92+
when(configurationService.getProperty("dspace.version.prefix", "CLARIN-DSpace")).thenReturn("CustomPrefix");
93+
request.setScheme("https");
94+
request.setServerName("dspace-rest");
95+
request.setServerPort(443);
96+
request.setRequestURI("/server/api");
97+
RootRest rootRest = rootConverter.convert(request);
98+
assertEquals("CustomPrefix " + Util.getSourceVersion(), rootRest.getDspaceVersion());
99+
}
100+
101+
@Test
102+
public void testBlankVersionPrefixFallsBackToDefault() throws Exception {
103+
when(configurationService.getProperty("dspace.version.prefix", "CLARIN-DSpace")).thenReturn("");
93104
request.setScheme("https");
94105
request.setServerName("dspace-rest");
95106
request.setServerPort(443);

0 commit comments

Comments
 (0)