Datastore validator (#565)

* add datastore validator; adapt mock and tests

* adapt bolt datastore to common validator

* adapt postgres datastore to validator

* adapt redis datastore to common validator
This commit is contained in:
Jordan Krage
2017-03-02 16:43:53 -06:00
committed by Travis Reeder
parent 5803886a06
commit 06171800e2
11 changed files with 306 additions and 325 deletions

View File

@@ -40,16 +40,16 @@ func testRouterAsync(ds models.Datastore, mq models.MessageQueue, rnr *runner.Ru
func TestRouteRunnerAsyncExecution(t *testing.T) {
tasks := mockTasksConduit()
ds := &datastore.Mock{
Apps: []*models.App{
ds := datastore.NewMockInit(
[]*models.App{
{Name: "myapp", Config: map[string]string{"app": "true"}},
},
Routes: []*models.Route{
[]*models.Route{
{Type: "async", Path: "/myroute", AppName: "myapp", Image: "iron/hello", Config: map[string]string{"test": "true"}},
{Type: "async", Path: "/myerror", AppName: "myapp", Image: "iron/error", Config: map[string]string{"test": "true"}},
{Type: "async", Path: "/myroute/:param", AppName: "myapp", Image: "iron/hello", Config: map[string]string{"test": "true"}},
},
}
)
mq := &mqs.Mock{}
for i, test := range []struct {