Skip to content
This repository was archived by the owner on Jul 6, 2023. It is now read-only.

Commit ed02f75

Browse files
committed
Remove unused parameter from connectionconfig
1 parent 9daf896 commit ed02f75

File tree

8 files changed

+13
-19
lines changed

8 files changed

+13
-19
lines changed

cypher-shell/src/integration-test/java/org/neo4j/shell/MainIntegrationTest.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ public void connectInteractivelyPromptsOnWrongAuthentication() throws Exception
3535
logger.setFormat(cliArgs.getFormat());
3636

3737
ConnectionConfig connectionConfig = new ConnectionConfig(
38-
logger,
3938
cliArgs.getScheme(),
4039
cliArgs.getHost(),
4140
cliArgs.getPort(),

cypher-shell/src/integration-test/java/org/neo4j/shell/commands/CypherShellFailureIntegrationTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,6 @@ public void cypherWithNoPasswordShouldReturnValidError() throws CommandException
3535
thrown.expect( AuthenticationException.class );
3636
thrown.expectMessage("The client is unauthorized due to authentication failure.");
3737

38-
shell.connect(new ConnectionConfig(logger, "bolt://", "localhost", 7687, "neo4j", "", true));
38+
shell.connect(new ConnectionConfig("bolt://", "localhost", 7687, "neo4j", "", true));
3939
}
4040
}

cypher-shell/src/integration-test/java/org/neo4j/shell/commands/CypherShellIntegrationTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public void setUp() throws Exception {
4545
commitCommand = new Commit(shell);
4646
beginCommand = new Begin(shell);
4747

48-
shell.connect(new ConnectionConfig(logger, "bolt://", "localhost", 7687, "neo4j", "neo", true));
48+
shell.connect(new ConnectionConfig("bolt://", "localhost", 7687, "neo4j", "neo", true));
4949
}
5050

5151
@After
@@ -126,7 +126,7 @@ public void connectTwiceThrows() throws CommandException {
126126
thrown.expect(CommandException.class);
127127
thrown.expectMessage("Already connected");
128128

129-
ConnectionConfig config = new ConnectionConfig(logger, "bolt://", "localhost", 7687, "neo4j", "neo", true);
129+
ConnectionConfig config = new ConnectionConfig("bolt://", "localhost", 7687, "neo4j", "neo", true);
130130
assertTrue("Shell should already be connected", shell.isConnected());
131131
shell.connect(config);
132132
}

cypher-shell/src/main/java/org/neo4j/shell/ConnectionConfig.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
package org.neo4j.shell;
22

33
import org.neo4j.driver.v1.Config;
4-
import org.neo4j.shell.log.AnsiFormattedText;
5-
import org.neo4j.shell.log.Logger;
64

75
import javax.annotation.Nonnull;
86

