Skip to content

Commit 7c07b93

Browse files
lsoaresmogronalol
authored andcommitted
Improve order of passing arguments in assert
Expected argument should come first.
1 parent bb6224d commit 7c07b93

1 file changed

Lines changed: 3 additions & 5 deletions

File tree

‎jackson/src/test/java/com/baeldung/jackson/deserialization/JacksonDeserializeTest.java‎

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,10 @@
33
import java.io.IOException;
44
import java.text.DateFormat;
55
import java.text.SimpleDateFormat;
6-
76
import com.baeldung.jackson.entities.Movie;
8-
import org.junit.Assert;
97
import org.junit.Test;
10-
118
import com.fasterxml.jackson.databind.ObjectMapper;
9+
import static org.junit.Assert.assertEquals;
1210

1311
public class JacksonDeserializeTest {
1412

@@ -20,7 +18,7 @@ public void whenSimpleDeserialize_thenCorrect() throws IOException {
2018
final Movie movie = mapper.readValue(jsonInput, Movie.class);
2119

2220
final String expectedOutput = "Movie [imdbId=tt0472043, director=null, actors=[ActorJackson [imdbId=nm2199632, dateOfBirth=Tue Sep 21 11:00:00 GMT 1982, filmography=[Apocalypto, Beatdown, Wind Walkers]]]]";
23-
Assert.assertEquals(movie.toString(), expectedOutput);
21+
assertEquals(expectedOutput, movie.toString());
2422
}
2523

2624
@Test
@@ -35,7 +33,7 @@ public void whenCustomDeserialize_thenCorrect() throws IOException {
3533
final Movie movie = mapper.readValue(jsonInput, Movie.class);
3634

3735
final String expectedOutput = "Movie [imdbId=tt0472043, director=Mel Gibson, actors=[ActorJackson [imdbId=nm2199632, dateOfBirth=Tue Sep 21 11:00:00 GMT 1982, filmography=[Apocalypto, Beatdown, Wind Walkers]]]]";
38-
Assert.assertEquals(movie.toString(), expectedOutput);
36+
assertEquals(expectedOutput, movie.toString());
3937
}
4038

4139
}

0 commit comments

Comments
 (0)