Skip to content

Commit 5958a2f

Browse files
committed
fix some suggester tests
by setting up the test class in the same way as e.g. SearchControllerTest
1 parent 6055433 commit 5958a2f

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

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

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,12 @@
2828
import jakarta.ws.rs.core.GenericType;
2929
import jakarta.ws.rs.core.Response;
3030
import org.apache.lucene.index.Term;
31+
import org.glassfish.jersey.servlet.ServletContainer;
32+
import org.glassfish.jersey.test.DeploymentContext;
33+
import org.glassfish.jersey.test.ServletDeploymentContext;
34+
import org.glassfish.jersey.test.grizzly.GrizzlyWebTestContainerFactory;
35+
import org.glassfish.jersey.test.spi.TestContainerException;
36+
import org.glassfish.jersey.test.spi.TestContainerFactory;
3137
import org.junit.jupiter.api.AfterAll;
3238
import org.junit.jupiter.api.BeforeAll;
3339
import org.junit.jupiter.api.BeforeEach;
@@ -93,8 +99,13 @@ private static class TermIncrementData {
9399
private static TestRepository repository;
94100

95101
@Override
96-
protected Application configure() {
97-
return new RestApp();
102+
protected DeploymentContext configureDeployment() {
103+
return ServletDeploymentContext.forServlet(new ServletContainer(new RestApp())).build();
104+
}
105+
106+
@Override
107+
protected TestContainerFactory getTestContainerFactory() throws TestContainerException {
108+
return new GrizzlyWebTestContainerFactory();
98109
}
99110

100111
@BeforeAll

0 commit comments

Comments
 (0)