Skip to content

Commit

Permalink
fix broken test compile
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewazores committed Nov 7, 2022
1 parent 81c059f commit f6ffaed
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@
*/
package io.cryostat.net.web.http.generic;

import io.cryostat.core.log.Logger;
import io.cryostat.core.sys.Environment;
import io.cryostat.net.NetworkConfiguration;
import io.cryostat.net.SslConfiguration;
import io.cryostat.net.web.WebServer;
import io.cryostat.net.web.http.AbstractAuthenticatedRequestHandler;
import io.cryostat.net.web.http.RequestHandler;
Expand Down Expand Up @@ -67,12 +70,15 @@ class CorsEnablingHandlerTest {
final String CUSTOM_ORIGIN = "http://localhost:9001";
CorsEnablingHandler handler;
@Mock Environment env;
@Mock NetworkConfiguration netConf;
@Mock SslConfiguration sslConf;
@Mock Logger logger;

@BeforeEach
void setup() {
Mockito.when(env.getEnv("CRYOSTAT_CORS_ORIGIN", CorsEnablingHandler.DEV_ORIGIN))
.thenReturn(CUSTOM_ORIGIN);
this.handler = new CorsEnablingHandler(env);
this.handler = new CorsEnablingHandler(env, netConf, sslConf, logger);
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@
*/
package io.cryostat.net.web.http.generic;

import io.cryostat.core.log.Logger;
import io.cryostat.core.sys.Environment;
import io.cryostat.net.NetworkConfiguration;
import io.cryostat.net.SslConfiguration;
import io.cryostat.net.web.http.RequestHandler;

import io.vertx.core.http.HttpMethod;
Expand All @@ -55,12 +58,15 @@ class CorsOptionsHandlerTest {

CorsOptionsHandler handler;
@Mock Environment env;
@Mock NetworkConfiguration netConf;
@Mock SslConfiguration sslConf;
@Mock Logger logger;

@BeforeEach
void setup() {
Mockito.when(env.getEnv("CRYOSTAT_CORS_ORIGIN", CorsEnablingHandler.DEV_ORIGIN))
.thenReturn("http://localhost:9000");
this.handler = new CorsOptionsHandler(env);
this.handler = new CorsOptionsHandler(env, netConf, sslConf, logger);
}

@Test
Expand Down

0 comments on commit f6ffaed

Please sign in to comment.