@Test public void shouldBeAbleToConvertARoleRepresentationIntoAnExistingRole() { RoleRepresentation representation = RoleDSL.role().build(); Role role = role().build(); Role updated = roleConversionService.convert(representation, role); assertThat(updated.getId()).isEqualTo(role.getId()); assertThat(updated.getCreated()).isEqualTo(role.getCreated()); assertThat(updated.getUpdated()).isEqualTo(role.getUpdated()); assertThat(updated.getName()).isEqualTo(representation.getName()); assertThat(updated.getDescription()).isEqualTo(representation.getDescription()); }
public Role convert(RoleRepresentation representation) { Role role = new Role(representation.getName()); role.setDescription(representation.getDescription()); return role; }
RoleConversionService { public Role convert(RoleRepresentation representation) { Role role = new Role(representation.getName()); role.setDescription(representation.getDescription()); return role; } }
RoleConversionService { public Role convert(RoleRepresentation representation) { Role role = new Role(representation.getName()); role.setDescription(representation.getDescription()); return role; }  }
RoleConversionService { public Role convert(RoleRepresentation representation) { Role role = new Role(representation.getName()); role.setDescription(representation.getDescription()); return role; }  Role convert(RoleRepresentation representation); RoleRepresentation convert(Role role); Role convert(RoleRepresentation representation, Role role); }
RoleConversionService { public Role convert(RoleRepresentation representation) { Role role = new Role(representation.getName()); role.setDescription(representation.getDescription()); return role; }  Role convert(RoleRepresentation representation); RoleRepresentation convert(Role role); Role convert(RoleRepresentation representation, Role role);  }