@@ -14,7 +12,7 @@ public class ConnectionConfig {
1412
private String username;
1513
private String password;
1614

17-
public ConnectionConfig(@Nonnull Logger logger, @Nonnull String scheme, @Nonnull String host, int port,
15+
public ConnectionConfig(@Nonnull String scheme, @Nonnull String host, int port,
1816
@Nonnull String username, @Nonnull String password, boolean encryption) {
1917
this.host = host;
2018
this.port = port;

cypher-shell/src/main/java/org/neo4j/shell/Main.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@ void startShell(@Nonnull CliArgs cliArgs) {
5757
logger.setFormat(cliArgs.getFormat());
5858

5959
ConnectionConfig connectionConfig = new ConnectionConfig(
60-
logger,
6160
cliArgs.getScheme(),
6261
cliArgs.getHost(),
6362
cliArgs.getPort(),

cypher-shell/src/test/java/org/neo4j/shell/ConnectionConfigTest.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,10 @@
66

77
import static org.junit.Assert.assertEquals;
88
import static org.mockito.Mockito.mock;
9-
import static org.mockito.Mockito.verify;
109

1110
public class ConnectionConfigTest {
1211
private Logger logger = mock(Logger.class);
13-
private ConnectionConfig config = new ConnectionConfig(logger, "bolt://", "localhost", 1, "bob",
12+
private ConnectionConfig config = new ConnectionConfig("bolt://", "localhost", 1, "bob",
1413
"pass", false);
1514

1615
@Test
@@ -46,8 +45,8 @@ public void driverUrlDefaultScheme() throws Exception {
4645
@Test
4746
public void encryption() {
4847
assertEquals(Config.EncryptionLevel.REQUIRED,
49-
new ConnectionConfig(logger, "bolt://", "", -1, "", "", true).encryption());
48+
new ConnectionConfig("bolt://", "", -1, "", "", true).encryption());
5049
assertEquals(Config.EncryptionLevel.NONE,
51-
new ConnectionConfig(logger, "bolt://", "", -1, "", "", false).encryption());
50+
new ConnectionConfig("bolt://", "", -1, "", "", false).encryption());
5251
}
5352
}

cypher-shell/src/test/java/org/neo4j/shell/CypherShellTest.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
import org.neo4j.shell.test.OfflineTestShell;
2222

2323
import java.io.IOException;
24-
import java.util.Arrays;
2524
import java.util.Optional;
2625

2726
import static java.util.Arrays.asList;
@@ -59,7 +58,7 @@ public void setup() {
5958

6059
@Test
6160
public void verifyDelegationOfConnectionMethods() throws CommandException {
62-
ConnectionConfig cc = new ConnectionConfig(logger, "bolt://", "", 1, "", "", false);
61+
ConnectionConfig cc = new ConnectionConfig("bolt://", "", 1, "", "", false);
6362
CypherShell shell = new CypherShell(logger, mockedBoltStateHandler, mockedPrettyPrinter);
6463

6564
shell.connect(cc);

cypher-shell/src/test/java/org/neo4j/shell/state/BoltStateHandlerTest.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ public Session session() {
7676
}
7777
};
7878
BoltStateHandler handler = new BoltStateHandler(provider);
79-
ConnectionConfig config = new ConnectionConfig(logger, "bolt://", "", -1, "", "", false);
79+
ConnectionConfig config = new ConnectionConfig("bolt://", "", -1, "", "", false);
8080
handler.connect(config);
8181

8282
assertEquals("", handler.getServerVersion());
@@ -87,7 +87,7 @@ public void versionIsNotEmptyAfterConnect() throws CommandException {
8787
Driver driverMock = stubVersionInAnOpenSession(mock(StatementResult.class), mock(Session.class), "Neo4j/9.4.1-ALPHA");
8888

8989
BoltStateHandler handler = new BoltStateHandler((s, authToken, config) -> driverMock);
90-
ConnectionConfig config = new ConnectionConfig(logger, "bolt://", "", -1, "", "", false);
90+
ConnectionConfig config = new ConnectionConfig("bolt://", "", -1, "", "", false);
9191
handler.connect(config);
9292

9393
assertEquals("9.4.1-ALPHA", handler.getServerVersion());
@@ -336,7 +336,7 @@ public void silentDisconnectCleansUp() throws Exception {
336336
public void turnOffEncryptionIfRequested() throws CommandException {
337337
RecordingDriverProvider provider = new RecordingDriverProvider();
338338
BoltStateHandler handler = new BoltStateHandler(provider);
339-
ConnectionConfig config = new ConnectionConfig(logger, "bolt://", "", -1, "", "", false);
339+
ConnectionConfig config = new ConnectionConfig("bolt://", "", -1, "", "", false);
340340
handler.connect(config);
341341
assertEquals(Config.EncryptionLevel.NONE, provider.config.encryptionLevel());
342342
}
@@ -345,7 +345,7 @@ public void turnOffEncryptionIfRequested() throws CommandException {
345345
public void turnOnEncryptionIfRequested() throws CommandException {
346346
RecordingDriverProvider provider = new RecordingDriverProvider();
347347
BoltStateHandler handler = new BoltStateHandler(provider);
348-
ConnectionConfig config = new ConnectionConfig(logger, "bolt://", "", -1, "", "", true);
348+
ConnectionConfig config = new ConnectionConfig("bolt://", "", -1, "", "", true);
349349
handler.connect(config);
350350
assertEquals(Config.EncryptionLevel.REQUIRED, provider.config.encryptionLevel());
351351
}
@@ -376,7 +376,7 @@ public OfflineBoltStateHandler(Driver driver) {
376376
}
377377

378378
public void connect() throws CommandException {
379-
connect(new ConnectionConfig(mock(Logger.class), "bolt://", "", 1, "", "", false));
379+
connect(new ConnectionConfig("bolt://", "", 1, "", "", false));
380380
}
381381
}
382382

0 commit comments

Comments
 (0)