-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Upgrade to Dropwizard 2.1.0 and JUnit 5
- Loading branch information
Olivier Chédru
committed
May 9, 2022
1 parent
cea0420
commit 8f78ece
Showing
4 changed files
with
73 additions
and
124 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
src/test/java/org/dhatim/dropwizard/jwt/cookie/authentication/TestApplication.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package org.dhatim.dropwizard.jwt.cookie.authentication; | ||
|
||
import com.codahale.metrics.health.HealthCheck; | ||
import io.dropwizard.Application; | ||
import io.dropwizard.Configuration; | ||
import io.dropwizard.jetty.HttpConnectorFactory; | ||
import io.dropwizard.logging.DefaultLoggingFactory; | ||
import io.dropwizard.server.SimpleServerFactory; | ||
import io.dropwizard.setup.Bootstrap; | ||
import io.dropwizard.setup.Environment; | ||
|
||
public class TestApplication extends Application<Configuration> { | ||
|
||
@Override | ||
public void initialize(Bootstrap<Configuration> bootstrap) { | ||
bootstrap.addBundle(JwtCookieAuthBundle.getDefault()); | ||
} | ||
|
||
@Override | ||
public void run(Configuration configuration, Environment environment) { | ||
((DefaultLoggingFactory)configuration.getLoggingFactory()).setLevel("DEBUG"); | ||
|
||
//choose a random port | ||
SimpleServerFactory serverConfig = new SimpleServerFactory(); | ||
configuration.setServerFactory(serverConfig); | ||
HttpConnectorFactory connectorConfig = (HttpConnectorFactory) serverConfig.getConnector(); | ||
connectorConfig.setPort(0); | ||
|
||
//Dummy health check to suppress the startup warning. | ||
environment.healthChecks().register("dummy", new HealthCheck() { | ||
@Override | ||
protected HealthCheck.Result check() { | ||
return HealthCheck.Result.healthy(); | ||
} | ||
}); | ||
|
||
environment.jersey().register(new TestResource()); | ||
System.out.println("*** started"); | ||
} | ||
|
||
} |
94 changes: 0 additions & 94 deletions
94
src/test/java/org/dhatim/dropwizard/jwt/cookie/authentication/TestApplicationRule.java
This file was deleted.
Oops, something went wrong.