@Override
  public int getPort() {
    return ((InetSocketAddress) serverChannel.localAddress()).getPort();
  }
@Test
  void badRequest() throws IOException {
    int port = server.getPort();
    String msg = "GET /status HTTP/1.1\n\n";
    InetSocketAddress sockAddr = new InetSocketAddress("127.0.0.1", port);

    try (Socket sock = new Socket()) {
      sock.connect(sockAddr);
      OutputStream out = sock.getOutputStream();
      out.write(msg.getBytes(StandardCharsets.UTF_8));
      out.flush();
      byte[] buf = new byte[2048];
      int bytesRead = sock.getInputStream().read(buf);
      assertEquals(bytesRead, -1);
    }
  }