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