@@ -45,7 +45,7 @@ public void setUp() throws Exception {
4545 when (configurationService .getProperty ("dspace.name" )).thenReturn ("dspacename" );
4646 when (configurationService .getProperty ("dspace.server.url" )).thenReturn (serverURL );
4747 when (configurationService .getProperty ("dspace.server.ssr.url" , serverURL )).thenReturn (serverSSRURL );
48- when (configurationService .getProperty ("dspace.version.prefix" , "DSpace" )).thenReturn ("DSpace" );
48+ when (configurationService .getProperty ("dspace.version.prefix" , "CLARIN- DSpace" )).thenReturn ("CLARIN- DSpace" );
4949
5050 }
5151
@@ -65,7 +65,7 @@ public void testCorrectPropertiesSetFromConfigurationService() throws Exception
6565 assertEquals ("dspaceurl" , rootRest .getDspaceUI ());
6666 assertEquals ("dspacename" , rootRest .getDspaceName ());
6767 assertEquals (serverURL , rootRest .getDspaceServer ());
68- assertEquals ("DSpace " + Util .getSourceVersion (), rootRest .getDspaceVersion ());
68+ assertEquals ("CLARIN- DSpace " + Util .getSourceVersion (), rootRest .getDspaceVersion ());
6969 }
7070
7171 @ Test
@@ -84,12 +84,23 @@ public void testCorrectInternalUrlSetFromConfigurationService() throws Exception
8484 assertEquals ("dspaceurl" , rootRest .getDspaceUI ());
8585 assertEquals ("dspacename" , rootRest .getDspaceName ());
8686 assertEquals (serverSSRURL , rootRest .getDspaceServer ());
87- assertEquals ("DSpace " + Util .getSourceVersion (), rootRest .getDspaceVersion ());
87+ assertEquals ("CLARIN- DSpace " + Util .getSourceVersion (), rootRest .getDspaceVersion ());
8888 }
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