diff --git a/test/unittest/capability/openc2/openc2_test.go b/test/unittest/capability/openc2/openc2_test.go index 8e17e529..5930f327 100644 --- a/test/unittest/capability/openc2/openc2_test.go +++ b/test/unittest/capability/openc2/openc2_test.go @@ -13,18 +13,22 @@ import ( "github.com/google/uuid" ) -func TestHTTPOptionsCorrectlyGenerated(t *testing.T) { +func TestOpenC2Request(t *testing.T) { mockHttp := &mockRequest.MockHttpRequest{} openc2 := openc2.New(mockHttp) - authId := "6ba7b810-9dad-11d1-80b4-00c04fd430c9" + authId, _ := uuid.Parse("6aa7b810-9dad-11d1-81b4-00c04fd430c8") + executionId, _ := uuid.Parse("6ba7b810-9dad-11d1-80b4-00c04fd430c8") + playbookId, _ := uuid.Parse("d09351a2-a075-40c8-8054-0b7c423db83f") + stepId, _ := uuid.Parse("81eff59f-d084-4324-9e0a-59e353dbd28f") + target := cacao.AgentTarget{ HttpUrl: "https://soarca.tno.nl", - AuthInfoIdentifier: authId, + AuthInfoIdentifier: authId.String(), } auth := cacao.AuthenticationInformation{ - ID: authId, + ID: authId.String(), Type: "oauth2", Token: "this-is-a-test", } @@ -41,10 +45,6 @@ func TestHTTPOptionsCorrectlyGenerated(t *testing.T) { Value: "", } - executionId, _ := uuid.Parse("6ba7b810-9dad-11d1-80b4-00c04fd430c8") - playbookId, _ := uuid.Parse("d09351a2-a075-40c8-8054-0b7c423db83f") - stepId, _ := uuid.Parse("81eff59f-d084-4324-9e0a-59e353dbd28f") - metadata := execution.Metadata{ ExecutionId: executionId, PlaybookId: playbookId.String(), @@ -75,6 +75,4 @@ func TestHTTPOptionsCorrectlyGenerated(t *testing.T) { } t.Log(results) assert.Equal(t, results["__soarca_openc2_result__"].Value, payload) - - // mockHttp.AssertExpectations(t) }