FederatedUserInfo extends DefaultUserInfo { @Override public JsonObject toJson() { JsonObject obj = super.toJson(); addProperty(obj, this.schacHomeOrganization, "schac_home_organization"); addProperty(obj, this.schacHomeOrganizationType, "schac_home_organization_type"); addProperty(obj, this.eduPersonPrincipalName, "edu_person_principal_name"); addProperty(obj, this.eduPersonTargetedId, "edu_person_targeted_id"); addListProperty(obj, this.eduPersonAffiliations, "edu_person_affiliations"); addListProperty(obj, this.eduPersonScopedAffiliations, "edu_person_scoped_affiliations"); addListProperty(obj, this.isMemberOfs, "edumember_is_member_of"); addListProperty(obj, this.eduPersonEntitlements, "eduperson_entitlement"); addListProperty(obj, this.schacPersonalUniqueCodes, "schac_personal_unique_codes"); addListProperty(obj, this.uids, "uids"); return obj; }  @Basic @Column(name = "schac_home_organization") String getSchacHomeOrganization(); void setSchacHomeOrganization(String schacHomeOrganization); @Basic @Column(name = "unspecified_name_id") String getUnspecifiedNameId(); void setUnspecifiedNameId(String unspecifiedNameId); @Basic @Column(name = "authenticating_authority") String getAuthenticatingAuthority(); void setAuthenticatingAuthority(String authenticatingAuthority); @Basic @Column(name = "schac_home_organization_type") String getSchacHomeOrganizationType(); void setSchacHomeOrganizationType(String schacHomeOrganizationType); @Basic @Column(name = "edu_person_principal_name") String getEduPersonPrincipalName(); void setEduPersonPrincipalName(String eduPersonPrincipalName); @Basic @Column(name = "edu_person_targeted_id") String getEduPersonTargetedId(); void setEduPersonTargetedId(String eduPersonTargetedId); @ElementCollection(fetch = FetchType.EAGER) @CollectionTable( name = "user_edu_person_affiliation", joinColumns = @JoinColumn(name = "user_id") ) @Column(name = "edu_person_affiliation") Set<String> getEduPersonAffiliations(); void setEduPersonAffiliations(Set<String> eduPersonAffiliations); @ElementCollection(fetch = FetchType.EAGER) @CollectionTable( name = "user_edu_person_scoped_affiliation", joinColumns = @JoinColumn(name = "user_id") ) @Column(name = "edu_person_scoped_affiliation") Set<String> getEduPersonScopedAffiliations(); void setEduPersonScopedAffiliations(Set<String> eduPersonScopedAffiliations); @ElementCollection(fetch = FetchType.EAGER) @CollectionTable( name = "user_is_member_of", joinColumns = @JoinColumn(name = "user_id") ) @Column(name = "is_member_of") @JsonProperty("edumember_is_member_of") Set<String> getIsMemberOfs(); void setIsMemberOfs(Set<String> isMemberOfs); @ElementCollection(fetch = FetchType.EAGER) @CollectionTable( name = "user_edu_person_entitlement", joinColumns = @JoinColumn(name = "user_id") ) @Column(name = "edu_person_entitlement") @JsonProperty("eduperson_entitlement") Set<String> getEduPersonEntitlements(); void setEduPersonEntitlements(Set<String> eduPersonEntitlements); @ElementCollection(fetch = FetchType.EAGER) @CollectionTable( name = "user_schac_personal_unique_code", joinColumns = @JoinColumn(name = "user_id") ) @Column(name = "schac_personal_unique_code") Set<String> getSchacPersonalUniqueCodes(); void setSchacPersonalUniqueCodes(Set<String> schacPersonalUniqueCodes); @ElementCollection(fetch = FetchType.EAGER) @CollectionTable( name = "user_uid", joinColumns = @JoinColumn(name = "user_id") ) @Column(name = "uid") Set<String> getUids(); void setUids(Set<String> uids); @Override JsonObject toJson(); @Override String toString(); String hashed();  }
@Test public void testFromJson() throws IOException { JsonObject jsonObject = federatedUserInfo.toJson(); assertJsonObject(jsonObject); }