File tree Expand file tree Collapse file tree 2 files changed +12
-9
lines changed
main/java/org/cloudfoundry/client/v3
test/java/org/cloudfoundry/client/v3 Expand file tree Collapse file tree 2 files changed +12
-9
lines changed Original file line number Diff line number Diff line change 1818
1919import com .fasterxml .jackson .annotation .JsonProperty ;
2020import com .fasterxml .jackson .databind .annotation .JsonDeserialize ;
21+ import org .cloudfoundry .Nullable ;
2122import org .immutables .value .Value ;
2223
2324/**
@@ -31,6 +32,7 @@ abstract class _Relationship {
3132 * The id
3233 */
3334 @ JsonProperty ("guid" )
35+ @ Nullable
3436 abstract String getId ();
3537
3638}
Original file line number Diff line number Diff line change 1616
1717package org .cloudfoundry .client .v3 ;
1818
19- import static org .junit .jupiter .api .Assertions .assertThrows ;
20-
2119import org .junit .jupiter .api .Test ;
2220
21+ import static org .assertj .core .api .Assertions .assertThat ;
22+
2323final class RelationshipTest {
2424
2525 @ Test
2626 void noId () {
27- assertThrows (
28- IllegalStateException .class ,
29- () -> {
30- Relationship .builder ().build ();
31- });
27+ assertThat (Relationship .builder ().build ().getId ()).isNull ();
28+ }
29+
30+ @ Test
31+ void nullId () {
32+ assertThat (Relationship .builder ().id (null ).build ().getId ()).isNull ();
3233 }
3334
3435 @ Test
35- void valid () {
36- Relationship .builder ().id ("test-id" ).build ();
36+ void nonNullId () {
37+ assertThat ( Relationship .builder ().id ("test-id" ).build (). getId ()). isEqualTo ( "test-id" );
3738 }
3839}
You can’t perform that action at this time.
0 commit comments