mirror of
https://github.com/pomerium/pomerium.git
synced 2025-05-20 20:47:16 +02:00
envoyconfig: move most bootstrap config to shared package (#2088)
This commit is contained in:
parent
c12c0aab49
commit
f760cdece5
9 changed files with 314 additions and 156 deletions
|
@ -23,10 +23,17 @@ func AssertProtoJSONEqual(t *testing.T, expected string, protoMsg interface{}, m
|
|||
protoMsgs = append(protoMsgs, toProtoJSON(protoMsgVal.Index(i).Interface()))
|
||||
}
|
||||
bs, _ := json.Marshal(protoMsgs)
|
||||
return assert.JSONEq(t, expected, string(bs), msgAndArgs...)
|
||||
return assert.Equal(t, reformatJSON(json.RawMessage(expected)), reformatJSON(bs), msgAndArgs...)
|
||||
}
|
||||
|
||||
return assert.JSONEq(t, expected, string(toProtoJSON(protoMsg)), msgAndArgs...)
|
||||
return assert.Equal(t, reformatJSON(json.RawMessage(expected)), reformatJSON(toProtoJSON(protoMsg)), msgAndArgs...)
|
||||
}
|
||||
|
||||
func reformatJSON(raw json.RawMessage) string {
|
||||
var obj interface{}
|
||||
_ = json.Unmarshal(raw, &obj)
|
||||
bs, _ := json.MarshalIndent(obj, "", " ")
|
||||
return string(bs)
|
||||
}
|
||||
|
||||
func toProtoJSON(protoMsg interface{}) json.RawMessage {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue