    @Test
    public void formatProducesExpectedJsonData() throws Exception {

        LogRecord record = new LogRecord(Level.INFO, "message");
        record.setMillis(12345_678);
        record.setLoggerName("logger");
        LogContext context = new LogContext(Collections.singletonMap("traceId", "abcdef"));

        String logLine = context.execute(() -> formatter.format(record));
        assertThat(logLine, endsWith(System.lineSeparator()));

        JsonData data = new Gson().fromJson(logLine, JsonData.class);
        assertEquals("INFO", data.severity);
        assertEquals(12345, data.timestamp.seconds);
        assertEquals(678_000_000, data.timestamp.nanos);
        assertEquals(Thread.currentThread().getName(), data.thread);
        assertEquals("logger: message", data.message);
        assertEquals("abcdef", data.traceId);
    }