Use Ratpack core API for test server. (#3215)
* Use Ratpack core API for test server. * Fix async path param test * Spotless
This commit is contained in:
parent
1b63e3265f
commit
d94a92c4ab
|
@ -13,7 +13,7 @@ dependencies {
|
||||||
|
|
||||||
implementation project(':instrumentation:netty:netty-4.1:javaagent')
|
implementation project(':instrumentation:netty:netty-4.1:javaagent')
|
||||||
|
|
||||||
testLibrary "io.ratpack:ratpack-groovy-test:1.4.0"
|
testLibrary "io.ratpack:ratpack-test:1.4.0"
|
||||||
|
|
||||||
if (JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_11)) {
|
if (JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_11)) {
|
||||||
testImplementation "com.sun.activation:jakarta.activation:1.2.2"
|
testImplementation "com.sun.activation:jakarta.activation:1.2.2"
|
||||||
|
|
|
@ -12,8 +12,8 @@ import io.opentelemetry.semconv.trace.attributes.SemanticAttributes
|
||||||
import okhttp3.HttpUrl
|
import okhttp3.HttpUrl
|
||||||
import okhttp3.OkHttpClient
|
import okhttp3.OkHttpClient
|
||||||
import okhttp3.Request
|
import okhttp3.Request
|
||||||
import ratpack.groovy.test.embed.GroovyEmbeddedApp
|
|
||||||
import ratpack.path.PathBinding
|
import ratpack.path.PathBinding
|
||||||
|
import ratpack.server.RatpackServer
|
||||||
|
|
||||||
class RatpackOtherTest extends AgentInstrumentationSpecification {
|
class RatpackOtherTest extends AgentInstrumentationSpecification {
|
||||||
|
|
||||||
|
@ -21,42 +21,43 @@ class RatpackOtherTest extends AgentInstrumentationSpecification {
|
||||||
|
|
||||||
def "test bindings for #path"() {
|
def "test bindings for #path"() {
|
||||||
setup:
|
setup:
|
||||||
def app = GroovyEmbeddedApp.ratpack {
|
def app = RatpackServer.start {
|
||||||
handlers {
|
it.handlers {
|
||||||
prefix("a") {
|
it.prefix("a") {
|
||||||
all {
|
it.all {context ->
|
||||||
context.render(context.get(PathBinding).description)
|
context.render(context.get(PathBinding).description)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
prefix("b/::\\d+") {
|
it.prefix("b/::\\d+") {
|
||||||
all {
|
it.all {context ->
|
||||||
context.render(context.get(PathBinding).description)
|
context.render(context.get(PathBinding).description)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
prefix("c/:val?") {
|
it.prefix("c/:val?") {
|
||||||
all {
|
it.all {context ->
|
||||||
context.render(context.get(PathBinding).description)
|
context.render(context.get(PathBinding).description)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
prefix("d/:val") {
|
it.prefix("d/:val") {
|
||||||
all {
|
it.all {context ->
|
||||||
context.render(context.get(PathBinding).description)
|
context.render(context.get(PathBinding).description)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
prefix("e/:val?:\\d+") {
|
it.prefix("e/:val?:\\d+") {
|
||||||
all {
|
it.all {context ->
|
||||||
context.render(context.get(PathBinding).description)
|
context.render(context.get(PathBinding).description)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
prefix("f/:val:\\d+") {
|
it.prefix("f/:val:\\d+") {
|
||||||
all {
|
it.all {context ->
|
||||||
context.render(context.get(PathBinding).description)
|
context.render(context.get(PathBinding).description)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
def address = "${app.scheme}://${app.bindHost}:${app.bindPort}"
|
||||||
def request = new Request.Builder()
|
def request = new Request.Builder()
|
||||||
.url(HttpUrl.get(app.address).newBuilder().addPathSegments(path).build())
|
.url(HttpUrl.get(address).newBuilder().addPathSegments(path).build())
|
||||||
.get()
|
.get()
|
||||||
.build()
|
.build()
|
||||||
|
|
||||||
|
@ -76,7 +77,7 @@ class RatpackOtherTest extends AgentInstrumentationSpecification {
|
||||||
attributes {
|
attributes {
|
||||||
"${SemanticAttributes.NET_PEER_IP.key}" "127.0.0.1"
|
"${SemanticAttributes.NET_PEER_IP.key}" "127.0.0.1"
|
||||||
"${SemanticAttributes.NET_PEER_PORT.key}" Long
|
"${SemanticAttributes.NET_PEER_PORT.key}" Long
|
||||||
"${SemanticAttributes.HTTP_URL.key}" "${app.address.resolve(path)}"
|
"${SemanticAttributes.HTTP_URL.key}" "${address}/${path}"
|
||||||
"${SemanticAttributes.HTTP_METHOD.key}" "GET"
|
"${SemanticAttributes.HTTP_METHOD.key}" "GET"
|
||||||
"${SemanticAttributes.HTTP_STATUS_CODE.key}" 200
|
"${SemanticAttributes.HTTP_STATUS_CODE.key}" 200
|
||||||
"${SemanticAttributes.HTTP_FLAVOR.key}" "1.1"
|
"${SemanticAttributes.HTTP_FLAVOR.key}" "1.1"
|
||||||
|
@ -94,6 +95,9 @@ class RatpackOtherTest extends AgentInstrumentationSpecification {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
cleanup:
|
||||||
|
app.stop()
|
||||||
|
|
||||||
where:
|
where:
|
||||||
path | route
|
path | route
|
||||||
"a" | "a"
|
"a" | "a"
|
||||||
|
|
|
@ -13,25 +13,25 @@ import static io.opentelemetry.instrumentation.test.base.HttpServerTest.ServerEn
|
||||||
import static io.opentelemetry.instrumentation.test.base.HttpServerTest.ServerEndpoint.REDIRECT
|
import static io.opentelemetry.instrumentation.test.base.HttpServerTest.ServerEndpoint.REDIRECT
|
||||||
import static io.opentelemetry.instrumentation.test.base.HttpServerTest.ServerEndpoint.SUCCESS
|
import static io.opentelemetry.instrumentation.test.base.HttpServerTest.ServerEndpoint.SUCCESS
|
||||||
|
|
||||||
|
import ratpack.error.ServerErrorHandler
|
||||||
import ratpack.exec.Promise
|
import ratpack.exec.Promise
|
||||||
import ratpack.groovy.test.embed.GroovyEmbeddedApp
|
import ratpack.server.RatpackServer
|
||||||
import ratpack.test.embed.EmbeddedApp
|
|
||||||
|
|
||||||
class RatpackAsyncHttpServerTest extends RatpackHttpServerTest {
|
class RatpackAsyncHttpServerTest extends RatpackHttpServerTest {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
EmbeddedApp startServer(int bindPort) {
|
RatpackServer startServer(int bindPort) {
|
||||||
def ratpack = GroovyEmbeddedApp.ratpack {
|
def ratpack = RatpackServer.start {
|
||||||
serverConfig {
|
it.serverConfig {
|
||||||
port bindPort
|
it.port(bindPort)
|
||||||
address InetAddress.getByName('localhost')
|
it.address(InetAddress.getByName("localhost"))
|
||||||
}
|
}
|
||||||
bindings {
|
it.handlers {
|
||||||
bind TestErrorHandler
|
it.register {
|
||||||
}
|
it.add(ServerErrorHandler, new TestErrorHandler())
|
||||||
handlers {
|
}
|
||||||
prefix(SUCCESS.rawPath()) {
|
it.prefix(SUCCESS.rawPath()) {
|
||||||
all {
|
it.all {context ->
|
||||||
Promise.sync {
|
Promise.sync {
|
||||||
SUCCESS
|
SUCCESS
|
||||||
} then { endpoint ->
|
} then { endpoint ->
|
||||||
|
@ -41,31 +41,31 @@ class RatpackAsyncHttpServerTest extends RatpackHttpServerTest {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
prefix(INDEXED_CHILD.rawPath()) {
|
it.prefix(INDEXED_CHILD.rawPath()) {
|
||||||
all {
|
it.all {context ->
|
||||||
Promise.sync {
|
Promise.sync {
|
||||||
INDEXED_CHILD
|
INDEXED_CHILD
|
||||||
} then {
|
} then {
|
||||||
controller(INDEXED_CHILD) {
|
controller(INDEXED_CHILD) {
|
||||||
INDEXED_CHILD.collectSpanAttributes { request.queryParams.get(it) }
|
INDEXED_CHILD.collectSpanAttributes { context.request.queryParams.get(it) }
|
||||||
context.response.status(INDEXED_CHILD.status).send()
|
context.response.status(INDEXED_CHILD.status).send()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
prefix(QUERY_PARAM.rawPath()) {
|
it.prefix(QUERY_PARAM.rawPath()) {
|
||||||
all {
|
it.all { context ->
|
||||||
Promise.sync {
|
Promise.sync {
|
||||||
QUERY_PARAM
|
QUERY_PARAM
|
||||||
} then { endpoint ->
|
} then { endpoint ->
|
||||||
controller(endpoint) {
|
controller(endpoint) {
|
||||||
context.response.status(endpoint.status).send(request.query)
|
context.response.status(endpoint.status).send(context.request.query)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
prefix(REDIRECT.rawPath()) {
|
it.prefix(REDIRECT.rawPath()) {
|
||||||
all {
|
it.all {context ->
|
||||||
Promise.sync {
|
Promise.sync {
|
||||||
REDIRECT
|
REDIRECT
|
||||||
} then { endpoint ->
|
} then { endpoint ->
|
||||||
|
@ -75,8 +75,8 @@ class RatpackAsyncHttpServerTest extends RatpackHttpServerTest {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
prefix(ERROR.rawPath()) {
|
it.prefix(ERROR.rawPath()) {
|
||||||
all {
|
it.all {context ->
|
||||||
Promise.sync {
|
Promise.sync {
|
||||||
ERROR
|
ERROR
|
||||||
} then { endpoint ->
|
} then { endpoint ->
|
||||||
|
@ -86,8 +86,8 @@ class RatpackAsyncHttpServerTest extends RatpackHttpServerTest {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
prefix(EXCEPTION.rawPath()) {
|
it.prefix(EXCEPTION.rawPath()) {
|
||||||
all {
|
it.all {
|
||||||
Promise.sync {
|
Promise.sync {
|
||||||
EXCEPTION
|
EXCEPTION
|
||||||
} then { endpoint ->
|
} then { endpoint ->
|
||||||
|
@ -97,23 +97,22 @@ class RatpackAsyncHttpServerTest extends RatpackHttpServerTest {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
prefix("path/:id/param") {
|
it.prefix("path/:id/param") {
|
||||||
all {
|
it.all {context ->
|
||||||
Promise.sync {
|
Promise.sync {
|
||||||
PATH_PARAM
|
PATH_PARAM
|
||||||
}.fork().then { endpoint ->
|
} then { endpoint ->
|
||||||
controller(endpoint) {
|
controller(endpoint) {
|
||||||
context.response.status(endpoint.status).send(pathTokens.id)
|
context.response.status(endpoint.status).send(context.pathTokens.id)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ratpack.server.start()
|
|
||||||
|
|
||||||
assert ratpack.address.port == bindPort
|
assert ratpack.bindPort == bindPort
|
||||||
assert ratpack.server.bindHost == 'localhost'
|
assert ratpack.bindHost == 'localhost'
|
||||||
return ratpack
|
return ratpack
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,25 +13,26 @@ import static io.opentelemetry.instrumentation.test.base.HttpServerTest.ServerEn
|
||||||
import static io.opentelemetry.instrumentation.test.base.HttpServerTest.ServerEndpoint.REDIRECT
|
import static io.opentelemetry.instrumentation.test.base.HttpServerTest.ServerEndpoint.REDIRECT
|
||||||
import static io.opentelemetry.instrumentation.test.base.HttpServerTest.ServerEndpoint.SUCCESS
|
import static io.opentelemetry.instrumentation.test.base.HttpServerTest.ServerEndpoint.SUCCESS
|
||||||
|
|
||||||
|
import ratpack.error.ServerErrorHandler
|
||||||
import ratpack.exec.Promise
|
import ratpack.exec.Promise
|
||||||
import ratpack.groovy.test.embed.GroovyEmbeddedApp
|
import ratpack.server.RatpackServer
|
||||||
import ratpack.test.embed.EmbeddedApp
|
|
||||||
|
|
||||||
class RatpackForkedHttpServerTest extends RatpackHttpServerTest {
|
class RatpackForkedHttpServerTest extends RatpackHttpServerTest {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
EmbeddedApp startServer(int bindPort) {
|
RatpackServer startServer(int bindPort) {
|
||||||
def ratpack = GroovyEmbeddedApp.ratpack {
|
|
||||||
serverConfig {
|
def ratpack = RatpackServer.start {
|
||||||
port bindPort
|
it.serverConfig {
|
||||||
address InetAddress.getByName('localhost')
|
it.port(bindPort)
|
||||||
|
it.address(InetAddress.getByName("localhost"))
|
||||||
}
|
}
|
||||||
bindings {
|
it.handlers {
|
||||||
bind TestErrorHandler
|
it.register {
|
||||||
}
|
it.add(ServerErrorHandler, new TestErrorHandler())
|
||||||
handlers {
|
}
|
||||||
prefix(SUCCESS.rawPath()) {
|
it.prefix(SUCCESS.rawPath()) {
|
||||||
all {
|
it.all {context ->
|
||||||
Promise.sync {
|
Promise.sync {
|
||||||
SUCCESS
|
SUCCESS
|
||||||
}.fork().then { endpoint ->
|
}.fork().then { endpoint ->
|
||||||
|
@ -41,31 +42,31 @@ class RatpackForkedHttpServerTest extends RatpackHttpServerTest {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
prefix(INDEXED_CHILD.rawPath()) {
|
it.prefix(INDEXED_CHILD.rawPath()) {
|
||||||
all {
|
it.all {context ->
|
||||||
Promise.sync {
|
Promise.sync {
|
||||||
INDEXED_CHILD
|
INDEXED_CHILD
|
||||||
}.fork().then {
|
}.fork().then {
|
||||||
controller(INDEXED_CHILD) {
|
controller(INDEXED_CHILD) {
|
||||||
INDEXED_CHILD.collectSpanAttributes { request.queryParams.get(it) }
|
INDEXED_CHILD.collectSpanAttributes { context.request.queryParams.get(it) }
|
||||||
context.response.status(INDEXED_CHILD.status).send()
|
context.response.status(INDEXED_CHILD.status).send()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
prefix(QUERY_PARAM.rawPath()) {
|
it.prefix(QUERY_PARAM.rawPath()) {
|
||||||
all {
|
it.all { context ->
|
||||||
Promise.sync {
|
Promise.sync {
|
||||||
QUERY_PARAM
|
QUERY_PARAM
|
||||||
}.fork().then { endpoint ->
|
}.fork().then { endpoint ->
|
||||||
controller(endpoint) {
|
controller(endpoint) {
|
||||||
context.response.status(endpoint.status).send(request.query)
|
context.response.status(endpoint.status).send(context.request.query)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
prefix(REDIRECT.rawPath()) {
|
it.prefix(REDIRECT.rawPath()) {
|
||||||
all {
|
it.all {context ->
|
||||||
Promise.sync {
|
Promise.sync {
|
||||||
REDIRECT
|
REDIRECT
|
||||||
}.fork().then { endpoint ->
|
}.fork().then { endpoint ->
|
||||||
|
@ -75,8 +76,8 @@ class RatpackForkedHttpServerTest extends RatpackHttpServerTest {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
prefix(ERROR.rawPath()) {
|
it.prefix(ERROR.rawPath()) {
|
||||||
all {
|
it.all {context ->
|
||||||
Promise.sync {
|
Promise.sync {
|
||||||
ERROR
|
ERROR
|
||||||
}.fork().then { endpoint ->
|
}.fork().then { endpoint ->
|
||||||
|
@ -86,8 +87,8 @@ class RatpackForkedHttpServerTest extends RatpackHttpServerTest {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
prefix(EXCEPTION.rawPath()) {
|
it.prefix(EXCEPTION.rawPath()) {
|
||||||
all {
|
it.all {
|
||||||
Promise.sync {
|
Promise.sync {
|
||||||
EXCEPTION
|
EXCEPTION
|
||||||
}.fork().then { endpoint ->
|
}.fork().then { endpoint ->
|
||||||
|
@ -97,22 +98,22 @@ class RatpackForkedHttpServerTest extends RatpackHttpServerTest {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
prefix("path/:id/param") {
|
it.prefix("path/:id/param") {
|
||||||
all {
|
it.all {context ->
|
||||||
Promise.sync {
|
Promise.sync {
|
||||||
PATH_PARAM
|
PATH_PARAM
|
||||||
}.fork().then { endpoint ->
|
}.fork().then { endpoint ->
|
||||||
controller(endpoint) {
|
controller(endpoint) {
|
||||||
context.response.status(endpoint.status).send(pathTokens.id)
|
context.response.status(endpoint.status).send(context.pathTokens.id)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ratpack.server.start()
|
|
||||||
|
|
||||||
assert ratpack.address.port == bindPort
|
assert ratpack.bindPort == bindPort
|
||||||
|
assert ratpack.bindHost == 'localhost'
|
||||||
return ratpack
|
return ratpack
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,78 +20,76 @@ import io.opentelemetry.instrumentation.test.asserts.TraceAssert
|
||||||
import io.opentelemetry.instrumentation.test.base.HttpServerTest
|
import io.opentelemetry.instrumentation.test.base.HttpServerTest
|
||||||
import io.opentelemetry.sdk.trace.data.SpanData
|
import io.opentelemetry.sdk.trace.data.SpanData
|
||||||
import ratpack.error.ServerErrorHandler
|
import ratpack.error.ServerErrorHandler
|
||||||
import ratpack.groovy.test.embed.GroovyEmbeddedApp
|
|
||||||
import ratpack.handling.Context
|
import ratpack.handling.Context
|
||||||
import ratpack.test.embed.EmbeddedApp
|
import ratpack.server.RatpackServer
|
||||||
|
|
||||||
class RatpackHttpServerTest extends HttpServerTest<EmbeddedApp> implements AgentTestTrait {
|
class RatpackHttpServerTest extends HttpServerTest<RatpackServer> implements AgentTestTrait {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
EmbeddedApp startServer(int bindPort) {
|
RatpackServer startServer(int bindPort) {
|
||||||
def ratpack = GroovyEmbeddedApp.ratpack {
|
def ratpack = RatpackServer.start {
|
||||||
serverConfig {
|
it.serverConfig {
|
||||||
port bindPort
|
it.port(bindPort)
|
||||||
address InetAddress.getByName('localhost')
|
it.address(InetAddress.getByName("localhost"))
|
||||||
}
|
}
|
||||||
bindings {
|
it.handlers {
|
||||||
bind TestErrorHandler
|
it.register {
|
||||||
}
|
it.add(ServerErrorHandler, new TestErrorHandler())
|
||||||
handlers {
|
}
|
||||||
prefix(SUCCESS.rawPath()) {
|
it.prefix(SUCCESS.rawPath()) {
|
||||||
all {
|
it.all {context ->
|
||||||
controller(SUCCESS) {
|
controller(SUCCESS) {
|
||||||
context.response.status(SUCCESS.status).send(SUCCESS.body)
|
context.response.status(SUCCESS.status).send(SUCCESS.body)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
prefix(INDEXED_CHILD.rawPath()) {
|
it.prefix(INDEXED_CHILD.rawPath()) {
|
||||||
all {
|
it.all {context ->
|
||||||
controller(INDEXED_CHILD) {
|
controller(INDEXED_CHILD) {
|
||||||
INDEXED_CHILD.collectSpanAttributes { request.queryParams.get(it) }
|
INDEXED_CHILD.collectSpanAttributes { context.request.queryParams.get(it) }
|
||||||
context.response.status(INDEXED_CHILD.status).send()
|
context.response.status(INDEXED_CHILD.status).send()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
prefix(QUERY_PARAM.rawPath()) {
|
it.prefix(QUERY_PARAM.rawPath()) {
|
||||||
all {
|
it.all { context ->
|
||||||
controller(QUERY_PARAM) {
|
controller(QUERY_PARAM) {
|
||||||
context.response.status(QUERY_PARAM.status).send(request.query)
|
context.response.status(QUERY_PARAM.status).send(context.request.query)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
prefix(REDIRECT.rawPath()) {
|
it.prefix(REDIRECT.rawPath()) {
|
||||||
all {
|
it.all {context ->
|
||||||
controller(REDIRECT) {
|
controller(REDIRECT) {
|
||||||
context.redirect(REDIRECT.body)
|
context.redirect(REDIRECT.body)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
prefix(ERROR.rawPath()) {
|
it.prefix(ERROR.rawPath()) {
|
||||||
all {
|
it.all {context ->
|
||||||
controller(ERROR) {
|
controller(ERROR) {
|
||||||
context.response.status(ERROR.status).send(ERROR.body)
|
context.response.status(ERROR.status).send(ERROR.body)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
prefix(EXCEPTION.rawPath()) {
|
it.prefix(EXCEPTION.rawPath()) {
|
||||||
all {
|
it.all {
|
||||||
controller(EXCEPTION) {
|
controller(EXCEPTION) {
|
||||||
throw new Exception(EXCEPTION.body)
|
throw new Exception(EXCEPTION.body)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
prefix("path/:id/param") {
|
it.prefix("path/:id/param") {
|
||||||
all {
|
it.all {context ->
|
||||||
controller(PATH_PARAM) {
|
controller(PATH_PARAM) {
|
||||||
context.response.status(PATH_PARAM.status).send(pathTokens.id)
|
context.response.status(PATH_PARAM.status).send(context.pathTokens.id)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ratpack.server.start()
|
|
||||||
|
|
||||||
assert ratpack.address.port == bindPort
|
assert ratpack.bindPort == bindPort
|
||||||
return ratpack
|
return ratpack
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -103,8 +101,8 @@ class RatpackHttpServerTest extends HttpServerTest<EmbeddedApp> implements Agent
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
void stopServer(EmbeddedApp server) {
|
void stopServer(RatpackServer server) {
|
||||||
server.close()
|
server.stop()
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in New Issue