Skip to content
Snippets Groups Projects
Commit 641aea5c authored by Tim van der Horst's avatar Tim van der Horst
Browse files

Add Mockito.eq static method to check for equality in mocks

parent 86aa6de2
No related branches found
No related tags found
2 merge requests!78Master merge,!73Add Mockito.eq static method to check for equality in mocks
Pipeline #175518 passed
......@@ -14,7 +14,6 @@ import nl.tudelft.ewi.auta.core.response.exception.NoResultsException;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.mockito.InjectMocks;
import org.mockito.Matchers;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.MockitoAnnotations;
......@@ -31,6 +30,7 @@ import java.util.Set;
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.AdditionalMatchers.not;
import static org.mockito.ArgumentMatchers.eq;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.request;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath;
......@@ -70,13 +70,13 @@ public class BenchmarkingControllerTest {
);
Mockito.when(this.repository.findExisting("aid", "sid"))
Mockito.when(this.repository.findExisting(eq("aid"), eq("sid")))
.thenReturn(new EntityContainer(this.projectEntity, "sid", false, null, "aid"));
Mockito.when(this.repository.findExisting(not(Matchers.eq("aid")),
Mockito.when(this.repository.findExisting(not(eq("aid")),
Mockito.anyString())).thenThrow(new NoResultsException());
Mockito.when(this.repository.findExisting(Mockito.anyString(),
not(Matchers.eq("sid")))).thenThrow(new NoResultsException());
not(eq("sid")))).thenThrow(new NoResultsException());
Mockito.when(this.benchmarker.aggregate(Mockito.any(), Mockito.any(), Mockito.any()))
.thenReturn(Map.of(1, 0.75, 10, 0.25));
......
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment