File tree 2 files changed +25
-6
lines changed
main/java/org/zendesk/client/v2/model
test/java/org/zendesk/client/v2 2 files changed +25
-6
lines changed Original file line number Diff line number Diff line change @@ -105,4 +105,19 @@ public Date getUpdatedAt() {
105
105
public void setUpdatedAt (Date updatedAt ) {
106
106
this .updatedAt = updatedAt ;
107
107
}
108
+
109
+ @ Override
110
+ public String toString () {
111
+ return "Identity{" +
112
+ "id=" + id +
113
+ ", url='" + url + '\'' +
114
+ ", userId=" + userId +
115
+ ", type='" + type + '\'' +
116
+ ", value='" + value + '\'' +
117
+ ", verified=" + verified +
118
+ ", primary=" + primary +
119
+ ", createdAt=" + createdAt +
120
+ ", updatedAt=" + updatedAt +
121
+ '}' ;
122
+ }
108
123
}
Original file line number Diff line number Diff line change @@ -375,14 +375,18 @@ public void updateUserIdentity() throws Exception {
375
375
identity .setValue ("first@test.com" );
376
376
377
377
Identity createdIdentity = instance .createUserIdentity (user , identity );
378
- assertThat (createdIdentity .getValue (), is ("first@test.com" ));
379
-
380
- createdIdentity .setValue ("second@test.com" );
381
- Identity updatedIdentity = instance .updateUserIdentity (user , createdIdentity );
378
+ try {
379
+ assertThat (createdIdentity .getValue (), is ("first@test.com" ));
382
380
383
- assertThat (updatedIdentity .getValue (), is ("second@test.com" ));
381
+ createdIdentity .setValue ("second@test.com" );
382
+ Identity updatedIdentity = instance .updateUserIdentity (user , createdIdentity );
384
383
385
- instance .deleteUserIdentity (user , identity );
384
+ assertThat (updatedIdentity .getValue (), is ("second@test.com" ));
385
+ } finally {
386
+ if (createdIdentity != null ) {
387
+ instance .deleteUserIdentity (user , createdIdentity .getId ());
388
+ }
389
+ }
386
390
}
387
391
388
392
@ Test
You can’t perform that action at this time.
0 commit comments