@@ -21,7 +21,7 @@ func TestDependencyGraphService_CreateSnapshot(t *testing.T) {
21
21
22
22
mux .HandleFunc ("/repos/o/r/dependency-graph/snapshots" , func (w http.ResponseWriter , r * http.Request ) {
23
23
testMethod (t , r , "POST" )
24
- testBody (
t ,
r ,
`{"version":0,"sha":"ce587453ced02b1526dfb4cb910479d431683101","ref":"refs/heads/main","job":{"correlator":"yourworkflowname_youractionname","id":"yourrunid","html_url":"https://example.com"},"detector":{"name":"octo-detector","version":"0.0.1","url":"https://github.com/octo-org/octo-repo"},"scanned":"2022-06-14T20:25:00Z","manifests":{"package-lock.json":{"name":"package-lock.json","file":{"source_location":"src/package-lock.json"},"resolved":{"@actions/core":{"package_url":"pkg:/npm/%40actions/[email protected] ","relationship":"direct","scope":"runtime","dependencies":["@actions/http-client"]},"@actions/http-client":{"package_url":"pkg:/npm/%40actions/[email protected] ","relationship":"indirect","scope":"runtime","dependencies":["tunnel"]},"tunnel":{"package_url":"pkg:/npm/[email protected] ","relationship":"indirect","scope":"runtime"}}}}}` + "\n " )
24
+ testBody (
t ,
r ,
`{"version":0,"sha":"ce587453ced02b1526dfb4cb910479d431683101","ref":"refs/heads/main","job":{"correlator":"yourworkflowname_youractionname","id":"yourrunid","html_url":"https://example.com"},"detector":{"name":"octo-detector","version":"0.0.1","url":"https://github.com/octo-org/octo-repo"},"scanned":"2022-06-14T20:25:00Z","metadata":{"key1":"value1","key2":"value2"}," manifests":{"package-lock.json":{"name":"package-lock.json","file":{"source_location":"src/package-lock.json"},"resolved":{"@actions/core":{"package_url":"pkg:/npm/%40actions/[email protected] ","relationship":"direct","scope":"runtime","dependencies":["@actions/http-client"]},"@actions/http-client":{"package_url":"pkg:/npm/%40actions/[email protected] ","relationship":"indirect","scope":"runtime","dependencies":["tunnel"]},"tunnel":{"package_url":"pkg:/npm/[email protected] ","relationship":"indirect","scope":"runtime"}}}}}` + "\n " )
25
25
fmt .Fprint (w , `{"id":12345,"created_at":"2022-06-14T20:25:01Z","message":"Dependency results for the repo have been successfully updated.","result":"SUCCESS"}` )
26
26
})
27
27
@@ -41,6 +41,10 @@ func TestDependencyGraphService_CreateSnapshot(t *testing.T) {
41
41
URL : Ptr ("https://github.com/octo-org/octo-repo" ),
42
42
},
43
43
Scanned : & Timestamp {time .Date (2022 , time .June , 14 , 20 , 25 , 00 , 0 , time .UTC )},
44
+ Metadata : map [string ]any {
45
+ "key1" : "value1" ,
46
+ "key2" : "value2" ,
47
+ },
44
48
Manifests : map [string ]* DependencyGraphSnapshotManifest {
45
49
"package-lock.json" : {
46
50
Name : Ptr ("package-lock.json" ),
0 commit comments