I am using this dependencies:
<dependencies>
<!-- Testing -->
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-all</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-all</artifactId>
<version>1.3</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<exclusions>
<exclusion>
<artifactId>hamcrest-core</artifactId>
<groupId>org.hamcrest</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>1.9.5</version>
<exclusions>
<exclusion>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-core</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
</dependencyManagement>
however, using the function like:
List<String> output = ..;
List<String> data = ...;
Assert.assertThat(output, Matchers.containsInAnyOrder(data));
Results in error. WHat is the right way to fix hamcrest so the function actually works? I tried to find out correct dependency management and found the configuration mentioned above.
The errro i recieve is assertion error, if i compare two same lists but with shuffled values, it does not pass but fails
Example:
List<String> output = Arrays.asList(
"text1\t1",
"text2\t1",
"text3\t1",
"text4\t1",
"text5\t1",
"text6\t1",
"text7\t1",
"text8\t1",
"text9\t1",
"text10\t1"
);
List<String> output1 = Arrays.asList(
"text2\t1",
"text3\t1",
"text4\t1",
"text5\t1",
"text6\t1",
"text7\t1",
"text8\t1",
"text9\t1",
"text10\t1",
"text1\t1"
);
Assert.assertThat(output, Matchers.containsInAnyOrder(output1));