Skip to content

Commit aa22101

Browse files
committed
ensure the resource is not null
1 parent b89a669 commit aa22101

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

opengrok-web/src/test/java/org/opengrok/web/DiffTest.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
*/
1919

2020
/*
21-
* Copyright (c) 2021, 2022, Oracle and/or its affiliates. All rights reserved.
21+
* Copyright (c) 2021, 2025, Oracle and/or its affiliates. All rights reserved.
2222
*/
2323
package org.opengrok.web;
2424

@@ -32,6 +32,8 @@
3232
import org.opengrok.indexer.util.TestRepository;
3333
import org.opengrok.indexer.web.QueryParameters;
3434

35+
import java.net.URL;
36+
3537
import static org.junit.jupiter.api.Assertions.assertAll;
3638
import static org.junit.jupiter.api.Assertions.assertEquals;
3739
import static org.junit.jupiter.api.Assertions.assertFalse;
@@ -50,7 +52,9 @@ class DiffTest {
5052
@BeforeAll
5153
static void setUp() throws Exception {
5254
repository = new TestRepository();
53-
repository.create(DiffTest.class.getResource("/repositories"));
55+
URL resource = DiffTest.class.getResource("/repositories");
56+
assertNotNull(resource);
57+
repository.create(resource);
5458

5559
env.setSourceRoot(repository.getSourceRoot());
5660
env.setDataRoot(repository.getDataRoot());

0 commit comments

Comments
 (0)