@Test public void should_build_proper_json_message() { String name = "Lewandowski"; int age = 25; Person person = new Person(name, age); String expectedUpdatePersonJson = "{\"name\":\"" + name + "\",\"age\":\"" + age + "\"}"; String updatePersonJson = systemUnderTest.build(person); then(expectedUpdatePersonJson).isEqualTo(updatePersonJson); }
public String build(Person person) { return "{\"name\":\"" + person.getName() + "\",\"age\":\"" + person.getAge() + "\"}"; }
UpdatePersonJsonBuilder { public String build(Person person) { return "{\"name\":\"" + person.getName() + "\",\"age\":\"" + person.getAge() + "\"}"; } }
UpdatePersonJsonBuilder { public String build(Person person) { return "{\"name\":\"" + person.getName() + "\",\"age\":\"" + person.getAge() + "\"}"; }  }
UpdatePersonJsonBuilder { public String build(Person person) { return "{\"name\":\"" + person.getName() + "\",\"age\":\"" + person.getAge() + "\"}"; }  String build(Person person); }
UpdatePersonJsonBuilder { public String build(Person person) { return "{\"name\":\"" + person.getName() + "\",\"age\":\"" + person.getAge() + "\"}"; }  String build(Person person);  }