MCPcopy
hub / github.com/ory/hydra / testHelperUpdateClient

Function testHelperUpdateClient

client/manager_test_helpers.go:81–102  ·  view source on GitHub ↗
(t *testing.T, ctx context.Context, store Storage, toUpdate *Client)

Source from the content-addressed store, hash-verified

79}
80
81func testHelperUpdateClient(t *testing.T, ctx context.Context, store Storage, toUpdate *Client) {
82 require.NoError(t, store.UpdateClient(ctx, &Client{
83 ID: toUpdate.ID,
84 Name: "name-new",
85 Secret: "secret-new",
86 RedirectURIs: []string{"http://redirect/new"},
87 TermsOfServiceURI: "bar",
88 JSONWebKeys: new(x.JoseJSONWebKeySet),
89 }))
90
91 nc, err := store.GetConcreteClient(ctx, toUpdate.ID)
92 require.NoError(t, err)
93
94 require.NotZero(t, toUpdate.GetHashedSecret())
95 require.NotZero(t, nc.GetHashedSecret())
96 assert.NotEqual(t, toUpdate.GetHashedSecret(), nc.GetHashedSecret(), "ensure that the secret hash was updated")
97
98 assert.Equal(t, "bar", nc.TermsOfServiceURI)
99 assert.Equal(t, "name-new", nc.Name)
100 assert.Equal(t, []string{"http://redirect/new"}, nc.GetRedirectURIs())
101 assert.Len(t, nc.Contacts, 0)
102}
103
104func TestHelperCreateGetUpdateDeleteClientNext(t *testing.T, m Storage, networks []uuid.UUID) {
105 ctx := context.Background()

Callers 1

Calls 5

UpdateClientMethod · 0.65
GetConcreteClientMethod · 0.65
GetHashedSecretMethod · 0.65
GetRedirectURIsMethod · 0.65
LenMethod · 0.65

Tested by 1