Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
import org.cloudfoundry.uaa.users.UserId;
import org.cloudfoundry.uaa.users.VerifyUserRequest;
import org.cloudfoundry.uaa.users.VerifyUserResponse;
import org.cloudfoundry.uaa.users.PhoneNumber;
import org.junit.Test;
import reactor.test.StepVerifier;

Expand Down Expand Up @@ -120,6 +121,9 @@ public void create() {
.value("ZO6FEI@test.org")
.primary(true)
.build())
.phoneNumber(PhoneNumber.builder()
.value("5555555555")
.build())
.active(true)
.verified(true)
.origin("")
Expand All @@ -143,6 +147,9 @@ public void create() {
.value("ZO6FEI@test.org")
.primary(false)
.build())
.phoneNumber(PhoneNumber.builder()
.value("5555555555")
.build())
.group(Group.builder()
.value("4622c5e1-ddfd-4e17-9e81-2ae3c03972be")
.display("password.write")
Expand Down Expand Up @@ -606,6 +613,9 @@ public void update() {
.primary(false)
.value("oH4jON@test.org")
.build())
.phoneNumber(PhoneNumber.builder()
.value("5555555555")
.build())
.externalId("test-user")
.id(("test-user-id"))
.version("*")
Expand Down Expand Up @@ -640,6 +650,9 @@ public void update() {
.primary(false)
.value("oH4jON@test.org")
.build())
.phoneNumber(PhoneNumber.builder()
.value("5555555555")
.build())
.externalId("test-user")
.group(Group.builder()
.display("password.write")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@
"primary": true
}
],
"phoneNumbers": [
{
"value": "5555555555"
}
],
"active": true,
"verified": true,
"origin": "",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@
"primary": false
}
],
"phoneNumbers": [
{
"value": "5555555555"
}
],
"groups": [
{
"value": "4622c5e1-ddfd-4e17-9e81-2ae3c03972be",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@
"primary": false
}
],
"phoneNumbers": [
{
"value": "5555555555"
}
],
"externalId": "test-user",
"name": {
"familyName": "family name",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@
"primary": false
}
],
"phoneNumbers": [
{
"value": "5555555555"
}
],
"externalId": "test-user",
"groups": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,4 +88,10 @@ public abstract class AbstractUserSummary extends AbstractUserId {
@JsonProperty("zoneId")
public abstract String getZoneId();

/**
* The phone numbers for the user
*/
@JsonProperty("phoneNumbers")
public abstract List<PhoneNumber> getPhoneNumbers();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fields should be in alphabetical order


}
Original file line number Diff line number Diff line change
Expand Up @@ -92,4 +92,11 @@ void check() {
@Nullable
abstract Boolean getVerified();

/**
* The phone number
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be plural

*/
@JsonProperty("phoneNumbers")
@Nullable
abstract List<PhoneNumber> getPhoneNumbers();

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/*
* Copyright 2013-2017 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

package org.cloudfoundry.uaa.users;

import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import org.immutables.value.Value;

/**
* The email addresses for a user
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy/paste error (my speciality!)

*/
@JsonDeserialize
@Value.Immutable
abstract class _PhoneNumber {

/**
* The phone number
*/
@JsonProperty("value")
abstract String getValue();

}
Original file line number Diff line number Diff line change
Expand Up @@ -102,4 +102,10 @@ void check() {
@Nullable
abstract Boolean getVerified();

/**
* The phone numbers for the user
*/
@JsonProperty("phoneNumbers")
abstract List<PhoneNumber> getPhoneNumbers();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fields should be in alphabetical order (alt-cmd-L will fix that)


}