@@ -91,7 +91,7 @@ public static void setUpClass() throws Exception {
9191 }
9292
9393 @ AfterAll
94- public static void tearDownClass () throws Exception {
94+ public static void tearDownClass () {
9595 repository .destroy ();
9696 repository = null ;
9797 }
@@ -242,9 +242,6 @@ public boolean isAllowed(HttpServletRequest request, Project project) {
242242 void testGetSortedFilesDirsFirst () throws IOException {
243243 RuntimeEnvironment env = RuntimeEnvironment .getInstance ();
244244 env .setListDirsFirst (true );
245- // Cannot spy/mock final class.
246- HttpServletRequest req = createRequest ("/source" , "/xref" , "" );
247- PageConfig pageConfig = PageConfig .get (req );
248245
249246 // Make sure the source root has just directories.
250247 File sourceRootFile = new File (repository .getSourceRoot ());
@@ -352,15 +349,6 @@ void testGetLatestRevisionViaIndex() throws Exception {
352349 indexer .doIndexerExecution (null , null );
353350
354351 final String filePath = "/git/main.c" ;
355-
356- DummyHttpServletRequest req1 = new DummyHttpServletRequest () {
357- @ Override
358- public String getPathInfo () {
359- return filePath ;
360- }
361- };
362-
363- PageConfig cfg = PageConfig .get (req1 );
364352 String rev = LatestRevisionUtil .getLastRevFromIndex (new File (repository .getSourceRoot (), filePath ));
365353 assertNotNull (rev );
366354 assertEquals (HASH_AA35C258 , rev );
@@ -568,7 +556,7 @@ void testCheckSourceRootExistence3() throws IOException {
568556 File temp = File .createTempFile ("opengrok" , "-test-file.tmp" );
569557 Files .delete (temp .toPath ());
570558 RuntimeEnvironment .getInstance ().setSourceRoot (temp .getAbsolutePath ());
571- assertThrows (IOException .class , () -> cfg . checkSourceRootExistence () ,
559+ assertThrows (IOException .class , cfg :: checkSourceRootExistence ,
572560 "This should throw an exception when the file does not exist" );
573561 RuntimeEnvironment .getInstance ().setSourceRoot (path );
574562 PageConfig .cleanup (req );
@@ -590,7 +578,7 @@ void testCheckSourceRootExistence4() throws IOException {
590578 // skip the test if the implementation does not permit setting permissions
591579 assumeTrue (temp .setReadable (false ));
592580 RuntimeEnvironment .getInstance ().setSourceRoot (temp .getAbsolutePath ());
593- assertThrows (IOException .class , () -> cfg . checkSourceRootExistence () ,
581+ assertThrows (IOException .class , cfg :: checkSourceRootExistence ,
594582 "This should throw an exception when the file is not readable" );
595583 RuntimeEnvironment .getInstance ().setSourceRoot (path );
596584
0 commit comments