@Test public void shouldBeAbleToConvertAAudienceRepresentationIntoAnExistingAudience() { AudienceRepresentation representation = AudienceDSL.audience().build(); Audience audience = audience().build(); Audience updated = audienceConversionService.convert(representation, audience); assertThat(updated.getId()).isEqualTo(audience.getId()); assertThat(updated.getCreated()).isEqualTo(audience.getCreated()); assertThat(updated.getUpdated()).isEqualTo(audience.getUpdated()); assertThat(updated.getName()).isEqualTo(representation.getName()); assertThat(updated.getDescription()).isEqualTo(representation.getDescription()); }
public Audience convert(AudienceRepresentation representation) { Audience audience = new Audience(representation.getName()); audience.setDescription(representation.getDescription()); return audience; }
AudienceConversionService { public Audience convert(AudienceRepresentation representation) { Audience audience = new Audience(representation.getName()); audience.setDescription(representation.getDescription()); return audience; } }
AudienceConversionService { public Audience convert(AudienceRepresentation representation) { Audience audience = new Audience(representation.getName()); audience.setDescription(representation.getDescription()); return audience; }  }
AudienceConversionService { public Audience convert(AudienceRepresentation representation) { Audience audience = new Audience(representation.getName()); audience.setDescription(representation.getDescription()); return audience; }  Audience convert(AudienceRepresentation representation); AudienceRepresentation convert(Audience audience); Audience convert(AudienceRepresentation representation, Audience audience); }
AudienceConversionService { public Audience convert(AudienceRepresentation representation) { Audience audience = new Audience(representation.getName()); audience.setDescription(representation.getDescription()); return audience; }  Audience convert(AudienceRepresentation representation); AudienceRepresentation convert(Audience audience); Audience convert(AudienceRepresentation representation, Audience audience);  }