File tree Expand file tree Collapse file tree
app/artifact-cas/internal/service Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -119,10 +119,10 @@ func TestAuditDispatcherDispatch(t *testing.T) {
119119 // must never panic nor return an error
120120 tc .dispatcher .Dispatch (tc .entry , tc .claims )
121121
122- fake , ok := publisherAsFake (tc .dispatcher )
123- if ! ok {
122+ if tc .dispatcher == nil || tc .dispatcher .publisher == nil {
124123 return
125124 }
125+ fake := tc .dispatcher .publisher .(* fakePublisher )
126126
127127 require .Len (t , fake .published , tc .wantPublished )
128128 if tc .wantPublished == 0 {
@@ -161,15 +161,6 @@ func TestAuditDispatcherShouldEmit(t *testing.T) {
161161 }
162162}
163163
164- func publisherAsFake (d * AuditDispatcher ) (* fakePublisher , bool ) {
165- if d == nil || d .publisher == nil {
166- return nil , false
167- }
168-
169- fake , ok := d .publisher .(* fakePublisher )
170- return fake , ok
171- }
172-
173164// artifactEventInfo mirrors the action info payload of CAS artifact events for assertions
174165type artifactEventInfo struct {
175166 Digest string `json:"digest"`
You can’t perform that action at this time.
0 commit comments