|
18 | 18 | */
|
19 | 19 |
|
20 | 20 | /*
|
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. |
22 | 22 | * Portions Copyright (c) 2020, Chris Fraire <[email protected]>.
|
23 | 23 | */
|
24 | 24 | package org.opengrok.web.api.v1.controller;
|
25 | 25 |
|
26 | 26 | import jakarta.ws.rs.client.Entity;
|
27 | 27 | import jakarta.ws.rs.core.Application;
|
28 | 28 | 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; |
29 | 35 | import org.junit.jupiter.api.Test;
|
30 | 36 | import org.opengrok.indexer.configuration.Configuration;
|
31 | 37 | import org.opengrok.indexer.configuration.RuntimeEnvironment;
|
|
49 | 55 | import static org.junit.jupiter.api.Assertions.assertNotEquals;
|
50 | 56 | import static org.junit.jupiter.api.Assertions.assertTrue;
|
51 | 57 |
|
52 |
| -public class SystemControllerTest extends OGKJerseyTest { |
| 58 | +class SystemControllerTest extends OGKJerseyTest { |
53 | 59 |
|
54 | 60 | private final RuntimeEnvironment env = RuntimeEnvironment.getInstance();
|
55 | 61 |
|
56 | 62 | @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(); |
59 | 70 | }
|
60 | 71 |
|
61 | 72 | /**
|
|
0 commit comments