mirror of
https://github.com/itplr-kosit/validator.git
synced 2026-05-25 16:55:39 +00:00
(chore) more test coverage
This commit is contained in:
parent
aad08768dd
commit
bcbb0de09c
6 changed files with 95 additions and 6 deletions
|
|
@ -15,13 +15,13 @@ abstract class BaseHandler implements HttpHandler {
|
|||
|
||||
protected static final String APPLICATION_XML = "application/xml";
|
||||
|
||||
protected static final int OK = 200;
|
||||
static final int OK = 200;
|
||||
|
||||
protected static void write(final HttpExchange exchange, final byte[] content, final String contentType) throws IOException {
|
||||
write(exchange, contentType, os -> os.write(content));
|
||||
}
|
||||
|
||||
protected static void write(final HttpExchange exchange, final String contentType, Write write) throws IOException {
|
||||
protected static void write(final HttpExchange exchange, final String contentType, final Write write) throws IOException {
|
||||
exchange.getResponseHeaders().add("Content-Type", contentType);
|
||||
exchange.sendResponseHeaders(OK, 0);
|
||||
final OutputStream os = exchange.getResponseBody();
|
||||
|
|
@ -41,6 +41,6 @@ abstract class BaseHandler implements HttpHandler {
|
|||
@FunctionalInterface
|
||||
protected interface Write {
|
||||
|
||||
public void write(OutputStream out) throws IOException;
|
||||
void write(OutputStream out) throws IOException;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue