Insist trigger sources are prefixed (#1184)

* Insist trigger sources are prefixed

All trigger sources must have a '/' prefix to be allowed into the datastore.

* Adding condition to novelValue for gen tests

NovelValue was failing to detect same Config values correctly. This
adds a specific check for Config, like the one for Annotation, to
ensure a novel value is indeed generated.
This commit is contained in:
Tom Coupland
2018-08-23 12:24:56 +01:00
committed by GitHub
parent df94333cf4
commit fc3f54d2da
5 changed files with 32 additions and 15 deletions

View File

@@ -44,8 +44,8 @@ func TestTriggerListJsonMarshalling(t *testing.T) {
}
}
var httpTrigger = &Trigger{Name: "name", AppID: "foo", FnID: "bar", Type: "http", Source: "baz"}
var invalidTrigger = &Trigger{Name: "name", AppID: "foo", FnID: "bar", Type: "error", Source: "baz"}
var httpTrigger = &Trigger{Name: "name", AppID: "foo", FnID: "bar", Type: "http", Source: "/baz"}
var invalidTrigger = &Trigger{Name: "name", AppID: "foo", FnID: "bar", Type: "error", Source: "/baz"}
var triggerValidateCases = []struct {
val *Trigger