Skip to content

Commit

Permalink
Polish "Cleanup tests by using more idiomatic assertj assertions"
Browse files Browse the repository at this point in the history
  • Loading branch information
snicoll committed Jun 1, 2019
1 parent 3f838c2 commit 8919c73
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
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}
Expand Down Expand Up @@ -59,14 +59,14 @@ public void testPrint() {

@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);
}

Expand Down

0 comments on commit 8919c73

Please sign in to comment.