@Test
public void testTraceToken()
        throws IOException
{

    try {
        TraceTokenManager.createAndRegisterNewRequestToken("property", "value");
        handler.audit(new AutoValue_TestFileAuditLogger_TestingRecord("foovalue"));
        factory.close();
        String actual = Files.asCharSource(file, UTF_8).read();
        assertEquals(actual, "{\"time\":\"" + ISO_INSTANT.format(dateTimeSupplier.get()) + "\"," +
                "\"type\":\"com.proofpoint.audit.TestFileAuditLogger.TestingRecord\"," +
                "\"traceToken\":{\"id\":\"" + TraceTokenManager.getCurrentTraceToken().get("id") + "\",\"property\":\"value\"}," +
                "\"foo\":\"foovalue\"}\n");
    }
    finally {
        TraceTokenManager.clearRequestToken();
    }
}