@Test public void itLogsRequestResponseTransaction() throws IOException { Request request = new Request("GET", "/mock.html", null, ""); Response response = new Response("200 OK", null, "Hello".getBytes()); Date socketOpenTime = new Date(); Files.deleteIfExists(Paths.get("public/logs")); Logger.logBasic(request, response, socketOpenTime, "public/"); assertArrayEquals( (socketOpenTime.toString() + " 'GET /mock.html HTTP/1.1' 200 OK\n").getBytes(), Files.readAllBytes(Paths.get("public/logs"))); }