Пример #1
0
  @Test
  public void deserializesFromXML() throws IOException {
    final Airlines airlines = new Airlines();
    airlines.getAirlines().add("All Nippon Airways");
    airlines.getAirlines().add("Cebu Pacific");

    final Airlines expected =
        MAPPER.readValue(FixtureHelpers.fixture("fixtures/airlines.xml"), Airlines.class);

    Assert.assertEquals(airlines.getAirlines(), expected.getAirlines());
  }
Пример #2
0
  @Test
  public void serializesToXML() throws IOException {
    final Airlines airlines = new Airlines();
    airlines.getAirlines().add("All Nippon Airways");
    airlines.getAirlines().add("Cebu Pacific");

    final String expected =
        MAPPER.writeValueAsString(
            MAPPER.readValue(FixtureHelpers.fixture("fixtures/airlines.xml"), Airlines.class));

    Assert.assertEquals(MAPPER.writeValueAsString(airlines), expected);
  }