Skip to content

Commit

Permalink
Spotless
Browse files Browse the repository at this point in the history
  • Loading branch information
josh-richardson committed Nov 28, 2019
1 parent cceef08 commit 91cd632
Showing 1 changed file with 23 additions and 22 deletions.
45 changes: 23 additions & 22 deletions src/test/java/org/web3j/console/project/UpdaterTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,13 @@
*/
package org.web3j.console.project;

import java.io.IOException;
import java.nio.charset.Charset;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.UUID;

import com.github.tomakehurst.wiremock.WireMockServer;
import com.github.tomakehurst.wiremock.client.WireMock;
import com.google.gson.Gson;
Expand All @@ -22,17 +29,11 @@
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.ValueSource;
import org.mockito.Mockito;

import org.web3j.console.config.CliConfig;
import org.web3j.console.update.Updater;
import org.web3j.utils.Version;

import java.io.IOException;
import java.nio.charset.Charset;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.util.UUID;

import static com.github.tomakehurst.wiremock.client.WireMock.aResponse;
import static com.github.tomakehurst.wiremock.client.WireMock.post;
import static com.github.tomakehurst.wiremock.client.WireMock.postRequestedFor;
Expand Down Expand Up @@ -89,21 +90,21 @@ private void testWorksWithVersion(String version) throws IOException {
.defaultAnswer(Mockito.CALLS_REAL_METHODS));

doAnswer(
invocation -> {
String jsonToWrite =
new Gson()
.toJson(
new CliConfig(
config.getVersion(),
config.getServicesUrl(),
config.getClientId(),
config.getLatestVersion(),
config.getUpdatePrompt()));
Files.write(
tempWeb3jSettingsPath,
jsonToWrite.getBytes(Charset.defaultCharset()));
return null;
})
invocation -> {
String jsonToWrite =
new Gson()
.toJson(
new CliConfig(
config.getVersion(),
config.getServicesUrl(),
config.getClientId(),
config.getLatestVersion(),
config.getUpdatePrompt()));
Files.write(
tempWeb3jSettingsPath,
jsonToWrite.getBytes(Charset.defaultCharset()));
return null;
})
.when(config)
.save();

Expand Down

0 comments on commit 91cd632

Please sign in to comment.