3535import org .neo4j .driver .v1 .Statement ;
3636import org .neo4j .driver .v1 .Value ;
3737import org .neo4j .driver .v1 .Values ;
38- import org .neo4j .driver .v1 .tck .tck .util .Types ;
3938import org .neo4j .driver .v1 .tck .tck .util .runners .CypherStatementRunner ;
4039import org .neo4j .driver .v1 .tck .tck .util .runners .MappedParametersRunner ;
4140import org .neo4j .driver .v1 .tck .tck .util .runners .StatementRunner ;
5352import static org .neo4j .driver .v1 .tck .Environment .runners ;
5453import static org .neo4j .driver .v1 .tck .Environment .statementRunner ;
5554import static org .neo4j .driver .v1 .tck .Environment .stringRunner ;
56- import static org .neo4j .driver .v1 .tck .tck .util .ResultParser .getList ;
57- import static org .neo4j .driver .v1 .tck .tck .util .ResultParser .getMapOfObjects ;
58- import static org .neo4j .driver .v1 .tck .tck .util .ResultParser .isList ;
59- import static org .neo4j .driver .v1 .tck .tck .util .ResultParser .isMap ;
55+ import static org .neo4j .driver .v1 .tck .tck .util .ResultParser .getJavaValueIntAsLong ;
6056import static org .neo4j .driver .v1 .tck .tck .util .Types .Type ;
6157import static org .neo4j .driver .v1 .tck .tck .util .Types .getType ;
6258
@@ -73,10 +69,9 @@ public void A_running_database() throws Throwable
7369 }
7470
7571 @ Given ( "^a value (.*)$" )
76- public void a_value ( String value )
77- throws Throwable
72+ public void a_value ( String value ) throws Throwable
7873 {
79- expectedJavaValue = getJavaValue ( value );
74+ expectedJavaValue = getJavaValueIntAsLong ( value );
8075 expectedBoltValue = Values .value ( expectedJavaValue );
8176 }
8277
@@ -143,12 +138,12 @@ public void the_driver_asks_the_server_to_echo_this_map_back() throws Throwable
143138 }
144139
145140 @ Given ( "^a list containing$" )
146- public void a_list_containing ( List <String > table ) throws Throwable
141+ public static void a_list_containing ( List <String > table ) throws Throwable
147142 {
148143 List <String > content = table .subList ( 1 , table .size () - 1 );
149144 for ( String value : content )
150145 {
151- listOfObjects .add ( getJavaValue ( value ) );
146+ listOfObjects .add ( getJavaValueIntAsLong ( value ) );
152147 }
153148 }
154149
@@ -159,14 +154,14 @@ public void adding_this_list_to_itself() throws Throwable
159154 }
160155
161156 @ Given ( "^a map containing$" )
162- public void a_map_containing ( DataTable table ) throws Throwable
157+ public static void a_map_containing ( DataTable table ) throws Throwable
163158 {
164159 Map <String ,String > map = table .asMap ( String .class , String .class );
165160 for ( String key : map .keySet () )
166161 {
167162 if ( !key .equals ( "key" ) )
168163 {
169- mapOfObjects .put ( (String ) Type .String .getJavaValue ( key ), getJavaValue ( map .get ( key ) ) );
164+ mapOfObjects .put ( (String ) Type .String .getJavaValue ( key ), getJavaValueIntAsLong ( map .get ( key ) ) );
170165 }
171166 }
172167 }
@@ -193,27 +188,6 @@ public void result_should_be_equal_to_a_single_Type_of_Input() throws Throwable
193188 }
194189 }
195190
196- public Object getJavaValue ( String value )
197- {
198- if ( isList ( value ) )
199- {
200- ArrayList <Object > values = new ArrayList <>();
201- for ( String val : getList ( value ) )
202- {
203- values .add ( Types .asObject ( val ) );
204- }
205- return values ;
206- }
207- else if ( isMap ( value ) )
208- {
209- return getMapOfObjects ( value );
210- }
211- else
212- {
213- return Types .asObject ( value );
214- }
215- }
216-
217191 public String getRandomString ( long size )
218192 {
219193 StringBuilder stringBuilder = new StringBuilder ();
@@ -251,5 +225,4 @@ public boolean databaseRunning()
251225 {
252226 return session () != null ;
253227 }
254-
255228}
0 commit comments