RegisterResponse extends JsonSerializable implements Persistable { public static RegisterResponse fromJson(String json) throws U2fBadInputException { checkArgument(json.length() < MAX_SIZE, "Client response bigger than allowed"); return JsonSerializable.fromJson(json, RegisterResponse.class); } @JsonCreator  RegisterResponse(@JsonProperty("registrationData") String registrationData, @JsonProperty("clientData") String clientData); String getRegistrationData(); @JsonIgnore ClientData getClientData(); String getRequestId(); static RegisterResponse fromJson(String json);  }
@Test(expected = IllegalArgumentException.class) public void fromJsonDetectsTooLongJsonContent() throws U2fBadInputException { RegisterResponse.fromJson(makeLongJson(20000)); fail("fromJson did not detect too long JSON content."); }
@Test public void fromJsonAllowsShortJsonContent() throws U2fBadInputException { assertNotNull(RegisterResponse.fromJson(makeLongJson(19999))); }