From 19cadb48ae3d1529d3f4001b13ac8fdc6c5c3a41 Mon Sep 17 00:00:00 2001 From: Owen Rumney Date: Fri, 10 Dec 2021 16:40:29 +0000 Subject: [PATCH] restructure propertybag --- example/go.mod | 1 + example/go.sum | 7 +--- v2/go.mod | 5 ++- v2/go.sum | 32 +++++++++++++++++-- v2/sarif/address.go | 2 +- v2/sarif/artifact.go | 3 +- v2/sarif/artifact_change.go | 2 +- v2/sarif/artifact_content.go | 2 +- v2/sarif/artifact_location.go | 2 +- v2/sarif/attachment.go | 2 +- v2/sarif/code_flow.go | 3 +- v2/sarif/configuration_override.go | 3 +- v2/sarif/conversion.go | 3 +- v2/sarif/edge.go | 3 +- v2/sarif/edge_traversal.go | 3 +- v2/sarif/exception.go | 3 +- v2/sarif/external_properties.go | 3 +- v2/sarif/external_property_file_reference.go | 3 +- v2/sarif/external_property_file_references.go | 3 +- v2/sarif/fix.go | 4 +-- v2/sarif/graph.go | 3 +- v2/sarif/graph_traversal.go | 3 +- v2/sarif/invocation.go | 10 +++++- v2/sarif/location.go | 2 +- v2/sarif/location_relationship.go | 2 +- v2/sarif/location_test.go | 2 +- v2/sarif/logical_location.go | 4 +-- v2/sarif/message.go | 12 +++---- v2/sarif/multi_format_message_string.go | 3 +- v2/sarif/node.go | 2 +- v2/sarif/notification.go | 2 +- v2/sarif/physical_location.go | 3 +- v2/sarif/rectangle.go | 5 +-- v2/sarif/region.go | 2 +- v2/sarif/replacement.go | 3 +- v2/sarif/reporting_configuration.go | 3 +- v2/sarif/run.go | 10 +++--- v2/sarif/run_automation_details.go | 2 +- v2/sarif/special_locations.go | 3 +- v2/sarif/stack.go | 5 ++- v2/sarif/stack_frame.go | 2 +- v2/sarif/suppression.go | 3 +- v2/sarif/thread_flow.go | 3 +- v2/sarif/thread_flow_location.go | 3 +- v2/sarif/tool.go | 3 +- v2/sarif/tool_component.go | 3 +- v2/sarif/tool_component_reference.go | 3 +- v2/sarif/translation_metadata.go | 2 +- v2/sarif/version_control_details.go | 2 +- v2/sarif/web_request.go | 3 +- v2/sarif/web_response.go | 3 +- v2/test/report_stage_test.go | 2 +- v2/test/run_test.go | 2 +- 53 files changed, 132 insertions(+), 72 deletions(-) diff --git a/example/go.mod b/example/go.mod index 2cf4049..2c4d1db 100644 --- a/example/go.mod +++ b/example/go.mod @@ -4,3 +4,4 @@ go 1.17 replace github.com/owenrumney/go-sarif/v2 => ../v2 +require github.com/owenrumney/go-sarif/v2 v2.0.0-00010101000000-000000000000 diff --git a/example/go.sum b/example/go.sum index 16969da..b380ae4 100644 --- a/example/go.sum +++ b/example/go.sum @@ -1,15 +1,10 @@ +github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= -github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= -github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= -github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/v2/go.mod b/v2/go.mod index 629e388..34ecb7f 100644 --- a/v2/go.mod +++ b/v2/go.mod @@ -2,4 +2,7 @@ module github.com/owenrumney/go-sarif/v2 go 1.16 -require github.com/stretchr/testify v1.7.0 +require ( + github.com/owenrumney/go-sarif v1.1.1 + github.com/stretchr/testify v1.7.0 +) diff --git a/v2/go.sum b/v2/go.sum index acb88a4..dbac08c 100644 --- a/v2/go.sum +++ b/v2/go.sum @@ -1,11 +1,39 @@ -github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= +github.com/apparentlymart/go-textseg/v13 v13.0.0/go.mod h1:ZK2fH7c4NqDTLtiYLvIkEghdlcqw7yxLeM89kiTRPUo= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/golang/protobuf v1.3.1/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U= +github.com/golang/protobuf v1.3.4/go.mod h1:vzj43D7+SQXF/4pzW/hwtAqwc6iTitCiVSaWz5lYuqw= +github.com/google/go-cmp v0.3.1 h1:Xye71clBPdm5HgqGwUkwhbynsUJZhDbS20FvLhQ2izg= +github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= +github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI= +github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= +github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= +github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= +github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= +github.com/owenrumney/go-sarif v1.1.1 h1:QNObu6YX1igyFKhdzd7vgzmw7XsWN3/6NMGuDzBgXmE= +github.com/owenrumney/go-sarif v1.1.1/go.mod h1:dNDiPlF04ESR/6fHlPyq7gHKmrM0sHUvAGjsoh8ZH0U= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.7.0 h1:nwc3DEeHmmLAfoZucVR881uASk0Mfjw8xYJ99tb5CcY= github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= +github.com/vmihailenco/msgpack/v4 v4.3.12/go.mod h1:gborTTJjAo/GWTqqRjrLCn9pgNN+NXzzngzBKDPIqw4= +github.com/vmihailenco/tagparser v0.1.1/go.mod h1:OeAg3pn3UbLjkWt+rN9oFYB6u/cQgqMEUPoW2WPyhdI= +github.com/zclconf/go-cty v1.10.0 h1:mp9ZXQeIcN8kAwuqorjH+Q+njbJKjLrvB2yIh4q7U+0= +github.com/zclconf/go-cty v1.10.0/go.mod h1:vVKLxnk3puL4qRAv72AO+W99LUD4da90g3uUAzyuvAk= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/net v0.0.0-20190603091049-60506f45cf65/go.mod h1:HSz+uSET+XFnRR8LxR5pz3Of3rY3CfYBVs4xY44aLks= +golang.org/x/net v0.0.0-20200301022130-244492dfa37a/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= +golang.org/x/text v0.3.5 h1:i6eZZ+zk0SOf0xgBpEpPD18qWcJda6q1sxt3S0kzyUQ= +golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY= +gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/v2/sarif/address.go b/v2/sarif/address.go index cdedcf2..ffa21be 100644 --- a/v2/sarif/address.go +++ b/v2/sarif/address.go @@ -2,7 +2,6 @@ package sarif // Address ... type Address struct { - PropertyBag Index *uint `json:"index,omitempty"` AbsoluteAddress *uint `json:"absoluteAddress,omitempty"` RelativeAddress *int `json:"relativeAddress,omitempty"` @@ -12,6 +11,7 @@ type Address struct { FullyQualifiedName *string `json:"fullyQualifiedName,omitempty"` Kind *string `json:"kind,omitempty"` ParentIndex *uint `json:"parentIndex,omitempty"` + PropertyBag } // NewAddress create a new Address and returns a pointer to it diff --git a/v2/sarif/artifact.go b/v2/sarif/artifact.go index 0ba661d..4649521 100644 --- a/v2/sarif/artifact.go +++ b/v2/sarif/artifact.go @@ -2,7 +2,7 @@ package sarif // Artifact ... type Artifact struct { - PropertyBag + Location *ArtifactLocation `json:"location,omitempty"` ParentIndex *uint `json:"parentIndex,omitempty"` Offset *uint `json:"offset,omitempty"` @@ -15,6 +15,7 @@ type Artifact struct { Hashes map[string]string `json:"hashes,omitempty"` LastModifiedTimeUtc *string `json:"lastModifiedTimeUtc,omitempty"` Description *Message `json:"description,omitempty"` + PropertyBag } // NewArtifact creates a new Artifact and returns a pointer to it diff --git a/v2/sarif/artifact_change.go b/v2/sarif/artifact_change.go index 3446103..d1666ce 100644 --- a/v2/sarif/artifact_change.go +++ b/v2/sarif/artifact_change.go @@ -2,9 +2,9 @@ package sarif // ArtifactChange ... type ArtifactChange struct { - PropertyBag ArtifactLocation ArtifactLocation `json:"artifactLocation"` Replacements []*Replacement `json:"replacements"` + PropertyBag } // NewArtifactChange creates a new ArtifactChange and returns a pointer to it diff --git a/v2/sarif/artifact_content.go b/v2/sarif/artifact_content.go index 6abb305..841013e 100644 --- a/v2/sarif/artifact_content.go +++ b/v2/sarif/artifact_content.go @@ -2,10 +2,10 @@ package sarif // ArtifactContent ... type ArtifactContent struct { - PropertyBag Text *string `json:"text,omitempty"` Binary *string `json:"binary,omitempty"` Rendered *MultiformatMessageString `json:"rendered,omitempty"` + PropertyBag } // NewArtifactContent creates a new ArtifactContent and returns a pointer to it diff --git a/v2/sarif/artifact_location.go b/v2/sarif/artifact_location.go index e8502ff..2715391 100644 --- a/v2/sarif/artifact_location.go +++ b/v2/sarif/artifact_location.go @@ -2,11 +2,11 @@ package sarif // ArtifactLocation ... type ArtifactLocation struct { - PropertyBag URI *string `json:"uri,omitempty"` URIBaseId *string `json:"uriBaseId,omitempty"` Index *uint `json:"index,omitempty"` Description *Message `json:"description,omitempty"` + PropertyBag } // NewArtifactLocation creates a new ArtifactLocation and returns a pointer to it diff --git a/v2/sarif/attachment.go b/v2/sarif/attachment.go index b5567ea..204f192 100644 --- a/v2/sarif/attachment.go +++ b/v2/sarif/attachment.go @@ -2,10 +2,10 @@ package sarif // Attachment ... type Attachment struct { - PropertyBag ArtifactLocation *ArtifactLocation `json:"artifactLocation,omitempty"` Description *Message `json:"description,omitempty"` Rectangles []*Rectangle `json:"rectangles,omitempty"` + PropertyBag } // NewAttachment creates a new Attachment and returns a pointer to it diff --git a/v2/sarif/code_flow.go b/v2/sarif/code_flow.go index aaf23d8..b3cec51 100644 --- a/v2/sarif/code_flow.go +++ b/v2/sarif/code_flow.go @@ -2,9 +2,10 @@ package sarif // CodeFlow ... type CodeFlow struct { - PropertyBag Message *Message `json:"message,omitempty"` ThreadFlows []*ThreadFlow `json:"threadFlows,omitempty"` + PropertyBag + } // NewCodeFlow creates a new CodeFlow and returns a pointer to it diff --git a/v2/sarif/configuration_override.go b/v2/sarif/configuration_override.go index 32a7cbb..19a5291 100644 --- a/v2/sarif/configuration_override.go +++ b/v2/sarif/configuration_override.go @@ -2,9 +2,10 @@ package sarif // ConfigurationOverride ... type ConfigurationOverride struct { - PropertyBag Configuration *ReportingConfiguration `json:"configuration,omitempty"` Descriptor *ReportingDescriptorReference `json:"descriptor,omitempty"` + PropertyBag + } // NewConfigurationOverride creates a new ConfigurationOverride and returns a pointer to it diff --git a/v2/sarif/conversion.go b/v2/sarif/conversion.go index 857382b..8a095d9 100644 --- a/v2/sarif/conversion.go +++ b/v2/sarif/conversion.go @@ -2,10 +2,11 @@ package sarif // Conversion ... type Conversion struct { - PropertyBag AnalysisToolLogFiles []*ArtifactLocation `json:"analysisToolLogFiles,omitempty"` Invocation *Invocation `json:"invocation,omitempty"` Tool *Tool `json:"tool"` + PropertyBag + } // NewConversion creates a new Conversion and returns a pointer to it diff --git a/v2/sarif/edge.go b/v2/sarif/edge.go index 63b1d2c..4de5dcc 100644 --- a/v2/sarif/edge.go +++ b/v2/sarif/edge.go @@ -2,11 +2,12 @@ package sarif // Edge ... type Edge struct { - PropertyBag ID string `json:"id"` Label *Message `json:"label,omitempty"` SourceNodeID string `json:"sourceNodeId"` TargetNodeID string `json:"targetNodeId"` + PropertyBag + } // NewEdge creates a new Edge and returns a pointer to it diff --git a/v2/sarif/edge_traversal.go b/v2/sarif/edge_traversal.go index 02a7ec0..9a75258 100644 --- a/v2/sarif/edge_traversal.go +++ b/v2/sarif/edge_traversal.go @@ -2,11 +2,12 @@ package sarif // EdgeTraversal ... type EdgeTraversal struct { - PropertyBag EdgeID string `json:"edgeId"` FinalState map[string]*MultiformatMessageString `json:"finalState,omitempty"` Message *Message `json:"message,omitempty"` StepOverEdgeCount *int `json:"stepOverEdgeCount,omitempty"` + PropertyBag + } // NewEdgeTraversal creates a new EdgeTraversal and returns a pointer to it diff --git a/v2/sarif/exception.go b/v2/sarif/exception.go index 89d3b4d..e817384 100644 --- a/v2/sarif/exception.go +++ b/v2/sarif/exception.go @@ -2,11 +2,12 @@ package sarif // Exception ... type Exception struct { - PropertyBag InnerExceptions []*Exception `json:"innerExceptions,omitempty"` Kind *string `json:"kind,omitempty"` Message *string `json:"message,omitempty"` Stack *Stack `json:"stack,omitempty"` + PropertyBag + } // NewException creates a new Exception and returns a pointer to it diff --git a/v2/sarif/external_properties.go b/v2/sarif/external_properties.go index 654e59c..291e966 100644 --- a/v2/sarif/external_properties.go +++ b/v2/sarif/external_properties.go @@ -2,7 +2,6 @@ package sarif // ExternalProperties ... type ExternalProperties struct { - PropertyBag Addresses []*Address `json:"addresses,omitempty"` Artifacts []*Artifact `json:"artifacts,omitempty"` Conversion *Conversion `json:"conversion,omitempty"` @@ -23,6 +22,8 @@ type ExternalProperties struct { Version string `json:"version,omitempty"` WebRequests []*WebRequest `json:"webRequests,omitempty"` WebResponses []*WebResponse `json:"webResponses,omitempty"` + PropertyBag + } // NewExternalProperties creates a new ExternalProperties and returns a pointer to it diff --git a/v2/sarif/external_property_file_reference.go b/v2/sarif/external_property_file_reference.go index cfb73f8..765d9e3 100644 --- a/v2/sarif/external_property_file_reference.go +++ b/v2/sarif/external_property_file_reference.go @@ -2,10 +2,11 @@ package sarif // ExternalPropertyFileReference ... type ExternalPropertyFileReference struct { - PropertyBag GUID *string `json:"guid,omitempty"` ItemCount *int `json:"itemCount,omitempty"` Location *ArtifactLocation `json:"location,omitempty"` + PropertyBag + } // NewExternalPropertyFileReference creates a new ExternalPropertyFileReference and returns a pointer to it diff --git a/v2/sarif/external_property_file_references.go b/v2/sarif/external_property_file_references.go index ee3f8a0..d0c010e 100644 --- a/v2/sarif/external_property_file_references.go +++ b/v2/sarif/external_property_file_references.go @@ -2,7 +2,6 @@ package sarif // ExternalPropertyFileReferences ... type ExternalPropertyFileReferences struct { - PropertyBag Addresses []*ExternalPropertyFileReference `json:"addresses,omitempty"` Artifacts []*ExternalPropertyFileReference `json:"artifacts,omitempty"` Conversion *ExternalPropertyFileReference `json:"conversion,omitempty"` @@ -20,6 +19,8 @@ type ExternalPropertyFileReferences struct { Translations []*ExternalPropertyFileReference `json:"translations,omitempty"` WebRequests []*ExternalPropertyFileReference `json:"webRequests,omitempty"` WebResponses []*ExternalPropertyFileReference `json:"webResponses,omitempty"` + PropertyBag + } // NewExternalPropertyFileReferences creates a new ExternalPropertyFileReferences and returns a pointer to it diff --git a/v2/sarif/fix.go b/v2/sarif/fix.go index 93ad563..c986e9b 100644 --- a/v2/sarif/fix.go +++ b/v2/sarif/fix.go @@ -2,9 +2,9 @@ package sarif // Fix ... type Fix struct { - PropertyBag Description *Message `json:"description,omitempty"` - ArtifactChanges []*ArtifactChange `json:"artifactChanges"` // required + ArtifactChanges []*ArtifactChange `json:"artifactChanges"` + PropertyBag } // NewFix creates a new Fix and returns a pointer to it diff --git a/v2/sarif/graph.go b/v2/sarif/graph.go index 3f51ea9..72d7e30 100644 --- a/v2/sarif/graph.go +++ b/v2/sarif/graph.go @@ -2,10 +2,11 @@ package sarif // Graph ... type Graph struct { - PropertyBag Description *Message `json:"description,omitempty"` Edges []*Edge `json:"edges,omitempty"` Nodes []*Node `json:"nodes,omitempty"` + PropertyBag + } // NewGraph creates a new Graph and returns a pointer to it diff --git a/v2/sarif/graph_traversal.go b/v2/sarif/graph_traversal.go index 9903721..63ff292 100644 --- a/v2/sarif/graph_traversal.go +++ b/v2/sarif/graph_traversal.go @@ -2,13 +2,14 @@ package sarif // GraphTraversal ... type GraphTraversal struct { - PropertyBag Description *Message `json:"description,omitempty"` EdgeTraversals []*EdgeTraversal `json:"edgeTraversals,omitempty"` ImmutableState map[string]*MultiformatMessageString `json:"immutableState,omitempty"` InitialState map[string]*MultiformatMessageString `json:"initialState,omitempty"` ResultGraphIndex *int `json:"resultGraphIndex,omitempty"` RunGraphIndex *int `json:"runGraphIndex,omitempty"` + PropertyBag + } // NewGraphTraversal creates a new GraphTraversal and returns a pointer to it diff --git a/v2/sarif/invocation.go b/v2/sarif/invocation.go index 1228d99..92eee61 100644 --- a/v2/sarif/invocation.go +++ b/v2/sarif/invocation.go @@ -4,7 +4,6 @@ import "time" // Invocation describes the runtime environment of the analysis tool run. type Invocation struct { - PropertyBag Account *string `json:"account,omitempty"` Arguments []string `json:"arguments,omitempty"` CommandLine *string `json:"commandLine,omitempty"` @@ -30,6 +29,7 @@ type Invocation struct { ToolConfigurationNotifications []*Notification `json:"toolConfigurationNotifications,omitempty"` ToolExecutionNotifications []*Notification `json:"toolExecutionNotifications,omitempty"` WorkingDirectory *ArtifactLocation `json:"workingDirectory,omitempty"` + PropertyBag } // NewInvocation creates a new Invocation and returns a pointer to it @@ -83,31 +83,37 @@ func (invocation *Invocation) WithExecutableLocation(executableLocation *Artifac invocation.ExecutableLocation = executableLocation return invocation } + // WithExecutionSuccess sets the ExecutionSuccess func (invocation *Invocation) WithExecutionSuccess(executionSuccessful bool) *Invocation { invocation.ExecutionSuccessful = &executionSuccessful return invocation } + // WithExitCode sets the ExitCode func (invocation *Invocation) WithExitCode(exitCode int) *Invocation { invocation.ExitCode = &exitCode return invocation } + // WithExitCodeDescription sets the ExitCodeDescription func (invocation *Invocation) WithExitCodeDescription(exitCodeDescription string) *Invocation { invocation.ExitCodeDescription = &exitCodeDescription return invocation } + // WithExitSignalNumber sets the ExitSignalNumber func (invocation *Invocation) WithExitSignalNumber(exitSignalNumber int) *Invocation { invocation.ExitSignalNumber = &exitSignalNumber return invocation } + // WithExitSignalName sets the ExitSignalName func (invocation *Invocation) WithExitSignalName(exitSignalName string) *Invocation { invocation.ExitSignalName = &exitSignalName return invocation } + // WithMachine sets the Machine func (invocation *Invocation) WithMachine(machine string) *Invocation { invocation.Machine = &machine @@ -131,6 +137,7 @@ func (invocation *Invocation) WithProcessID(processID int) *Invocation { return invocation } + // WithProcessStartFailureMessage sets the ProcessStartFailureMessage func (invocation *Invocation) WithProcessStartFailureMessage(failureMessage string) *Invocation { invocation.ProcessStartFailureMessage = &failureMessage @@ -183,6 +190,7 @@ func (invocation *Invocation) WithStdout(stdOut *ArtifactLocation) *Invocation { invocation.Stdout = stdOut return invocation } + // WithStdoutStderr sets the StdoutStderr func (invocation *Invocation) WithStdoutStderr(stdoutStderr *ArtifactLocation) *Invocation { invocation.StdoutStderr = stdoutStderr diff --git a/v2/sarif/location.go b/v2/sarif/location.go index df8c7af..ac3909d 100644 --- a/v2/sarif/location.go +++ b/v2/sarif/location.go @@ -2,13 +2,13 @@ package sarif // Location ... type Location struct { - PropertyBag Id *uint `json:"id,omitempty"` PhysicalLocation *PhysicalLocation `json:"physicalLocation,omitempty"` LogicalLocations []*LogicalLocation `json:"logicalLocations,omitempty"` Message *Message `json:"message,omitempty"` Annotations []*Region `json:"annotations,omitempty"` Relationships []*LocationRelationship `json:"relationships,omitempty"` + PropertyBag } // NewLocation creates a new Location and returns a pointer to it diff --git a/v2/sarif/location_relationship.go b/v2/sarif/location_relationship.go index 38baf7a..bd5e2bf 100644 --- a/v2/sarif/location_relationship.go +++ b/v2/sarif/location_relationship.go @@ -2,10 +2,10 @@ package sarif // LocationRelationship ... type LocationRelationship struct { - PropertyBag Target uint `json:"target"` Kinds []string `json:"kinds,omitempty"` Description *Message `json:"description,omitempty"` + PropertyBag } // NewLocationRelationship creates a new LocationRelationship and returns a pointer to it diff --git a/v2/sarif/location_test.go b/v2/sarif/location_test.go index f80fa6e..3165a98 100644 --- a/v2/sarif/location_test.go +++ b/v2/sarif/location_test.go @@ -11,7 +11,7 @@ func Test_create_simple_location(t *testing.T) { WithId(1). WithMessage( NewMessage(). - WithId("messageId1"). + WithID("messageId1"). WithText("message text")). WithAnnotations( []*Region{NewRegion().WithByteLength(10)}, diff --git a/v2/sarif/logical_location.go b/v2/sarif/logical_location.go index afe90db..b8f0b9f 100644 --- a/v2/sarif/logical_location.go +++ b/v2/sarif/logical_location.go @@ -1,14 +1,14 @@ package sarif // LogicalLocation ... -type LogicalLocation struct { - PropertyBag +type LogicalLocation struct { Index *uint `json:"index,omitempty"` Name *string `json:"name,omitempty"` FullyQualifiedName *string `json:"fullyQualifiedName,omitempty"` DecoratedName *string `json:"decoratedName,omitempty"` Kind *string `json:"kind,omitempty"` ParentIndex *uint `json:"parentIndex,omitempty"` + PropertyBag } // NewLogicalLocation creates a new LogicalLocation and returns a pointer to it diff --git a/v2/sarif/message.go b/v2/sarif/message.go index 0c3ee94..141e3d7 100644 --- a/v2/sarif/message.go +++ b/v2/sarif/message.go @@ -1,12 +1,12 @@ package sarif // Message ... -type Message struct { - PropertyBag +type Message struct { Text *string `json:"text,omitempty"` Markdown *string `json:"markdown,omitempty"` - Id *string `json:"id,omitempty"` + ID *string `json:"id,omitempty"` Arguments []string `json:"arguments,omitempty"` + PropertyBag } // NewMessage creates a new Message and returns a pointer to it @@ -36,9 +36,9 @@ func (message *Message) WithMarkdown(markdown string) *Message { return message } -// WithId sets the Id -func (message *Message) WithId(id string) *Message { - message.Id = &id +// WithId sets the ID +func (message *Message) WithID(id string) *Message { + message.ID = &id return message } diff --git a/v2/sarif/multi_format_message_string.go b/v2/sarif/multi_format_message_string.go index 6191d64..9366ee9 100644 --- a/v2/sarif/multi_format_message_string.go +++ b/v2/sarif/multi_format_message_string.go @@ -2,9 +2,9 @@ package sarif // MultiformatMessageString ... type MultiformatMessageString struct { - PropertyBag Text *string `json:"text,omitempty"` Markdown *string `json:"markdown,omitempty"` + PropertyBag } // NewMarkdownMultiformatMessageString creates a new MarkdownMultiformatMessageString and returns a pointer to it @@ -26,6 +26,7 @@ func (multiFormatMessageString *MultiformatMessageString) WithText(text string) multiFormatMessageString.Text = &text return multiFormatMessageString } + // WithMarkdown sets the Markdown func (multiFormatMessageString *MultiformatMessageString) WithMarkdown(markdown string) *MultiformatMessageString { multiFormatMessageString.Markdown = &markdown diff --git a/v2/sarif/node.go b/v2/sarif/node.go index 20c5d5f..617a975 100644 --- a/v2/sarif/node.go +++ b/v2/sarif/node.go @@ -2,11 +2,11 @@ package sarif // Node ... type Node struct { - PropertyBag Children []*Node `json:"children,omitempty"` ID string `json:"id"` Label *Message `json:"label,omitempty"` Location *Location `json:"location,omitempty"` + PropertyBag } // NewNode creates a new Node and returns a pointer to it diff --git a/v2/sarif/notification.go b/v2/sarif/notification.go index 0cf5cf9..2394792 100644 --- a/v2/sarif/notification.go +++ b/v2/sarif/notification.go @@ -4,7 +4,6 @@ import "time" // Notification ... type Notification struct { - PropertyBag AssociatedRule *ReportingDescriptorReference `json:"associatedRule,omitempty"` Descriptor *ReportingDescriptorReference `json:"descriptor,omitempty"` Exception *Exception `json:"exception,omitempty"` @@ -13,6 +12,7 @@ type Notification struct { Message *Message `json:"message"` ThreadID *int `json:"threadId,omitempty"` TimeUTC *time.Time `json:"timeUtc,omitempty"` + PropertyBag } // NewNotification creates a new Notification and returns a pointer to it diff --git a/v2/sarif/physical_location.go b/v2/sarif/physical_location.go index 838e555..3ebb31f 100644 --- a/v2/sarif/physical_location.go +++ b/v2/sarif/physical_location.go @@ -2,11 +2,11 @@ package sarif // PhysicalLocation ... type PhysicalLocation struct { - PropertyBag ArtifactLocation *ArtifactLocation `json:"artifactLocation,omitempty"` Region *Region `json:"region,omitempty"` ContextRegion *Region `json:"contextRegion,omitempty"` Address *Address `json:"address,omitempty"` + PropertyBag } // NewPhysicalLocation creates a new PhysicalLocation and returns a pointer to it @@ -25,6 +25,7 @@ func (pl *PhysicalLocation) WithRegion(region *Region) *PhysicalLocation { pl.Region = region return pl } + // WithContextRegion sets the ContextRegion func (pl *PhysicalLocation) WithContextRegion(contextRegion *Region) *PhysicalLocation { pl.ContextRegion = contextRegion diff --git a/v2/sarif/rectangle.go b/v2/sarif/rectangle.go index dcd3934..d664da2 100644 --- a/v2/sarif/rectangle.go +++ b/v2/sarif/rectangle.go @@ -2,12 +2,13 @@ package sarif // Rectangle ... type Rectangle struct { - PropertyBag Bottom *float64 `json:"bottom,omitempty"` Left *float64 `json:"left,omitempty"` - Message *Message `json:"message,omitempty"` Right *float64 `json:"right,omitempty"` Top *float64 `json:"top,omitempty"` + Message *Message `json:"message,omitempty"` + PropertyBag + } // NewRectangle creates a new Rectangle and returns a pointer to it diff --git a/v2/sarif/region.go b/v2/sarif/region.go index 3e64183..69e0965 100644 --- a/v2/sarif/region.go +++ b/v2/sarif/region.go @@ -2,7 +2,6 @@ package sarif // Region ... type Region struct { - PropertyBag StartLine *int `json:"startLine,omitempty"` StartColumn *int `json:"startColumn,omitempty"` EndLine *int `json:"endLine,omitempty"` @@ -14,6 +13,7 @@ type Region struct { Snippet *ArtifactContent `json:"snippet,omitempty"` Message *Message `json:"message,omitempty"` SourceLanguage *string `json:"sourceLanguage,omitempty"` + PropertyBag } // NewRegion creates a new Region and returns a pointer to it diff --git a/v2/sarif/replacement.go b/v2/sarif/replacement.go index 682dc80..209474c 100644 --- a/v2/sarif/replacement.go +++ b/v2/sarif/replacement.go @@ -2,9 +2,10 @@ package sarif // Replacement ... type Replacement struct { - PropertyBag DeletedRegion Region `json:"deletedRegion"` InsertedContent *ArtifactContent `json:"insertedContent,omitempty"` + PropertyBag + } // NewReplacement creates a new Replacement and returns a pointer to it diff --git a/v2/sarif/reporting_configuration.go b/v2/sarif/reporting_configuration.go index 4561269..ce32a1a 100644 --- a/v2/sarif/reporting_configuration.go +++ b/v2/sarif/reporting_configuration.go @@ -2,11 +2,12 @@ package sarif // ReportingConfiguration ... type ReportingConfiguration struct { - PropertyBag Enabled *bool `json:"enabled,omitempty"` Level string `json:"level,omitempty"` Parameters *PropertyBag `json:"parameters,omitempty"` Rank *float64 `json:"rank,omitempty"` + PropertyBag + } // NewReportingConfiguration creates a new ReportingConfiguration and returns a pointer to it diff --git a/v2/sarif/run.go b/v2/sarif/run.go index f4cb8c0..c2aefea 100644 --- a/v2/sarif/run.go +++ b/v2/sarif/run.go @@ -12,10 +12,12 @@ const IncludeEmptyResults RunOption = iota // Run type represents a run of a tool type Run struct { - PropertyBag + Tool Tool `json:"tool"` + Artifacts []*Artifact `json:"artifacts,omitempty"` + Invocations []*Invocation `json:"invocations,omitempty"` + LogicalLocations []*LogicalLocation `json:"logicalLocations,omitempty"` Results []*Result `json:"results"` Addresses []*Address `json:"addresses,omitempty"` - Artifacts []*Artifact `json:"artifacts,omitempty"` AutomationDetails *RunAutomationDetails `json:"automationDetails,omitempty"` BaselineGUID *string `json:"baselineGuid,omitempty"` ColumnKind interface{} `json:"columnKind,omitempty"` @@ -24,9 +26,7 @@ type Run struct { DefaultSourceLanguage *string `json:"defaultSourceLanguage,omitempty"` ExternalPropertyFileReferences *ExternalPropertyFileReferences `json:"externalPropertyFileReferences,omitempty"` Graphs []*Graph `json:"graphs,omitempty"` - Invocations []*Invocation `json:"invocations,omitempty"` Language *string `json:"language,omitempty"` - LogicalLocations []*LogicalLocation `json:"logicalLocations,omitempty"` NewlineSequences []string `json:"newlineSequences,omitempty"` OriginalUriBaseIDs map[string]*ArtifactLocation `json:"originalUriBaseIds,omitempty"` Policies []*ToolComponent `json:"policies,omitempty"` @@ -35,11 +35,11 @@ type Run struct { SpecialLocations *SpecialLocations `json:"specialLocations,omitempty"` Taxonomies []*ToolComponent `json:"taxonomies,omitempty"` ThreadFlowLocations []*ThreadFlowLocation `json:"threadFlowLocations,omitempty"` - Tool Tool `json:"tool"` Translations []*ToolComponent `json:"translations,omitempty"` VersionControlProvenance []*VersionControlDetails `json:"versionControlProvenance,omitempty"` WebRequests []*WebRequest `json:"webRequests,omitempty"` WebResponses []*WebResponse `json:"webResponses,omitempty"` + PropertyBag } // NewRun creates a new Run and returns a pointer to it diff --git a/v2/sarif/run_automation_details.go b/v2/sarif/run_automation_details.go index bff0943..6f10591 100644 --- a/v2/sarif/run_automation_details.go +++ b/v2/sarif/run_automation_details.go @@ -2,11 +2,11 @@ package sarif // RunAutomationDetails ... type RunAutomationDetails struct { - PropertyBag CorrelationGUID *string `json:"correlationGuid,omitempty"` Description *Message `json:"description,omitempty"` GUID *string `json:"guid,omitempty"` ID *string `json:"id,omitempty"` + PropertyBag } // NewRunAutomationDetails ... diff --git a/v2/sarif/special_locations.go b/v2/sarif/special_locations.go index 73a92e6..33e15ea 100644 --- a/v2/sarif/special_locations.go +++ b/v2/sarif/special_locations.go @@ -2,8 +2,9 @@ package sarif // SpecialLocations ... type SpecialLocations struct { - PropertyBag DisplayBase *ArtifactLocation `json:"displayBase,omitempty"` + PropertyBag + } // NewSpecialLocations ... diff --git a/v2/sarif/stack.go b/v2/sarif/stack.go index 20f7c7b..2dda258 100644 --- a/v2/sarif/stack.go +++ b/v2/sarif/stack.go @@ -2,10 +2,9 @@ package sarif // Stack ... type Stack struct { + Frames []*StackFrame `json:"frames"` + Message *Message `json:"message,omitempty"` PropertyBag - Frames []*StackFrame `json:"frames"` - Message *Message `json:"message,omitempty"` - Properties *PropertyBag `json:"properties,omitempty"` } // NewStack creates a new Stack and returns a pointer to it diff --git a/v2/sarif/stack_frame.go b/v2/sarif/stack_frame.go index b1bda53..033a331 100644 --- a/v2/sarif/stack_frame.go +++ b/v2/sarif/stack_frame.go @@ -2,11 +2,11 @@ package sarif // StackFrame ... type StackFrame struct { - PropertyBag Location *Location `json:"location,omitempty"` Module *string `json:"module,omitempty"` Parameters []string `json:"parameters,omitempty"` ThreadID *int `json:"threadId,omitempty"` + PropertyBag } // NewStackFrame creates a new StackFrame and returns a pointer to it diff --git a/v2/sarif/suppression.go b/v2/sarif/suppression.go index 68c3a50..858ca61 100644 --- a/v2/sarif/suppression.go +++ b/v2/sarif/suppression.go @@ -2,12 +2,13 @@ package sarif // Suppression ... type Suppression struct { - PropertyBag Kind string `json:"kind"` Status *string `json:"status"` Location *Location `json:"location"` Guid *string `json:"guid"` Justification *string `json:"justification"` + PropertyBag + } // NewSuppression creates a new Suppression and returns a pointer to it diff --git a/v2/sarif/thread_flow.go b/v2/sarif/thread_flow.go index f51bb49..37878e7 100644 --- a/v2/sarif/thread_flow.go +++ b/v2/sarif/thread_flow.go @@ -2,12 +2,13 @@ package sarif // ThreadFlow ... type ThreadFlow struct { - PropertyBag ID *string `json:"id,omitempty"` ImmutableState map[string]*MultiformatMessageString `json:"immutableState,omitempty"` InitialState map[string]*MultiformatMessageString `json:"initialState,omitempty"` Locations []*ThreadFlowLocation `json:"locations"` Message *Message `json:"message,omitempty"` + PropertyBag + } // NewThreadFlow creates a new ThreadFlow and returns a pointer to it diff --git a/v2/sarif/thread_flow_location.go b/v2/sarif/thread_flow_location.go index 1b7d27e..66bf6f2 100644 --- a/v2/sarif/thread_flow_location.go +++ b/v2/sarif/thread_flow_location.go @@ -4,7 +4,6 @@ import "time" // ThreadFlowLocation ... type ThreadFlowLocation struct { - PropertyBag ExecutionOrder *int `json:"executionOrder,omitempty"` ExecutionTimeUTC *time.Time `json:"executionTimeUtc,omitempty"` Importance interface{} `json:"importance,omitempty"` @@ -18,6 +17,8 @@ type ThreadFlowLocation struct { Taxa []*ReportingDescriptorReference `json:"taxa,omitempty"` WebRequest *WebRequest `json:"webRequest,omitempty"` WebResponse *WebResponse `json:"webResponse,omitempty"` + PropertyBag + } // NewThreadFlowLocation creates a new ThreadFlowLocation and returns a pointer to it diff --git a/v2/sarif/tool.go b/v2/sarif/tool.go index b6be259..b269584 100644 --- a/v2/sarif/tool.go +++ b/v2/sarif/tool.go @@ -2,8 +2,9 @@ package sarif // Tool ... type Tool struct { - PropertyBag Driver *ToolComponent `json:"driver"` + PropertyBag + } // NewTool creates a new Tool and returns a pointer to it diff --git a/v2/sarif/tool_component.go b/v2/sarif/tool_component.go index 15a6aa2..59a07b4 100644 --- a/v2/sarif/tool_component.go +++ b/v2/sarif/tool_component.go @@ -2,13 +2,14 @@ package sarif // ToolComponent ... type ToolComponent struct { - PropertyBag Name string `json:"name"` Version *string `json:"version,omitempty"` InformationURI *string `json:"informationUri"` Notifications []*ReportingDescriptor `json:"notifications,omitempty"` Rules []*ReportingDescriptor `json:"rules,omitempty"` Taxa []*ReportingDescriptor `json:"taxa,omitempty"` + PropertyBag + } // NewDriver creates a new Driver and returns a pointer to it diff --git a/v2/sarif/tool_component_reference.go b/v2/sarif/tool_component_reference.go index 8ef3b2e..ac984a6 100644 --- a/v2/sarif/tool_component_reference.go +++ b/v2/sarif/tool_component_reference.go @@ -2,10 +2,11 @@ package sarif // ToolComponentReference ... type ToolComponentReference struct { - PropertyBag Name *string `json:"name"` Index *uint `json:"index"` Guid *string `json:"guid"` + PropertyBag + } // NewToolComponentReference creates a new ToolComponentReference and returns a pointer to it diff --git a/v2/sarif/translation_metadata.go b/v2/sarif/translation_metadata.go index c304be5..82b9c4e 100644 --- a/v2/sarif/translation_metadata.go +++ b/v2/sarif/translation_metadata.go @@ -2,13 +2,13 @@ package sarif // TranslationMetadata ... type TranslationMetadata struct { - PropertyBag DownloadURI *string `json:"downloadUri,omitempty"` FullDescription *MultiformatMessageString `json:"fullDescription,omitempty"` FullName *string `json:"fullName,omitempty"` InformationURI *string `json:"informationUri,omitempty"` Name *string `json:"name"` ShortDescription *MultiformatMessageString `json:"shortDescription,omitempty"` + PropertyBag } // NewTranslationMetadata creates a new TranslationMetadata and returns a pointer to it diff --git a/v2/sarif/version_control_details.go b/v2/sarif/version_control_details.go index 4dbed9e..a4a2884 100644 --- a/v2/sarif/version_control_details.go +++ b/v2/sarif/version_control_details.go @@ -4,13 +4,13 @@ import "time" // VersionControlDetails ... type VersionControlDetails struct { - PropertyBag AsOfTimeUTC *time.Time `json:"asOfTimeUtc,omitempty"` Branch *string `json:"branch,omitempty"` MappedTo *ArtifactLocation `json:"mappedTo,omitempty"` RepositoryURI *string `json:"repositoryUri"` RevisionID *string `json:"revisionId,omitempty"` RevisionTag *string `json:"revisionTag,omitempty"` + PropertyBag } // NewVersionControlDetails creates a new VersionControlDetails and returns a pointer to it diff --git a/v2/sarif/web_request.go b/v2/sarif/web_request.go index 8a14274..93214d3 100644 --- a/v2/sarif/web_request.go +++ b/v2/sarif/web_request.go @@ -2,7 +2,6 @@ package sarif // WebRequest ... type WebRequest struct { - PropertyBag Body *ArtifactContent `json:"body,omitempty"` Headers map[string]string `json:"headers,omitempty"` Index *int `json:"index,omitempty"` @@ -11,6 +10,8 @@ type WebRequest struct { Protocol *string `json:"protocol,omitempty"` Target *string `json:"target,omitempty"` Version *string `json:"version,omitempty"` + PropertyBag + } // NewWebRequest creates a new WebRequest and returns a pointer to it diff --git a/v2/sarif/web_response.go b/v2/sarif/web_response.go index 98bbc53..466ea35 100644 --- a/v2/sarif/web_response.go +++ b/v2/sarif/web_response.go @@ -2,7 +2,6 @@ package sarif // WebResponse ... type WebResponse struct { - PropertyBag Body *ArtifactContent `json:"body,omitempty"` Headers map[string]string `json:"headers,omitempty"` Index *int `json:"index,omitempty"` @@ -11,6 +10,7 @@ type WebResponse struct { ReasonPhrase *string `json:"reasonPhrase,omitempty"` StatusCode *int `json:"statusCode,omitempty"` Version *string `json:"version,omitempty"` + PropertyBag } // NewWebResponse creates a new WebResponse and returns a pointer to it @@ -58,6 +58,7 @@ func (webResponse *WebResponse) WithReasonPhrase(reason string) *WebResponse { webResponse.ReasonPhrase = &reason return webResponse } + // WithStatusCode sets the StatusCode func (webResponse *WebResponse) WithStatusCode(statusCode int) *WebResponse { webResponse.StatusCode = &statusCode diff --git a/v2/test/report_stage_test.go b/v2/test/report_stage_test.go index 013e4cc..8cc6188 100644 --- a/v2/test/report_stage_test.go +++ b/v2/test/report_stage_test.go @@ -4,7 +4,7 @@ import ( "bytes" "testing" - "github.com/owenrumney/go-sarif/v2/sarif" + "github.com/owenrumney/go-sarif/sarif" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" ) diff --git a/v2/test/run_test.go b/v2/test/run_test.go index 6ded48c..7d80191 100644 --- a/v2/test/run_test.go +++ b/v2/test/run_test.go @@ -11,7 +11,7 @@ func Test_new_result_on_run(t *testing.T) { func Test_properties_on_a_run(t *testing.T) { given, when, then := newRunTest(t) - expected := `{"properties":{"boolean_key":false,"string_key":"string_value"},"results":[],"tool":{"driver":null}}` + expected := `{"tool":{"driver":null},"results":[],"properties":{"boolean_key":false,"string_key":"string_value"}}` given.properties_added_to_a_run() when.the_run_is_json()