File tree Expand file tree Collapse file tree 2 files changed +5
-24
lines changed
main/java/org/springframework/graphql/data
test/java/org/springframework/graphql/data Expand file tree Collapse file tree 2 files changed +5
-24
lines changed Original file line number Diff line number Diff line change @@ -137,21 +137,10 @@ public int hashCode() {
137137 return result ;
138138 }
139139
140- /**
141- * Returns a non-empty string representation of this {@code ArgumentValue}
142- * suitable for debugging.
143- *
144- * @return the string representation of this instance
145- */
146140 @ Override
147141 public String toString () {
148- if (this .omitted ) {
149- return "ArgumentValue.omitted" ;
150- }
151- if (this .value == null ){
152- return "ArgumentValue.empty" ;
153- }
154- return "ArgumentValue[%s]" .formatted (this .value );
142+ String v = ((this .value != null ) ? this .value .toString () : (this .omitted ) ? "omitted" : "empty" );
143+ return "ArgumentValue[" + v + "]" ;
155144 }
156145
157146
Original file line number Diff line number Diff line change @@ -81,17 +81,9 @@ void ifPresentShouldSkipWhenOmitted() {
8181 }
8282
8383 @ Test
84- void toStringShouldReturnOmittedWhenOmitted () {
85- assertThat (ArgumentValue .omitted ()).hasToString ("ArgumentValue.omitted" );
86- }
87-
88- @ Test
89- void toStringShouldReturnEmptyWhenNull () {
90- assertThat (ArgumentValue .ofNullable (null )).hasToString ("ArgumentValue.empty" );
91- }
92-
93- @ Test
94- void toStringShouldReturnValueWhenValue () {
84+ void toStringValue () {
85+ assertThat (ArgumentValue .omitted ()).hasToString ("ArgumentValue[omitted]" );
86+ assertThat (ArgumentValue .ofNullable (null )).hasToString ("ArgumentValue[empty]" );
9587 assertThat (ArgumentValue .ofNullable ("hello" )).hasToString ("ArgumentValue[hello]" );
9688 }
9789}
You can’t perform that action at this time.
0 commit comments