mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-15 12:25:50 +00:00
Polish "Cleanup tests by using more idiomatic assertj assertions"
See gh-418
This commit is contained in:
parent
3f838c2df2
commit
8919c7317b
1 changed files with 3 additions and 3 deletions
|
@ -29,7 +29,7 @@ import org.mockito.Mock;
|
|||
import org.mockito.junit.MockitoJUnitRunner;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
import static org.mockito.Mockito.when;
|
||||
import static org.mockito.BDDMockito.given;
|
||||
|
||||
/**
|
||||
* Test class for {@link PetTypeFormatter}
|
||||
|
@ -59,14 +59,14 @@ public class PetTypeFormatterTests {
|
|||
|
||||
@Test
|
||||
public void shouldParse() throws ParseException {
|
||||
when(this.pets.findPetTypes()).thenReturn(makePetTypes());
|
||||
given(this.pets.findPetTypes()).willReturn(makePetTypes());
|
||||
PetType petType = petTypeFormatter.parse("Bird", Locale.ENGLISH);
|
||||
assertThat(petType.getName()).isEqualTo("Bird");
|
||||
}
|
||||
|
||||
@Test(expected = ParseException.class)
|
||||
public void shouldThrowParseException() throws ParseException {
|
||||
when(this.pets.findPetTypes()).thenReturn(makePetTypes());
|
||||
given(this.pets.findPetTypes()).willReturn(makePetTypes());
|
||||
petTypeFormatter.parse("Fish", Locale.ENGLISH);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue