I cloned existing project, where are some unit tests in JUnit-4.12. These tests are launched after every push to remote depository and they will end successfuly, but when I run them on my local machine in eclipse, they will end with ComparisonFailure.
org.junit.ComparisonFailure expected:<xy> but was:<xy>
With this error will end every test, where I'm trying to compare sent json with existing json file.
Test:
@Test
public void calculateSignedCasesView() throws JsonProcessingException {
Case case1 = prepareCase();
getEm().persist(case1);
SignedCasesViewFilter filter = new SignedCasesViewFilter(new LinkedHashSet<String>(Arrays.asList("testCode")), new Date(0), new Date(0));
SignedCasesView view = reportService.calculateSignedCasesView(filter);
String actual = getObjectMapper().writeValueAsString(view);
String expected = readToString("signedCasesReportView01.json");
Assert.assertEquals(expected, actual);
}
When I look on result, there are highlighted initial spaces of every row.
I tried copy this result to MS Word to look, if there aren't any non-breaking spaces (discussed here), but all spaces are ordinary. Or I tried to run tests with different encoding, but nothing works.