aboutsummaryrefslogtreecommitdiff
path: root/test/org/traccar/processing/PopulateDriverTest.java
blob: 7c6ee9f069efaf242973acf8f0c10bfb4c585213 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
package org.traccar.processing;

import org.junit.Assert;
import org.junit.Test;
import org.traccar.model.Position;

public class PopulateDriverTest {

    @Test
    public void testPopulateDriver() {
        Position position = new Position();
        PopulateDriverHandler populateDriverHandler = new PopulateDriverHandler();
        Assert.assertNull(populateDriverHandler.handlePosition(position).getString(Position.KEY_DRIVER_UNIQUE_ID));
        position.set(Position.KEY_DRIVER_UNIQUE_ID, "123");
        Assert.assertEquals("123",
                populateDriverHandler.handlePosition(position).getString(Position.KEY_DRIVER_UNIQUE_ID));
        position.set(Position.KEY_RFID, "321");
        Assert.assertEquals("321",
                populateDriverHandler.handlePosition(position).getString(Position.KEY_DRIVER_UNIQUE_ID));
    }
}