Skip to content

Commit

Permalink
Address the comments
Browse files Browse the repository at this point in the history
  • Loading branch information
jerryshao committed Oct 12, 2023
1 parent f17ab04 commit 97d5131
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
import static org.mockito.Mockito.mock;

import com.datastrato.graviton.Config;
import com.datastrato.graviton.rest.RESTUtils;
import java.io.IOException;
import javax.servlet.Filter;
import javax.servlet.Servlet;
import org.junit.jupiter.api.AfterEach;
Expand All @@ -32,17 +34,19 @@ public void tearDown() {
}

@Test
public void testInitialize() {
public void testInitialize() throws IOException {
Config config = new Config(false) {};
config.set(JettyServerConfig.WEBSERVER_HTTP_PORT, RESTUtils.findAvailablePort(5000, 6000));
JettyServerConfig serverConfig = JettyServerConfig.fromConfig(config);
jettyServer.initialize(serverConfig, "test");

// TODO might be nice to have an isInitalised method or similar?
}

@Test
public void testStartAndStop() throws RuntimeException {
public void testStartAndStop() throws RuntimeException, IOException {
Config config = new Config(false) {};
config.set(JettyServerConfig.WEBSERVER_HTTP_PORT, RESTUtils.findAvailablePort(5000, 6000));
JettyServerConfig serverConfig = JettyServerConfig.fromConfig(config);
jettyServer.initialize(serverConfig, "test");
jettyServer.start();
Expand All @@ -51,8 +55,9 @@ public void testStartAndStop() throws RuntimeException {
}

@Test
public void testAddServletAndFilter() throws RuntimeException {
public void testAddServletAndFilter() throws RuntimeException, IOException {
Config config = new Config(false) {};
config.set(JettyServerConfig.WEBSERVER_HTTP_PORT, RESTUtils.findAvailablePort(5000, 6000));
JettyServerConfig serverConfig = JettyServerConfig.fromConfig(config);
jettyServer.initialize(serverConfig, "test");
jettyServer.start();
Expand Down

0 comments on commit 97d5131

Please sign in to comment.