(t *testing.T)
| 176 | } |
| 177 | |
| 178 | func TestSerializeRole(t *testing.T) { |
| 179 | |
| 180 | ctx := base.TestCtx(t) |
| 181 | bucket := base.GetTestBucket(t) |
| 182 | defer bucket.Close(ctx) |
| 183 | dataStore := bucket.GetSingleDataStore() |
| 184 | auth := NewTestAuthenticator(t, dataStore, nil, DefaultAuthenticatorOptions(ctx)) |
| 185 | role, _ := auth.NewRole("froods", ch.BaseSetOf(t, "hoopy", "public")) |
| 186 | encoded := base.MustJSONMarshal(t, role) |
| 187 | require.NotNil(t, encoded) |
| 188 | log.Printf("Marshaled Role as: %s", encoded) |
| 189 | elor := &roleImpl{} |
| 190 | require.NoError(t, base.JSONUnmarshal(encoded, elor)) |
| 191 | |
| 192 | assert.Equal(t, role.Name(), elor.Name()) |
| 193 | assert.Equal(t, role.ExplicitChannels(), elor.ExplicitChannels()) |
| 194 | } |
| 195 | |
| 196 | func TestUserAccess(t *testing.T) { |
| 197 |
nothing calls this directly
no test coverage detected