@Test public void mapsTheStreetResponseFromPaf() { PafToStreetResponseConverter underTest = new PafToStreetResponseConverter(); Street streetResponse = underTest.apply(ImmutablePafStreetResponse.builder() .withDependentStreet("dependentStreet") .withMainStreet("mainStreet") .withCanvassed(10) .withVoters(20) .withDependentLocality("dependentLocality") .withPostTown("postTown") .withPriority(2) .build() ); assertThat(streetResponse.mainStreet(), is("mainStreet")); assertThat(streetResponse.dependentStreet(), is("dependentStreet")); assertThat(streetResponse.dependentLocality(), is("dependentLocality")); assertThat(streetResponse.numCanvassed(), is(10)); assertThat(streetResponse.numVoters(), is(20)); assertThat(streetResponse.postTown(), is("postTown")); assertThat(streetResponse.priority(), is(2)); }
@Override public Street apply(PafStreetResponse pafStreet) { return ImmutableStreet .builder() .withMainStreet(pafStreet.mainStreet()) .withPostTown(pafStreet.postTown()) .withDependentStreet(pafStreet.dependentStreet()) .withDependentLocality(pafStreet.dependentLocality()) .withNumVoters(pafStreet.voters()) .withNumCanvassed(pafStreet.canvassed()) .withPostcode(pafStreet.postcode()) .withPriority(pafStreet.priority()) .withPledged(pafStreet.pledged()) .withVotedPledges(pafStreet.votedPledges()) .withNumPostalVoters(pafStreet.postalVoters()) .build(); }
PafToStreetResponseConverter implements Function<PafStreetResponse, Street> { @Override public Street apply(PafStreetResponse pafStreet) { return ImmutableStreet .builder() .withMainStreet(pafStreet.mainStreet()) .withPostTown(pafStreet.postTown()) .withDependentStreet(pafStreet.dependentStreet()) .withDependentLocality(pafStreet.dependentLocality()) .withNumVoters(pafStreet.voters()) .withNumCanvassed(pafStreet.canvassed()) .withPostcode(pafStreet.postcode()) .withPriority(pafStreet.priority()) .withPledged(pafStreet.pledged()) .withVotedPledges(pafStreet.votedPledges()) .withNumPostalVoters(pafStreet.postalVoters()) .build(); } }
PafToStreetResponseConverter implements Function<PafStreetResponse, Street> { @Override public Street apply(PafStreetResponse pafStreet) { return ImmutableStreet .builder() .withMainStreet(pafStreet.mainStreet()) .withPostTown(pafStreet.postTown()) .withDependentStreet(pafStreet.dependentStreet()) .withDependentLocality(pafStreet.dependentLocality()) .withNumVoters(pafStreet.voters()) .withNumCanvassed(pafStreet.canvassed()) .withPostcode(pafStreet.postcode()) .withPriority(pafStreet.priority()) .withPledged(pafStreet.pledged()) .withVotedPledges(pafStreet.votedPledges()) .withNumPostalVoters(pafStreet.postalVoters()) .build(); }  }
PafToStreetResponseConverter implements Function<PafStreetResponse, Street> { @Override public Street apply(PafStreetResponse pafStreet) { return ImmutableStreet .builder() .withMainStreet(pafStreet.mainStreet()) .withPostTown(pafStreet.postTown()) .withDependentStreet(pafStreet.dependentStreet()) .withDependentLocality(pafStreet.dependentLocality()) .withNumVoters(pafStreet.voters()) .withNumCanvassed(pafStreet.canvassed()) .withPostcode(pafStreet.postcode()) .withPriority(pafStreet.priority()) .withPledged(pafStreet.pledged()) .withVotedPledges(pafStreet.votedPledges()) .withNumPostalVoters(pafStreet.postalVoters()) .build(); }  @Override Street apply(PafStreetResponse pafStreet); }
PafToStreetResponseConverter implements Function<PafStreetResponse, Street> { @Override public Street apply(PafStreetResponse pafStreet) { return ImmutableStreet .builder() .withMainStreet(pafStreet.mainStreet()) .withPostTown(pafStreet.postTown()) .withDependentStreet(pafStreet.dependentStreet()) .withDependentLocality(pafStreet.dependentLocality()) .withNumVoters(pafStreet.voters()) .withNumCanvassed(pafStreet.canvassed()) .withPostcode(pafStreet.postcode()) .withPriority(pafStreet.priority()) .withPledged(pafStreet.pledged()) .withVotedPledges(pafStreet.votedPledges()) .withNumPostalVoters(pafStreet.postalVoters()) .build(); }  @Override Street apply(PafStreetResponse pafStreet);  }