public Change expected() { return Change.builder() .id("C2682N5HXP0BZ4") .status(Status.INSYNC) .submittedAt(new SimpleDateFormatDateService().iso8601DateParse("2011-09-10T01:36:41.958Z")) .build(); }
@Override public Change getResult() { try { return Change.create(id, status, submittedAt); } finally { id = null; status = null; submittedAt = null; } }
public void test() { InputStream is = getClass().getResourceAsStream("/change.xml"); Change expected = expected(); ChangeHandler handler = injector.getInstance(ChangeHandler.class); Change result = factory.create(handler).parse(is); assertEquals(result, expected); assertEquals(result.getStatus(), expected.getStatus()); assertEquals(result.getSubmittedAt(), expected.getSubmittedAt()); }