@Test public void test() { JSONCharacterSink sink = createMock(JSONCharacterSink.class); sink.append("\"foo\""); expectLastCall().once(); replay(sink); JSON json = new JSON(); json.registerJSONifier(Bean.class, new TestSinkAwareJSONifier()); json.dumpObject(sink, new Bean()); verify(sink); }
public void writeToSink(JSONCharacterSink sink, Object o) { sink.append("\"foo\""); }