@@ -137,7 +137,7 @@ public void should_create_query_message_from_fluent_statement(GraphProtocol grap
137
137
throws IOException {
138
138
// initialization
139
139
GraphRequestHandlerTestHarness harness = GraphRequestHandlerTestHarness .builder ().build ();
140
- GraphTraversal traversalTest =
140
+ GraphTraversal <?, ?> traversalTest =
141
141
DseGraph .g .V ().has ("person" , "name" , "marko" ).has ("p1" , 1L ).has ("p2" , Uuids .random ());
142
142
GraphStatement <?> graphStatement = FluentGraphStatement .newInstance (traversalTest );
143
143
@@ -171,6 +171,7 @@ public void should_create_query_message_from_batch_statement(GraphProtocol graph
171
171
throws IOException {
172
172
// initialization
173
173
GraphRequestHandlerTestHarness harness = GraphRequestHandlerTestHarness .builder ().build ();
174
+ @ SuppressWarnings ("rawtypes" )
174
175
List <GraphTraversal > traversalsTest =
175
176
ImmutableList .of (
176
177
// randomly testing some complex data types. Complete suite of data types test is in
@@ -424,7 +425,7 @@ public void should_return_results_for_statements(GraphProtocol graphProtocol, Ve
424
425
Mockito .spy (new GraphRequestAsyncProcessor (harness .getContext (), graphSupportChecker ));
425
426
when (p .getGraphBinaryModule ()).thenReturn (module );
426
427
427
- GraphStatement graphStatement =
428
+ GraphStatement <?> graphStatement =
428
429
ScriptGraphStatement .newInstance ("mockQuery" ).setExecutionProfileName ("test-graph" );
429
430
GraphResultSet grs =
430
431
new GraphRequestSyncProcessor (p )
@@ -487,7 +488,7 @@ public void should_invoke_request_tracker_and_update_metrics(
487
488
RequestTracker requestTracker = mock (RequestTracker .class );
488
489
when (harness .getContext ().getRequestTracker ()).thenReturn (requestTracker );
489
490
490
- GraphStatement graphStatement = ScriptGraphStatement .newInstance ("mockQuery" );
491
+ GraphStatement <?> graphStatement = ScriptGraphStatement .newInstance ("mockQuery" );
491
492
492
493
node1Behavior .setResponseSuccess (defaultDseFrameOf (singleGraphRow (graphProtocol , module )));
493
494
@@ -549,6 +550,31 @@ public void should_invoke_request_tracker_and_update_metrics(
549
550
verifyNoMoreInteractions (harness .getSession ().getMetricUpdater ());
550
551
}
551
552
553
+ @ Test
554
+ public void should_honor_statement_consistency_level () {
555
+ // initialization
556
+ GraphRequestHandlerTestHarness harness = GraphRequestHandlerTestHarness .builder ().build ();
557
+ ScriptGraphStatement graphStatement =
558
+ ScriptGraphStatement .builder ("mockScript" )
559
+ .setConsistencyLevel (DefaultConsistencyLevel .THREE )
560
+ .build ();
561
+
562
+ GraphBinaryModule module = createGraphBinaryModule (harness .getContext ());
563
+
564
+ // when
565
+ DriverExecutionProfile executionProfile =
566
+ Conversions .resolveExecutionProfile (graphStatement , harness .getContext ());
567
+
568
+ Message m =
569
+ GraphConversions .createMessageFromGraphStatement (
570
+ graphStatement , GRAPH_BINARY_1_0 , executionProfile , harness .getContext (), module );
571
+
572
+ // checks
573
+ assertThat (m ).isInstanceOf (Query .class );
574
+ Query q = ((Query ) m );
575
+ assertThat (q .options .consistency ).isEqualTo (DefaultConsistencyLevel .THREE .getProtocolCode ());
576
+ }
577
+
552
578
@ DataProvider
553
579
public static Object [][] dseVersionsWithDefaultGraphProtocol () {
554
580
// Default GraphSON sub protocol version differs based on DSE version, so test with a version
0 commit comments