@Test public void testToString_withData() { Thread.currentThread().setName("quartz-7-thread-1"); underTest = new AuditDTO(makeAuditData()); Matcher timestampMatcher = TIMESTAMP_PATTERN.matcher(underTest.toString()); assertTrue(timestampMatcher.matches()); String timestamp = timestampMatcher.group(2); assertThat(parse(timestamp, forPattern("yyyy-MM-dd HH:mm:ss,SSSZ")).getMillis(), is(TEST_TIMESTAMP)); assertThat(timestampMatcher.replaceAll("$1<TIMESTAMP>$3"), is( "{\"timestamp\":\"<TIMESTAMP>\",\"nodeId\":\"testnodeid\",\"initiator\":\"testinitiator\",\"domain\":\"testdomain\",\"type\":\"testtype\",\"context\":\"testcontext\",\"thread\":\"quartz-7-thread-1\",\"attributes\":{\"testattribute1\":\"testvalue1\",\"testattribute2\":\"testvalue2\"}}")); }
@Override public String toString() { return OBJECT_MAPPER.valueToTree(this).toString(); }
AuditDTO { @Override public String toString() { return OBJECT_MAPPER.valueToTree(this).toString(); } }
AuditDTO { @Override public String toString() { return OBJECT_MAPPER.valueToTree(this).toString(); } AuditDTO();  AuditDTO(AuditData auditData); }
AuditDTO { @Override public String toString() { return OBJECT_MAPPER.valueToTree(this).toString(); } AuditDTO();  AuditDTO(AuditData auditData); String getTimestamp(); void setTimestamp(String timestamp); String getNodeId(); void setNodeId(String nodeId); String getInitiator(); void setInitiator(String initiator); String getDomain(); void setDomain(String domain); String getType(); void setType(String type); String getContext(); void setContext(String context); String getThread(); Map<String, Object> getAttributes(); void setAttributes(Map<String, Object> attributes); @Override String toString(); }
AuditDTO { @Override public String toString() { return OBJECT_MAPPER.valueToTree(this).toString(); } AuditDTO();  AuditDTO(AuditData auditData); String getTimestamp(); void setTimestamp(String timestamp); String getNodeId(); void setNodeId(String nodeId); String getInitiator(); void setInitiator(String initiator); String getDomain(); void setDomain(String domain); String getType(); void setType(String type); String getContext(); void setContext(String context); String getThread(); Map<String, Object> getAttributes(); void setAttributes(Map<String, Object> attributes); @Override String toString();  }