@@ -91,7 +91,7 @@ public static void setUpClass() throws Exception {
91
91
}
92
92
93
93
@ AfterAll
94
- public static void tearDownClass () throws Exception {
94
+ public static void tearDownClass () {
95
95
repository .destroy ();
96
96
repository = null ;
97
97
}
@@ -242,9 +242,6 @@ public boolean isAllowed(HttpServletRequest request, Project project) {
242
242
void testGetSortedFilesDirsFirst () throws IOException {
243
243
RuntimeEnvironment env = RuntimeEnvironment .getInstance ();
244
244
env .setListDirsFirst (true );
245
- // Cannot spy/mock final class.
246
- HttpServletRequest req = createRequest ("/source" , "/xref" , "" );
247
- PageConfig pageConfig = PageConfig .get (req );
248
245
249
246
// Make sure the source root has just directories.
250
247
File sourceRootFile = new File (repository .getSourceRoot ());
@@ -352,15 +349,6 @@ void testGetLatestRevisionViaIndex() throws Exception {
352
349
indexer .doIndexerExecution (null , null );
353
350
354
351
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 );
364
352
String rev = LatestRevisionUtil .getLastRevFromIndex (new File (repository .getSourceRoot (), filePath ));
365
353
assertNotNull (rev );
366
354
assertEquals (HASH_AA35C258 , rev );
@@ -568,7 +556,7 @@ void testCheckSourceRootExistence3() throws IOException {
568
556
File temp = File .createTempFile ("opengrok" , "-test-file.tmp" );
569
557
Files .delete (temp .toPath ());
570
558
RuntimeEnvironment .getInstance ().setSourceRoot (temp .getAbsolutePath ());
571
- assertThrows (IOException .class , () -> cfg . checkSourceRootExistence () ,
559
+ assertThrows (IOException .class , cfg :: checkSourceRootExistence ,
572
560
"This should throw an exception when the file does not exist" );
573
561
RuntimeEnvironment .getInstance ().setSourceRoot (path );
574
562
PageConfig .cleanup (req );
@@ -590,7 +578,7 @@ void testCheckSourceRootExistence4() throws IOException {
590
578
// skip the test if the implementation does not permit setting permissions
591
579
assumeTrue (temp .setReadable (false ));
592
580
RuntimeEnvironment .getInstance ().setSourceRoot (temp .getAbsolutePath ());
593
- assertThrows (IOException .class , () -> cfg . checkSourceRootExistence () ,
581
+ assertThrows (IOException .class , cfg :: checkSourceRootExistence ,
594
582
"This should throw an exception when the file is not readable" );
595
583
RuntimeEnvironment .getInstance ().setSourceRoot (path );
596
584
0 commit comments