package broker

import (
	"bytes"
	"io"
	"io/ioutil"
	"local/truckstop/config"
	"os"
	"path"
)

type NTGVisionMock struct{}

func NewNTGVisionMock() NTGVisionMock {
	return NTGVisionMock{}
}

func (ntgm NTGVisionMock) searchStates(states []config.State) (io.ReadCloser, error) {
	path := path.Join(os.Getenv("GOPATH"), "src", "local", "truckstop", "broker", "testdata", "ntgvision_response.json")
	b, err := ioutil.ReadFile(path)
	return io.NopCloser(bytes.NewReader(b)), err
}

func (ntgm NTGVisionMock) searchJobReadCloser(id int64) (io.ReadCloser, error) {
	path := path.Join(os.Getenv("GOPATH"), "src", "local", "truckstop", "broker", "testdata", "ntgvision_jobinfo_response.json")
	b, err := ioutil.ReadFile(path)
	return io.NopCloser(bytes.NewReader(b)), err
}
