Improve order of passing arguments in assert

Expected argument should come first.
This commit is contained in:
Luís Soares 2017-02-05 18:25:52 +00:00 committed by Andrew Morgan
parent bb6224d771
commit 7c07b93def
1 changed files with 3 additions and 5 deletions

View File

@ -3,12 +3,10 @@ package com.baeldung.jackson.deserialization;
import java.io.IOException;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import com.baeldung.jackson.entities.Movie;
import org.junit.Assert;
import org.junit.Test;
import com.fasterxml.jackson.databind.ObjectMapper;
import static org.junit.Assert.assertEquals;
public class JacksonDeserializeTest {
@ -20,7 +18,7 @@ public class JacksonDeserializeTest {
final Movie movie = mapper.readValue(jsonInput, Movie.class);
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]]]]";
Assert.assertEquals(movie.toString(), expectedOutput);
assertEquals(expectedOutput, movie.toString());
}
@Test
@ -35,7 +33,7 @@ public class JacksonDeserializeTest {
final Movie movie = mapper.readValue(jsonInput, Movie.class);
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]]]]";
Assert.assertEquals(movie.toString(), expectedOutput);
assertEquals(expectedOutput, movie.toString());
}
}