Adds the failing unit tests for keycloak's provider on the moved path: a grant-file consumer not moved should still be made and never held for retirement, and the moved harness should read MESH_RECEIVES as the grant path does. All three fail on an assertion against today's code, which wants nothing from the grant file on this path.
20 lines
982 B
Go
20 lines
982 B
Go
package main
|
|
|
|
// What main wires for the moved path (novox/hq issue 1332): the harness it builds from the environment, the same
|
|
// way the grant path reads its own settings.
|
|
|
|
import "testing"
|
|
|
|
// 1332/AC3: the moved-path harness, built from the environment, reads MESH_RECEIVES the way the grant path does
|
|
// (main.go's other branch, line 67), as postgres's moved harness does (postgres-provider/main.go:43).
|
|
func TestTheMovedPathHarnessReadsMESH_RECEIVESAsTheGrantPathDoes(t *testing.T) {
|
|
env := map[string]string{"MESH_RECEIVES": "/grants/mesh.json", "MESH_NODE": "novox"}
|
|
getenv := func(k string) string { return env[k] }
|
|
h := movedHarness(getenv, provisioner{})
|
|
if h.Receives != env["MESH_RECEIVES"] {
|
|
t.Fatalf("Receives = %q, want %q — the grant file still gives every consumer not moved (issue 937), "+
|
|
"read exactly as MESH_RECEIVES on the grant path, as postgres's moved harness does "+
|
|
"(postgres-provider/main.go:43)", h.Receives, env["MESH_RECEIVES"])
|
|
}
|
|
}
|