(t *testing.T)
| 142 | } |
| 143 | |
| 144 | func TestService_ProcessComponentVSA(t *testing.T) { |
| 145 | ctx := context.Background() |
| 146 | fs := afero.NewMemMapFs() |
| 147 | |
| 148 | // Create test data |
| 149 | report := applicationsnapshot.Report{ |
| 150 | Success: true, |
| 151 | Policy: ecc.EnterpriseContractPolicySpec{}, |
| 152 | } |
| 153 | |
| 154 | comp := applicationsnapshot.Component{ |
| 155 | SnapshotComponent: app.SnapshotComponent{ |
| 156 | Name: "test-component", |
| 157 | ContainerImage: "quay.io/test/image:tag", |
| 158 | }, |
| 159 | Success: true, |
| 160 | Violations: []evaluator.Result{}, |
| 161 | Warnings: []evaluator.Result{}, |
| 162 | Successes: []evaluator.Result{{Message: "test success"}}, |
| 163 | } |
| 164 | |
| 165 | // Create test signer |
| 166 | signer := testSigner("/test.key", fs) |
| 167 | service := NewServiceWithFS(signer, fs, "https://github.com/test/policy", nil, "vsa-") |
| 168 | |
| 169 | // Test successful processing |
| 170 | envelopePath, err := service.ProcessComponentVSA(ctx, report, comp, "https://github.com/test/repo", "sha256:testdigest") |
| 171 | |
| 172 | assert.NoError(t, err) |
| 173 | assert.NotEmpty(t, envelopePath) |
| 174 | assert.Contains(t, envelopePath, ".intoto.jsonl") |
| 175 | } |
| 176 | |
| 177 | func TestService_ProcessSnapshotVSA(t *testing.T) { |
| 178 | ctx := context.Background() |
nothing calls this directly
no test coverage detected