diff --git a/app/build.gradle b/app/build.gradle index 10b16a9bd..54109d906 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -23,7 +23,7 @@ dependencies { implementation project(':etor') testImplementation testFixtures(project(':shared')) - implementation 'io.javalin:javalin:5.6.3' + implementation 'io.javalin:javalin:6.0.0' testImplementation 'org.apache.groovy:groovy:4.0.18' testImplementation 'org.spockframework:spock-core:2.3-groovy-4.0' diff --git a/app/src/main/java/gov/hhs/cdc/trustedintermediary/external/javalin/DomainsRegistration.java b/app/src/main/java/gov/hhs/cdc/trustedintermediary/external/javalin/DomainsRegistration.java index 838eef6c1..86fd91eb9 100644 --- a/app/src/main/java/gov/hhs/cdc/trustedintermediary/external/javalin/DomainsRegistration.java +++ b/app/src/main/java/gov/hhs/cdc/trustedintermediary/external/javalin/DomainsRegistration.java @@ -15,6 +15,7 @@ import io.javalin.http.Context; import io.javalin.http.Handler; import io.javalin.http.HandlerType; +import io.javalin.router.Endpoint; import java.lang.reflect.Constructor; import java.lang.reflect.InvocationTargetException; import java.util.HashSet; @@ -70,10 +71,13 @@ static void registerDomainsHandlers(Javalin app, Set domains) { registrationMap -> registrationMap.forEach( (endpoint, handler) -> { - app.addHandler( - HandlerType.valueOf(endpoint.verb()), - endpoint.path(), - createHandler(handler, endpoint.isProtected())); + app.addEndpoint( + new Endpoint( + HandlerType.valueOf(endpoint.verb()), + endpoint.path(), + createHandler( + handler, + endpoint.isProtected()))); LOGGER.logInfo( "verb: " + endpoint.verb() diff --git a/app/src/test/groovy/gov/hhs/cdc/trustedintermediary/external/javalin/DomainsRegistrationTest.groovy b/app/src/test/groovy/gov/hhs/cdc/trustedintermediary/external/javalin/DomainsRegistrationTest.groovy index 6007203a5..bf2d74d62 100644 --- a/app/src/test/groovy/gov/hhs/cdc/trustedintermediary/external/javalin/DomainsRegistrationTest.groovy +++ b/app/src/test/groovy/gov/hhs/cdc/trustedintermediary/external/javalin/DomainsRegistrationTest.groovy @@ -16,6 +16,7 @@ import io.javalin.Javalin import io.javalin.http.Context import io.javalin.http.Handler import io.javalin.http.HandlerType +import io.javalin.router.Endpoint import spock.lang.Specification import java.util.function.Function @@ -291,7 +292,7 @@ class DomainsRegistrationTest extends Specification { DomainsRegistration.registerDomains(javalinApp, domains as Set>) then: - expectedNumberOfAddHandlerCalls * javalinApp.addHandler(_ as HandlerType, _ as String, _ as Handler) + expectedNumberOfAddHandlerCalls * javalinApp.addEndpoint(_ as Endpoint) } def "an OpenAPI endpoint is registered and it sets it content-type as YAML"() {