优化结构
This commit is contained in:
@@ -96,3 +96,14 @@ func TestIntegrationConfigTestDoesNotPersistCandidate(t *testing.T) {
|
||||
t.Fatalf("tested values = %#v", values)
|
||||
}
|
||||
}
|
||||
|
||||
func TestIntegrationConfigRejectsJSONNull(t *testing.T) {
|
||||
repo := &integrationConfigRepoTestDouble{}
|
||||
usecase := NewIntegrationConfigUsecase(repo, &integrationConnectionTesterDouble{})
|
||||
if err := usecase.Save(context.Background(), &IntegrationConfig{Kind: IntegrationKindMQ, Provider: "emqx", Values: json.RawMessage("null")}); err == nil {
|
||||
t.Fatal("Save() accepted JSON null as an object")
|
||||
}
|
||||
if err := usecase.Test(context.Background(), &IntegrationConfig{Kind: IntegrationKindMQ, Provider: "emqx", Values: json.RawMessage("null")}); err == nil {
|
||||
t.Fatal("Test() accepted JSON null as an object")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user