fix tests
This commit is contained in:
parent
3b5001dbcc
commit
b97c7407d2
7 changed files with 14 additions and 14 deletions
|
@ -29,7 +29,7 @@ class TransportLayerSecurityServerTest {
|
||||||
Server server = Server.builder(HttpServerDomain.builder(httpAddress)
|
Server server = Server.builder(HttpServerDomain.builder(httpAddress)
|
||||||
.setSelfCert()
|
.setSelfCert()
|
||||||
.singleEndpoint("/", (request, response) ->
|
.singleEndpoint("/", (request, response) ->
|
||||||
response.getBuilder().setStatus(HttpResponseStatus.OK).setContentType("text/plain").build()
|
response.getBuilder().setStatus(HttpResponseStatus.OK.code()).setContentType("text/plain").build()
|
||||||
.write(request.getContent().toString(StandardCharsets.UTF_8)))
|
.write(request.getContent().toString(StandardCharsets.UTF_8)))
|
||||||
.build())
|
.build())
|
||||||
.setTransportLayerSecurityProtocols("TLSv1.2")
|
.setTransportLayerSecurityProtocols("TLSv1.2")
|
||||||
|
@ -66,7 +66,7 @@ class TransportLayerSecurityServerTest {
|
||||||
Server server = Server.builder(HttpServerDomain.builder(httpAddress)
|
Server server = Server.builder(HttpServerDomain.builder(httpAddress)
|
||||||
.setSelfCert()
|
.setSelfCert()
|
||||||
.singleEndpoint("/", (request, response) ->
|
.singleEndpoint("/", (request, response) ->
|
||||||
response.getBuilder().setStatus(HttpResponseStatus.OK).setContentType("text/plain").build()
|
response.getBuilder().setStatus(HttpResponseStatus.OK.code()).setContentType("text/plain").build()
|
||||||
.write(request.getContent().toString(StandardCharsets.UTF_8)))
|
.write(request.getContent().toString(StandardCharsets.UTF_8)))
|
||||||
.build())
|
.build())
|
||||||
.setTransportLayerSecurityProtocols("TLSv1.3")
|
.setTransportLayerSecurityProtocols("TLSv1.3")
|
||||||
|
|
|
@ -33,7 +33,7 @@ class EncryptedTest {
|
||||||
Server server = Server.builder(HttpServerDomain.builder(httpAddress)
|
Server server = Server.builder(HttpServerDomain.builder(httpAddress)
|
||||||
.setSelfCert()
|
.setSelfCert()
|
||||||
.singleEndpoint("/", (request, response) ->
|
.singleEndpoint("/", (request, response) ->
|
||||||
response.getBuilder().setStatus(HttpResponseStatus.OK).setContentType("text/plain").build()
|
response.getBuilder().setStatus(HttpResponseStatus.OK.code()).setContentType("text/plain").build()
|
||||||
.write(request.getContent().toString(StandardCharsets.UTF_8)))
|
.write(request.getContent().toString(StandardCharsets.UTF_8)))
|
||||||
.build())
|
.build())
|
||||||
.build();
|
.build();
|
||||||
|
@ -73,7 +73,7 @@ class EncryptedTest {
|
||||||
HttpServerDomain domain = HttpServerDomain.builder(httpAddress)
|
HttpServerDomain domain = HttpServerDomain.builder(httpAddress)
|
||||||
.setSelfCert()
|
.setSelfCert()
|
||||||
.singleEndpoint("/", (request, response) ->
|
.singleEndpoint("/", (request, response) ->
|
||||||
response.getBuilder().setStatus(HttpResponseStatus.OK).setContentType("text/plain").build()
|
response.getBuilder().setStatus(HttpResponseStatus.OK.code()).setContentType("text/plain").build()
|
||||||
.write(request.getContent().toString(StandardCharsets.UTF_8)))
|
.write(request.getContent().toString(StandardCharsets.UTF_8)))
|
||||||
.build();
|
.build();
|
||||||
Server server = Server.builder(domain)
|
Server server = Server.builder(domain)
|
||||||
|
@ -126,7 +126,7 @@ class EncryptedTest {
|
||||||
Server server = Server.builder(HttpServerDomain.builder(httpAddress)
|
Server server = Server.builder(HttpServerDomain.builder(httpAddress)
|
||||||
.setSelfCert()
|
.setSelfCert()
|
||||||
.singleEndpoint("/", (request, response) ->
|
.singleEndpoint("/", (request, response) ->
|
||||||
response.getBuilder().setStatus(HttpResponseStatus.OK).setContentType("text/plain").build()
|
response.getBuilder().setStatus(HttpResponseStatus.OK.code()).setContentType("text/plain").build()
|
||||||
.write(request.getContent().toString(StandardCharsets.UTF_8)))
|
.write(request.getContent().toString(StandardCharsets.UTF_8)))
|
||||||
.build())
|
.build())
|
||||||
.build();
|
.build();
|
||||||
|
|
|
@ -34,7 +34,7 @@ class FlushTest {
|
||||||
.singleEndpoint("/flush", "/**", (req, resp) -> {
|
.singleEndpoint("/flush", "/**", (req, resp) -> {
|
||||||
HttpParameters parameters = req.getParameters();
|
HttpParameters parameters = req.getParameters();
|
||||||
logger.log(Level.INFO, "got request " + parameters.toString() + ", sending 302 Found");
|
logger.log(Level.INFO, "got request " + parameters.toString() + ", sending 302 Found");
|
||||||
resp.getBuilder().setStatus(HttpResponseStatus.FOUND).build().flush();
|
resp.getBuilder().setStatus(HttpResponseStatus.FOUND.code()).build().flush();
|
||||||
})
|
})
|
||||||
.build();
|
.build();
|
||||||
Server server = Server.builder(domain)
|
Server server = Server.builder(domain)
|
||||||
|
|
|
@ -21,7 +21,7 @@ class MixedProtocolTest {
|
||||||
void testHttp1ClientHttp2Server() throws Exception {
|
void testHttp1ClientHttp2Server() throws Exception {
|
||||||
HttpAddress httpAddress = HttpAddress.http2("localhost", 8008);
|
HttpAddress httpAddress = HttpAddress.http2("localhost", 8008);
|
||||||
HttpServerDomain domain = HttpServerDomain.builder(httpAddress)
|
HttpServerDomain domain = HttpServerDomain.builder(httpAddress)
|
||||||
.singleEndpoint("/", (request, response) -> response.getBuilder().setStatus(HttpResponseStatus.OK).build().flush())
|
.singleEndpoint("/", (request, response) -> response.getBuilder().setStatus(HttpResponseStatus.OK.code()).build().flush())
|
||||||
.build();
|
.build();
|
||||||
Server server = Server.builder(domain)
|
Server server = Server.builder(domain)
|
||||||
.build();
|
.build();
|
||||||
|
@ -54,7 +54,7 @@ class MixedProtocolTest {
|
||||||
HttpAddress httpAddress = HttpAddress.http1("localhost", 8008);
|
HttpAddress httpAddress = HttpAddress.http1("localhost", 8008);
|
||||||
HttpServerDomain domain = HttpServerDomain.builder(httpAddress)
|
HttpServerDomain domain = HttpServerDomain.builder(httpAddress)
|
||||||
.singleEndpoint("/", (request, response) ->
|
.singleEndpoint("/", (request, response) ->
|
||||||
response.getBuilder().setStatus(HttpResponseStatus.OK).build().flush())
|
response.getBuilder().setStatus(HttpResponseStatus.OK.code()).build().flush())
|
||||||
.build();
|
.build();
|
||||||
Server server = Server.builder(domain)
|
Server server = Server.builder(domain)
|
||||||
.build();
|
.build();
|
||||||
|
@ -91,7 +91,7 @@ class MixedProtocolTest {
|
||||||
HttpServerDomain domain = HttpServerDomain.builder(httpAddress)
|
HttpServerDomain domain = HttpServerDomain.builder(httpAddress)
|
||||||
.setSelfCert()
|
.setSelfCert()
|
||||||
.singleEndpoint("/", (request, response) ->
|
.singleEndpoint("/", (request, response) ->
|
||||||
response.getBuilder().setStatus(HttpResponseStatus.OK).build().flush()
|
response.getBuilder().setStatus(HttpResponseStatus.OK.code()).build().flush()
|
||||||
)
|
)
|
||||||
.build();
|
.build();
|
||||||
Server server = Server.builder(domain)
|
Server server = Server.builder(domain)
|
||||||
|
|
|
@ -42,7 +42,7 @@ class PostTest {
|
||||||
if ("Jörg".equals(parameters.get("name"))) {
|
if ("Jörg".equals(parameters.get("name"))) {
|
||||||
success3.set(true);
|
success3.set(true);
|
||||||
}
|
}
|
||||||
resp.getBuilder().setStatus(HttpResponseStatus.OK).build().flush();
|
resp.getBuilder().setStatus(HttpResponseStatus.OK.code()).build().flush();
|
||||||
}, "POST")
|
}, "POST")
|
||||||
.build();
|
.build();
|
||||||
Server server = Server.builder(domain)
|
Server server = Server.builder(domain)
|
||||||
|
@ -92,7 +92,7 @@ class PostTest {
|
||||||
if ("Jörg".equals(parameters.get("name"))) {
|
if ("Jörg".equals(parameters.get("name"))) {
|
||||||
success3.set(true);
|
success3.set(true);
|
||||||
}
|
}
|
||||||
resp.getBuilder().setStatus(HttpResponseStatus.OK).build().flush();
|
resp.getBuilder().setStatus(HttpResponseStatus.OK.code()).build().flush();
|
||||||
}, "POST")
|
}, "POST")
|
||||||
.build();
|
.build();
|
||||||
Server server = Server.builder(domain)
|
Server server = Server.builder(domain)
|
||||||
|
|
|
@ -34,7 +34,7 @@ class PutTest {
|
||||||
.singleEndpoint("/put", "/**", (req, resp) -> {
|
.singleEndpoint("/put", "/**", (req, resp) -> {
|
||||||
logger.log(Level.INFO, "got request " +
|
logger.log(Level.INFO, "got request " +
|
||||||
req.getContent().toString(StandardCharsets.UTF_8));
|
req.getContent().toString(StandardCharsets.UTF_8));
|
||||||
resp.getBuilder().setStatus(HttpResponseStatus.OK).build().flush();
|
resp.getBuilder().setStatus(HttpResponseStatus.OK.code()).build().flush();
|
||||||
success1.set(true);
|
success1.set(true);
|
||||||
}, "PUT")
|
}, "PUT")
|
||||||
.build();
|
.build();
|
||||||
|
@ -83,7 +83,7 @@ class PutTest {
|
||||||
.singleEndpoint("/put", "/**", (req, resp) -> {
|
.singleEndpoint("/put", "/**", (req, resp) -> {
|
||||||
logger.log(Level.INFO, "got request, length = " +
|
logger.log(Level.INFO, "got request, length = " +
|
||||||
req.getContent().readableBytes());
|
req.getContent().readableBytes());
|
||||||
resp.getBuilder().setStatus(HttpResponseStatus.OK).build().flush();
|
resp.getBuilder().setStatus(HttpResponseStatus.OK.code()).build().flush();
|
||||||
success1.set(true);
|
success1.set(true);
|
||||||
}, "PUT")
|
}, "PUT")
|
||||||
.build();
|
.build();
|
||||||
|
|
|
@ -28,7 +28,7 @@ class StreamTest {
|
||||||
assertEquals("my body parameter", content);
|
assertEquals("my body parameter", content);
|
||||||
ByteBufOutputStream outputStream = response.getOutputStream();
|
ByteBufOutputStream outputStream = response.getOutputStream();
|
||||||
outputStream.writeBytes("Hello World");
|
outputStream.writeBytes("Hello World");
|
||||||
response.getBuilder().setStatus(HttpResponseStatus.OK)
|
response.getBuilder().setStatus(HttpResponseStatus.OK.code())
|
||||||
.setContentType("text/plain")
|
.setContentType("text/plain")
|
||||||
.build()
|
.build()
|
||||||
.write(outputStream);
|
.write(outputStream);
|
||||||
|
|
Loading…
Reference in a new issue