1414import static org .junit .Assume .assumeTrue ;
1515import static org .neo4j .shell .DatabaseManager .ABSENT_DB_NAME ;
1616import static org .neo4j .shell .util .Versions .majorVersion ;
17+ import static org .neo4j .shell .util .Versions .minorVersion ;
1718
1819public class CypherShellProtocolIntegrationTest {
1920
@@ -35,28 +36,29 @@ public void shouldConnectWithNeo4jProtocol() throws Exception {
3536 @ Test
3637 public void shouldConnectWithBoltSSCProtocol () throws Exception {
3738 CypherShell shell = new CypherShell ( new StringLinePrinter (), new PrettyConfig ( Format .PLAIN , true , 1000 ), false , new ShellParameterMap ());
38- // Given 3.X series, where SSC are the default. Hard to test in 4.0 sadly.
39- onlyIn3x ( shell );
39+ // Given 3.X series where X > 1 , where SSC are the default. Hard to test in 4.0 sadly.
40+ onlyIn3_2to3_6 ( shell );
4041 shell .connect ( new ConnectionConfig ( "bolt+ssc://" , "localhost" , 7687 , "neo4j" , "neo" , Encryption .DEFAULT , ABSENT_DB_NAME ) );
4142 assertTrue (shell .isConnected ());
4243 }
4344
4445 @ Test
4546 public void shouldConnectWithNeo4jSSCProtocol () throws Exception {
4647 CypherShell shell = new CypherShell ( new StringLinePrinter (), new PrettyConfig ( Format .PLAIN , true , 1000 ), false , new ShellParameterMap ());
47- // Given 3.X series, where SSC are the default. Hard to test in 4.0 sadly.
48- onlyIn3x ( shell );
48+ // Given 3.X series where X > 1 , where SSC are the default. Hard to test in 4.0 sadly.
49+ onlyIn3_2to3_6 ( shell );
4950 // This should work by falling back to bolt+ssc
5051 shell .connect ( new ConnectionConfig ( "neo4j+ssc://" , "localhost" , 7687 , "neo4j" , "neo" , Encryption .DEFAULT , ABSENT_DB_NAME ) );
5152 assertTrue (shell .isConnected ());
5253 }
5354
5455 // Here should be tests for "neo4j+s" and "bolt+s", but we don't have the infrastructure for those.
5556
56- private void onlyIn3x ( CypherShell shell ) throws Exception {
57+ private void onlyIn3_2to3_6 ( CypherShell shell ) throws Exception {
5758 // Default connection settings
5859 shell .connect ( new ConnectionConfig ( "bolt://" , "localhost" , 7687 , "neo4j" , "neo" , Encryption .DEFAULT , ABSENT_DB_NAME ) );
59- assumeTrue ( majorVersion ( shell .getServerVersion () ) < 4 );
60+ assumeTrue ( majorVersion ( shell .getServerVersion () ) == 3 );
61+ assumeTrue ( minorVersion ( shell .getServerVersion () ) > 1 );
6062 shell .disconnect ();
6163 }
6264}
0 commit comments