Make test pass in non-english computers where tests are run

The tested failed in my portuguese language OS because of:
Ter(ça) is Tue(sday)

Movie [imdbId=tt0472043, director=null, actors=[ActorJackson [imdbId=nm2199632, dateOfBirth=Ter set 21 11:00:00 GMT 1982, filmography=[Apocalypto, Beatdown, Wind Walkers]]]]
Movie [imdbId=tt0472043, director=null, actors=[ActorJackson [imdbId=nm2199632, dateOfBirth=Tue Sep 21 11:00:00 GMT 1982, filmography=[Apocalypto, Beatdown, Wind Walkers]]]]

Locale was enforced
This commit is contained in:
Luís Soares 2017-02-05 18:24:48 +00:00 committed by Andrew Morgan
parent b050db16cb
commit bb6224d771
1 changed files with 2 additions and 1 deletions

View File

@ -4,6 +4,7 @@ import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
import java.util.Locale;
import java.util.TimeZone;
public class ActorJackson {
@ -53,7 +54,7 @@ public class ActorJackson {
}
private String formatDateOfBirth() {
final DateFormat formatter = new SimpleDateFormat("EEE MMM dd hh:mm:ss zzz yyyy");
final DateFormat formatter = new SimpleDateFormat("EEE MMM dd hh:mm:ss zzz yyyy", Locale.US);
formatter.setTimeZone(TimeZone.getTimeZone("GMT"));
return formatter.format(dateOfBirth);
}