package org.opentrafficsim.road.mock;
import org.mockito.Mockito;
import org.opentrafficsim.core.dsol.OTSSimulatorInterface;
import org.opentrafficsim.core.gtu.GTU;
/**
* MockGTU.java.
*
* Copyright (c) 2003-2022 Delft University of Technology, Jaffalaan 5, 2628 BX Delft, the Netherlands. All rights reserved. See
* for project information www.simulation.tudelft.nl. The
* source code and binary code of this software is proprietary information of Delft University of Technology.
* @author Alexander Verbraeck
*/
public class MockGTU
{
/** mocked GTU. */
private GTU mockGTU;
/** name. */
private String name;
/** mocked simulator. */
private OTSSimulatorInterface simulator = MockDEVSSimulator.createMock();
/**
* @param name the name
*/
public MockGTU(final String name)
{
this.name = name;
this.mockGTU = Mockito.mock(GTU.class);
Mockito.when(this.mockGTU.getSimulator()).thenReturn(this.simulator);
Mockito.when(this.mockGTU.getId()).thenReturn(this.name);
}
/**
* @return mocked DEVSSimulator
*/
public GTU getMock()
{
return this.mockGTU;
}
}