Skip to content

Commit 4f41ee9

Browse files
committed
Check what happens when email is nil
1 parent df3f360 commit 4f41ee9

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

client_test.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ func TestEnroll(t *testing.T) {
5050
hostID := "foobar"
5151
hostName := "foo host"
5252
hostIP := "192.168.100.1"
53-
oidcEmail := "[email protected]"
5453
counter := uint(5)
5554
ca, _ := dnapitest.NebulaCACert()
5655
caPEM, err := ca.MarshalToPEM()
@@ -94,7 +93,7 @@ func TestEnroll(t *testing.T) {
9493
IPAddress: hostIP,
9594
},
9695
EndpointOIDCMeta: &message.HostEndpointOIDCMetadata{
97-
Email: &oidcEmail,
96+
Email: nil,
9897
},
9998
},
10099
})
@@ -143,7 +142,7 @@ func TestEnroll(t *testing.T) {
143142
assert.Equal(t, hostID, meta.Host.ID)
144143
assert.Equal(t, hostName, meta.Host.Name)
145144
assert.Equal(t, hostIP, meta.Host.IPAddress)
146-
assert.Equal(t, oidcEmail, *meta.EndpointOIDC.Email)
145+
assert.Nil(t, *meta.EndpointOIDC.Email)
147146

148147
// Test error handling
149148
errorMsg := "invalid enrollment code"

0 commit comments

Comments
 (0)