Skip to content

Commit 9b16935

Browse files
committed
fix the tests
1 parent f2d2f80 commit 9b16935

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

opengrok-web/src/test/java/org/opengrok/web/api/v1/controller/SystemControllerTest.java

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,20 @@
1818
*/
1919

2020
/*
21-
* Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved.
21+
* Copyright (c) 2021, 2022, Oracle and/or its affiliates. All rights reserved.
2222
* Portions Copyright (c) 2020, Chris Fraire <[email protected]>.
2323
*/
2424
package org.opengrok.web.api.v1.controller;
2525

2626
import jakarta.ws.rs.client.Entity;
2727
import jakarta.ws.rs.core.Application;
2828
import jakarta.ws.rs.core.Response;
29+
import org.glassfish.jersey.servlet.ServletContainer;
30+
import org.glassfish.jersey.test.DeploymentContext;
31+
import org.glassfish.jersey.test.ServletDeploymentContext;
32+
import org.glassfish.jersey.test.grizzly.GrizzlyWebTestContainerFactory;
33+
import org.glassfish.jersey.test.spi.TestContainerException;
34+
import org.glassfish.jersey.test.spi.TestContainerFactory;
2935
import org.junit.jupiter.api.Test;
3036
import org.opengrok.indexer.configuration.Configuration;
3137
import org.opengrok.indexer.configuration.RuntimeEnvironment;
@@ -49,13 +55,18 @@
4955
import static org.junit.jupiter.api.Assertions.assertNotEquals;
5056
import static org.junit.jupiter.api.Assertions.assertTrue;
5157

52-
public class SystemControllerTest extends OGKJerseyTest {
58+
class SystemControllerTest extends OGKJerseyTest {
5359

5460
private final RuntimeEnvironment env = RuntimeEnvironment.getInstance();
5561

5662
@Override
57-
protected Application configure() {
58-
return new RestApp();
63+
protected DeploymentContext configureDeployment() {
64+
return ServletDeploymentContext.forServlet(new ServletContainer(new RestApp())).build();
65+
}
66+
67+
@Override
68+
protected TestContainerFactory getTestContainerFactory() throws TestContainerException {
69+
return new GrizzlyWebTestContainerFactory();
5970
}
6071

6172
/**

0 commit comments

Comments
 (0)