CompatibilityMapper { public void map(Object object) { map(object, new DefaultVersionContext(object)); } CompatibilityMapper(VersionTypeFactory factory); void map(Object object); void map(Object object, DefaultVersionContext context);  }
@Test public void mapV21() { AddressV2 address = createV21(); mapper.map(address); assertThat(address.getAddressLine1(), is("Samplestreet 1")); assertThat(address.getAddressLine2(), is(" ")); assertThat(address.getAddressLines(), hasItems("Samplestreet 1", " ")); assertThat(address.getLocation().getZipCode(), is("12345")); assertThat(address.getLocation().getCityName(), is("Samplecity")); assertThat(address.getCity().getZipCode(), is("12345")); assertThat(address.getCity().getCityName(), is("Samplecity")); }
@Test public void mapV30() { AddressV3 address = createV30(); mapper.map(address); assertThat(address.getAddressLine1(), is("Samplestreet 1")); assertThat(address.getAddressLine2(), is(" ")); assertThat(address.getCity().getZipCode(), is("12345")); assertThat(address.getCity().getCityName(), is("Samplecity")); }
@Test public void mapV31() { AddressV3 address = createV31(); mapper.map(address); assertThat(address.getAddressLines().size(), is(2)); assertThat(address.getAddressLines().iterator().next(), is("Samplestreet 1")); assertThat(address.getAddressLines(), hasItem(" ")); assertThat(address.getCity().getZipCode(), is("12345")); assertThat(address.getCity().getCityName(), is("Samplecity")); }
@Test public void mapV10() { AddressV1 address = createV10(); mapper.map(address); assertThat(address, is(v10())); assertThat(address, is(v11())); assertThat(address, is(v12())); assertThat(address, is(v13())); assertThat(address, is(v14())); assertThat(address, is(v15())); }
@Test public void mapV11() { AddressV1 address = createV11(); mapper.map(address); assertThat(address, is(v10())); assertThat(address, is(v11())); assertThat(address, is(v12())); assertThat(address, is(v13())); assertThat(address, is(v14())); assertThat(address, is(v15())); }
@Test public void mapV12() { AddressV1 address = createV12(); mapper.map(address); assertThat(address, is(v10())); assertThat(address, is(v11())); assertThat(address, is(v12())); assertThat(address, is(v13())); assertThat(address, is(v14())); assertThat(address, is(v15())); }
@Test public void mapV13() { AddressV1 address = createV13(); mapper.map(address); assertThat(address, is(v10())); assertThat(address, is(v11())); assertThat(address, is(v12())); assertThat(address, is(v13())); assertThat(address, is(v14())); assertThat(address, is(v15())); }
@Test public void mapV14() { AddressV1 address = createV14(); mapper.map(address); assertThat(address, is(v10())); assertThat(address, is(v11())); assertThat(address, is(v12())); assertThat(address, is(v13())); assertThat(address, is(v14())); assertThat(address, is(v15())); }
@Test public void mapV15() { AddressV1 address = createV15(); mapper.map(address); assertThat(address, is(v10())); assertThat(address, is(v11())); assertThat(address, is(v12())); assertThat(address, is(v13())); assertThat(address, is(v14())); assertThat(address, is(v15())); }
@Test public void mapV20() { AddressV2 address = createV20(); mapper.map(address); assertThat(address.getAddressLine1(), is("Samplestreet 1")); assertThat(address.getAddressLine2(), is(" ")); assertThat(address.getAddressLines(), hasItems("Samplestreet 1", " ")); assertThat(address.getLocation().getZipCode(), is("12345")); assertThat(address.getLocation().getCityName(), is("Samplecity")); assertThat(address.getCity().getZipCode(), is("12345")); assertThat(address.getCity().getCityName(), is("Samplecity")); }