Exemplo n.º 1
0
 public Change expected() {
   return Change.builder()
       .id("C2682N5HXP0BZ4")
       .status(Status.INSYNC)
       .submittedAt(new SimpleDateFormatDateService().iso8601DateParse("2011-09-10T01:36:41.958Z"))
       .build();
 }
Exemplo n.º 2
0
 @Override
 public Change getResult() {
   try {
     return Change.create(id, status, submittedAt);
   } finally {
     id = null;
     status = null;
     submittedAt = null;
   }
 }
Exemplo n.º 3
0
  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());
  }