You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// TestExtractOIDCFromReading tests the extractOIDCFromReading function.
130
+
funcTestExtractOIDCFromReading(t*testing.T) {
131
+
typetestCasestruct {
132
+
namestring
133
+
reading*api.DataReading
134
+
expectedSnapshot dataupload.Snapshot
135
+
expectErrorstring
136
+
}
137
+
tests:= []testCase{
138
+
{
139
+
name: "nil reading",
140
+
expectError: `programmer mistake: the DataReading must not be nil`,
141
+
},
142
+
{
143
+
name: "nil data",
144
+
reading: &api.DataReading{
145
+
DataGatherer: "ark/oidc",
146
+
Data: nil,
147
+
},
148
+
expectError: `programmer mistake: the DataReading must have data type *api.OIDCDiscoveryData. This DataReading (ark/oidc) has data type <nil>`,
149
+
},
150
+
{
151
+
name: "wrong data type",
152
+
reading: &api.DataReading{
153
+
DataGatherer: "ark/oidc",
154
+
Data: &api.DiscoveryData{},
155
+
},
156
+
expectError: `programmer mistake: the DataReading must have data type *api.OIDCDiscoveryData. This DataReading (ark/oidc) has data type *api.DiscoveryData`,
0 commit comments