@Test public void shouldBeAbleToConvertAScopeRepresentationIntoAnExistingScope() { ScopeRepresentation representation = ScopeDSL.scope().build(); Scope scope = scope().build(); Scope updated = scopeConversionService.convert(representation, scope); assertThat(updated.getId()).isEqualTo(scope.getId()); assertThat(updated.getCreated()).isEqualTo(scope.getCreated()); assertThat(updated.getUpdated()).isEqualTo(scope.getUpdated()); assertThat(updated.getName()).isEqualTo(representation.getName()); assertThat(updated.getDescription()).isEqualTo(representation.getDescription()); }
public Scope convert(ScopeRepresentation representation) { Scope audience = new Scope(representation.getName()); audience.setDescription(representation.getDescription()); return audience; }
ScopeConversionService { public Scope convert(ScopeRepresentation representation) { Scope audience = new Scope(representation.getName()); audience.setDescription(representation.getDescription()); return audience; } }
ScopeConversionService { public Scope convert(ScopeRepresentation representation) { Scope audience = new Scope(representation.getName()); audience.setDescription(representation.getDescription()); return audience; }  }
ScopeConversionService { public Scope convert(ScopeRepresentation representation) { Scope audience = new Scope(representation.getName()); audience.setDescription(representation.getDescription()); return audience; }  Scope convert(ScopeRepresentation representation); ScopeRepresentation convert(Scope scope); Scope convert(ScopeRepresentation representation, Scope scope); }
ScopeConversionService { public Scope convert(ScopeRepresentation representation) { Scope audience = new Scope(representation.getName()); audience.setDescription(representation.getDescription()); return audience; }  Scope convert(ScopeRepresentation representation); ScopeRepresentation convert(Scope scope); Scope convert(ScopeRepresentation representation, Scope scope);  }