parse ntg jobs and strigify them
This commit is contained in:
22
broker/ntgvision_mock.go
Normal file
22
broker/ntgvision_mock.go
Normal file
@@ -0,0 +1,22 @@
|
||||
package broker
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"local/truckstop/config"
|
||||
"os"
|
||||
"path"
|
||||
)
|
||||
|
||||
type NTGVisionMock struct{}
|
||||
|
||||
func NewNTGVisionMock() NTGVisionMock {
|
||||
return NTGVisionMock{}
|
||||
}
|
||||
|
||||
func (ntgm NTGVisionMock) search(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
|
||||
}
|
||||
Reference in New Issue
Block a user