diff --git a/pantheon/src/main/java/tech/pegasys/pantheon/cli/PantheonCommand.java b/pantheon/src/main/java/tech/pegasys/pantheon/cli/PantheonCommand.java index 4aff0dfad7..c13a790df5 100644 --- a/pantheon/src/main/java/tech/pegasys/pantheon/cli/PantheonCommand.java +++ b/pantheon/src/main/java/tech/pegasys/pantheon/cli/PantheonCommand.java @@ -933,7 +933,7 @@ private File genesisFile() { private Path dataDir() { if (isFullInstantiation()) { - return standaloneCommands.dataPath; + return standaloneCommands.dataPath.toAbsolutePath(); } else if (isDocker) { return Paths.get(DOCKER_DATADIR_LOCATION); } else { diff --git a/pantheon/src/test/java/tech/pegasys/pantheon/cli/PantheonCommandTest.java b/pantheon/src/test/java/tech/pegasys/pantheon/cli/PantheonCommandTest.java index 7800eb7898..f9fd126e36 100644 --- a/pantheon/src/test/java/tech/pegasys/pantheon/cli/PantheonCommandTest.java +++ b/pantheon/src/test/java/tech/pegasys/pantheon/cli/PantheonCommandTest.java @@ -303,7 +303,7 @@ public void overrideDefaultValuesIfKeyIsPresentInConfigFile() throws IOException .setGenesisConfig(encodeJsonGenesis(GENESIS_VALID_JSON)) .setBootNodes(nodes) .build(); - verify(mockControllerBuilder).homePath(eq(Paths.get("~/pantheondata"))); + verify(mockControllerBuilder).homePath(eq(Paths.get("~/pantheondata").toAbsolutePath())); verify(mockControllerBuilder).ethNetworkConfig(eq(networkConfig)); verify(mockControllerBuilder).syncWithOttoman(eq(false)); @@ -505,10 +505,11 @@ public void dataDirOptionMustBeUsed() throws Exception { verify(mockControllerBuilder).homePath(pathArgumentCaptor.capture()); verify(mockControllerBuilder).syncWithOttoman(eq(false)); - verify(mockControllerBuilder).nodePrivateKeyFile(eq(path.resolve("key").toFile())); + verify(mockControllerBuilder) + .nodePrivateKeyFile(eq(path.resolve("key").toAbsolutePath().toFile())); verify(mockControllerBuilder).build(); - assertThat(pathArgumentCaptor.getValue()).isEqualByComparingTo(path); + assertThat(pathArgumentCaptor.getValue()).isEqualByComparingTo(path.toAbsolutePath()); assertThat(commandOutput.toString()).isEmpty(); assertThat(commandErrorOutput.toString()).isEmpty();