package com.github.keaume.amigo.service;

import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;

import com.github.keaume.amigo.obd.ObdConnectionState;
import timber.log.Timber;

public class MockObdService extends AbstractObdService {

    @Override
    protected ObdConnectionState _startObdConnection() {
        Timber.d("_startObdConnection called");
        setObdConnectionInputStream(new ByteArrayInputStream("41 00 00 00>41 00 00 00>41 00 00 00>".getBytes()));
        setObdConnectionOutputStream(new ByteArrayOutputStream());
        return ObdConnectionState.CONNECTED;
    }

    @Override
    protected ObdConnectionState _stopObdConnection() {
        Timber.d("_stopObdConnection called");
        setObdConnectionInputStream(null);
        setObdConnectionOutputStream(null);
        return ObdConnectionState.DISCONNECTED;
    }

    @Override
    protected boolean isSocketConnected() {
        return true;
    }
}

Create MockObdService.java