Replaced all tabs with spaces
This commit is contained in:
parent
bceb413241
commit
ee0d2ce427
9 changed files with 247 additions and 247 deletions
|
|
@ -30,23 +30,23 @@ import commons.Person;
|
|||
@RequestMapping("/api/people")
|
||||
public class PersonListingController {
|
||||
|
||||
private List<Person> people = new LinkedList<>();
|
||||
private List<Person> people = new LinkedList<>();
|
||||
|
||||
public PersonListingController() {
|
||||
people.add(new Person("Mickey", "Mouse"));
|
||||
people.add(new Person("Donald", "Duck"));
|
||||
}
|
||||
public PersonListingController() {
|
||||
people.add(new Person("Mickey", "Mouse"));
|
||||
people.add(new Person("Donald", "Duck"));
|
||||
}
|
||||
|
||||
@GetMapping("/")
|
||||
public List<Person> list() {
|
||||
return people;
|
||||
}
|
||||
@GetMapping("/")
|
||||
public List<Person> list() {
|
||||
return people;
|
||||
}
|
||||
|
||||
@PostMapping("/")
|
||||
public List<Person> add(@RequestBody Person p) {
|
||||
if (!people.contains(p)) {
|
||||
people.add(p);
|
||||
}
|
||||
return people;
|
||||
}
|
||||
@PostMapping("/")
|
||||
public List<Person> add(@RequestBody Person p) {
|
||||
if (!people.contains(p)) {
|
||||
people.add(p);
|
||||
}
|
||||
return people;
|
||||
}
|
||||
}
|
||||
|
|
@ -26,28 +26,28 @@ import commons.Person;
|
|||
|
||||
public class PersonListingControllerTest {
|
||||
|
||||
private static final Person MICKEY = new Person("Mickey", "Mouse");
|
||||
private static final Person DONALD = new Person("Donald", "Duck");
|
||||
private static final Person SCROOGE = new Person("Scrooge", "McDuck");
|
||||
private static final Person MICKEY = new Person("Mickey", "Mouse");
|
||||
private static final Person DONALD = new Person("Donald", "Duck");
|
||||
private static final Person SCROOGE = new Person("Scrooge", "McDuck");
|
||||
|
||||
private PersonListingController sut;
|
||||
private PersonListingController sut;
|
||||
|
||||
@BeforeEach
|
||||
public void setup() {
|
||||
sut = new PersonListingController();
|
||||
}
|
||||
@BeforeEach
|
||||
public void setup() {
|
||||
sut = new PersonListingController();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void containsTwoDefaultNames() {
|
||||
var actual = sut.list();
|
||||
var expected = List.of(MICKEY, DONALD);
|
||||
assertEquals(expected, actual);
|
||||
}
|
||||
@Test
|
||||
public void containsTwoDefaultNames() {
|
||||
var actual = sut.list();
|
||||
var expected = List.of(MICKEY, DONALD);
|
||||
assertEquals(expected, actual);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void canAddPeople() {
|
||||
var actual = sut.add(SCROOGE);
|
||||
var expected = List.of(MICKEY, DONALD, SCROOGE);
|
||||
assertEquals(expected, actual);
|
||||
}
|
||||
@Test
|
||||
public void canAddPeople() {
|
||||
var actual = sut.add(SCROOGE);
|
||||
var expected = List.of(MICKEY, DONALD, SCROOGE);
|
||||
assertEquals(expected, actual);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue