1 package org.opentrafficsim.core.mock;
2
3 import org.mockito.Mockito;
4 import org.opentrafficsim.core.gtu.GTU;
5
6 import nl.tudelft.simulation.dsol.simulators.DEVSSimulatorInterface;
7
8
9
10
11
12
13
14
15
16 public class MockGTU
17 {
18
19 private GTU mockGTU;
20
21
22 private String name;
23
24
25 private DEVSSimulatorInterface.TimeDoubleUnit simulator = MockDEVSSimulator.createMock();
26
27
28
29
30 public MockGTU(final String name)
31 {
32 super();
33 this.name = name;
34 this.mockGTU = Mockito.mock(GTU.class);
35 Mockito.when(this.mockGTU.getSimulator()).thenReturn(this.simulator);
36 Mockito.when(this.mockGTU.getId()).thenReturn(this.name);
37 }
38
39
40
41
42 public GTU getMock()
43 {
44 return this.mockGTU;
45 }
46
47 }