File tree Expand file tree Collapse file tree 3 files changed +15
-16
lines changed
main/java/org/cloudfoundry/client/v3
test/java/org/cloudfoundry/client/v3 Expand file tree Collapse file tree 3 files changed +15
-16
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 ;
19+ import static org .assertj . core .api .Assertions .assertThat ;
2020
2121import org .junit .jupiter .api .Test ;
2222
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 ();
3228 }
3329
3430 @ Test
35- void valid () {
36- Relationship .builder ().id ("test-id" ).build ();
31+ void nullId () {
32+ assertThat (Relationship .builder ().id (null ).build ().getId ()).isNull ();
33+ }
34+
35+ @ Test
36+ void nonNullId () {
37+ assertThat (Relationship .builder ().id ("test-id" ).build ().getId ()).isEqualTo ("test-id" );
3738 }
3839}
Original file line number Diff line number Diff line change @@ -25,14 +25,10 @@ final class ShareDomainRequestTest {
2525
2626 @ Test
2727 void emptyRelationship () {
28- assertThrows (
29- IllegalStateException .class ,
30- () -> {
31- ShareDomainRequest .builder ()
32- .domainId ("test-domain-id" )
33- .data (Relationship .builder ().build ())
34- .build ();
35- });
28+ ShareDomainRequest .builder ()
29+ .domainId ("test-domain-id" )
30+ .data (Relationship .builder ().build ())
31+ .build ();
3632 }
3733
3834 @ Test
You can’t perform that action at this time.
0 commit comments