File tree 2 files changed +5
-24
lines changed
main/java/org/springframework/graphql/data
test/java/org/springframework/graphql/data 2 files changed +5
-24
lines changed Original file line number Diff line number Diff line change @@ -137,21 +137,10 @@ public int hashCode() {
137
137
return result ;
138
138
}
139
139
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
- */
146
140
@ Override
147
141
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 + "]" ;
155
144
}
156
145
157
146
Original file line number Diff line number Diff line change @@ -81,17 +81,9 @@ void ifPresentShouldSkipWhenOmitted() {
81
81
}
82
82
83
83
@ 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]" );
95
87
assertThat (ArgumentValue .ofNullable ("hello" )).hasToString ("ArgumentValue[hello]" );
96
88
}
97
89
}
You can’t perform that action at this time.
0 commit comments