This commit is contained in:
@@ -103,6 +103,15 @@ func TestDecodeAndResourcePrincipal(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestClaimDeviceRejectsDeviceIdentifierAsClaimCode(t *testing.T) {
|
||||
request := authenticatedRequest(http.MethodPost, "/api/v1/device-claims", `{"claim_code":"10000000-0000-0000-0000-000000000512","household_id":"10000000-0000-0000-0000-000000000211","subject_id":"10000000-0000-0000-0000-000000000411"}`, identity.Principal{Issuer: "test", Subject: "owner"})
|
||||
recorder := httptest.NewRecorder()
|
||||
ClaimDeviceHandler(nil).ServeHTTP(recorder, request)
|
||||
if recorder.Code != http.StatusBadRequest || !strings.Contains(recorder.Body.String(), "不能填写设备编号") {
|
||||
t.Fatalf("device identifier claim status=%d body=%s", recorder.Code, recorder.Body.String())
|
||||
}
|
||||
}
|
||||
|
||||
func TestSaaSErrorAndETagMapping(t *testing.T) {
|
||||
tests := []struct {
|
||||
err error
|
||||
|
||||
Reference in New Issue
Block a user