From a7748a360ebf3c759a919fea2a17d511513b3cb2 Mon Sep 17 00:00:00 2001 From: Matt Moyer Date: Fri, 24 Jul 2020 10:46:40 -0500 Subject: [PATCH] Extend integration tests to check new LoginRequest API semantics. Signed-off-by: Ryan Richard Signed-off-by: Matt Moyer --- test/integration/loginrequest_test.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test/integration/loginrequest_test.go b/test/integration/loginrequest_test.go index 5a3aefd9..e3b7f86b 100644 --- a/test/integration/loginrequest_test.go +++ b/test/integration/loginrequest_test.go @@ -53,6 +53,10 @@ func TestSuccessfulLoginRequest(t *testing.T) { require.Empty(t, response.Status.Credential.ClientCertificateData) require.Empty(t, response.Status.Credential.ClientKeyData) require.Nil(t, response.Status.Credential.ExpirationTimestamp) + + require.NotNil(t, response.Status.User) + require.NotEmpty(t, response.Status.User.Name) + require.Contains(t, response.Status.User.Groups, "tmc:member") } func TestFailedLoginRequestWhenTheRequestIsValidButTheTokenDoesNotAuthenticateTheUser(t *testing.T) { @@ -65,6 +69,7 @@ func TestFailedLoginRequestWhenTheRequestIsValidButTheTokenDoesNotAuthenticateTh require.Empty(t, response.Spec) require.Nil(t, response.Status.Credential) + require.Nil(t, response.Status.User) require.Equal(t, "authentication failed", response.Status.Message) }