mirror of
https://github.com/haveno-dex/haveno.git
synced 2025-05-02 22:55:09 -04:00
Removing star and unused imports with checkstyle
This commit is contained in:
parent
ce05710537
commit
3b8f19c4ce
1206 changed files with 5197 additions and 6620 deletions
|
@ -17,10 +17,11 @@
|
|||
|
||||
package haveno.apitest;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
import haveno.apitest.config.ApiTestConfig;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
import static haveno.apitest.Scaffold.EXIT_FAILURE;
|
||||
import static haveno.apitest.Scaffold.EXIT_SUCCESS;
|
||||
import static haveno.apitest.config.ApiTestRateMeterInterceptorConfig.appendCallRateMeteringConfigPathOpt;
|
||||
|
@ -29,8 +30,6 @@ import static haveno.apitest.config.ApiTestRateMeterInterceptorConfig.hasCallRat
|
|||
import static java.lang.System.err;
|
||||
import static java.lang.System.exit;
|
||||
|
||||
import haveno.apitest.config.ApiTestConfig;
|
||||
|
||||
/**
|
||||
* ApiTestMain is a placeholder for the gradle build file, which requires a valid
|
||||
* 'mainClassName' property in the :apitest subproject configuration.
|
||||
|
|
|
@ -26,15 +26,16 @@ import haveno.apitest.linux.LinuxProcess;
|
|||
import haveno.cli.GrpcClient;
|
||||
import haveno.common.config.HavenoHelpFormatter;
|
||||
import haveno.common.util.Utilities;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Path;
|
||||
import java.nio.file.Paths;
|
||||
import java.nio.file.attribute.PosixFilePermissions;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.IOException;
|
||||
|
||||
import java.util.Objects;
|
||||
import java.util.Optional;
|
||||
import java.util.concurrent.CountDownLatch;
|
||||
|
@ -43,14 +44,16 @@ import java.util.concurrent.ExecutorService;
|
|||
import java.util.concurrent.Executors;
|
||||
import java.util.concurrent.Future;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import static haveno.apitest.Scaffold.BitcoinCoreApp.bitcoind;
|
||||
import static haveno.apitest.config.ApiTestConfig.MEDIATOR;
|
||||
import static haveno.apitest.config.ApiTestConfig.REFUND_AGENT;
|
||||
import static haveno.apitest.config.HavenoAppConfig.*;
|
||||
import static haveno.apitest.config.HavenoAppConfig.alicedaemon;
|
||||
import static haveno.apitest.config.HavenoAppConfig.alicedesktop;
|
||||
import static haveno.apitest.config.HavenoAppConfig.arbdaemon;
|
||||
import static haveno.apitest.config.HavenoAppConfig.arbdesktop;
|
||||
import static haveno.apitest.config.HavenoAppConfig.bobdaemon;
|
||||
import static haveno.apitest.config.HavenoAppConfig.bobdesktop;
|
||||
import static haveno.apitest.config.HavenoAppConfig.seednode;
|
||||
import static haveno.common.app.DevEnv.DEV_PRIVILEGE_PRIV_KEY;
|
||||
import static java.lang.String.format;
|
||||
import static java.lang.System.exit;
|
||||
|
|
|
@ -17,19 +17,17 @@
|
|||
|
||||
package haveno.apitest;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import haveno.apitest.linux.LinuxProcess;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.Objects;
|
||||
import java.util.concurrent.Callable;
|
||||
import java.util.concurrent.CountDownLatch;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import static java.lang.String.format;
|
||||
import static java.util.concurrent.TimeUnit.MILLISECONDS;
|
||||
|
||||
import haveno.apitest.linux.LinuxProcess;
|
||||
|
||||
@Slf4j
|
||||
public class SetupTask implements Callable<SetupTask.Status> {
|
||||
|
||||
|
|
|
@ -18,10 +18,10 @@
|
|||
package haveno.apitest;
|
||||
|
||||
import haveno.apitest.linux.BashCommand;
|
||||
import java.io.IOException;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
@Slf4j
|
||||
class SmokeTestBashCommand {
|
||||
|
||||
|
|
|
@ -17,14 +17,13 @@
|
|||
|
||||
package haveno.apitest;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import static java.lang.String.format;
|
||||
|
||||
import haveno.apitest.config.ApiTestConfig;
|
||||
import haveno.apitest.linux.BitcoinCli;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import static java.lang.String.format;
|
||||
|
||||
@Slf4j
|
||||
class SmokeTestBitcoind {
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
|
||||
package haveno.apitest.config;
|
||||
|
||||
import haveno.common.config.CompositeOptionSet;
|
||||
import joptsimple.AbstractOptionSpec;
|
||||
import joptsimple.ArgumentAcceptingOptionSpec;
|
||||
import joptsimple.HelpFormatter;
|
||||
|
@ -24,24 +25,20 @@ import joptsimple.OptionException;
|
|||
import joptsimple.OptionParser;
|
||||
import joptsimple.OptionSet;
|
||||
import joptsimple.OptionSpec;
|
||||
|
||||
import java.net.InetAddress;
|
||||
|
||||
import java.nio.file.Paths;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.OutputStream;
|
||||
import java.io.UncheckedIOException;
|
||||
|
||||
import java.net.InetAddress;
|
||||
import java.nio.file.Paths;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.Properties;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import static java.lang.String.format;
|
||||
import static java.lang.System.getProperty;
|
||||
import static java.lang.System.getenv;
|
||||
|
@ -49,8 +46,6 @@ import static java.util.Arrays.asList;
|
|||
import static java.util.Arrays.stream;
|
||||
import static joptsimple.internal.Strings.EMPTY;
|
||||
|
||||
import haveno.common.config.CompositeOptionSet;
|
||||
|
||||
@Slf4j
|
||||
public class ApiTestConfig {
|
||||
|
||||
|
|
|
@ -1,18 +1,18 @@
|
|||
package haveno.apitest.config;
|
||||
|
||||
import haveno.daemon.grpc.GrpcVersionService;
|
||||
import haveno.daemon.grpc.interceptor.GrpcServiceRateMeteringConfig;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
import static haveno.apitest.config.ApiTestConfig.CALL_RATE_METERING_CONFIG_PATH;
|
||||
import static haveno.proto.grpc.DisputeAgentsGrpc.getRegisterDisputeAgentMethod;
|
||||
import static haveno.proto.grpc.GetVersionGrpc.getGetVersionMethod;
|
||||
import static haveno.apitest.config.ApiTestConfig.CALL_RATE_METERING_CONFIG_PATH;
|
||||
import static java.lang.System.arraycopy;
|
||||
import static java.util.Arrays.stream;
|
||||
import static java.util.concurrent.TimeUnit.MILLISECONDS;
|
||||
import static java.util.concurrent.TimeUnit.SECONDS;
|
||||
|
||||
import haveno.daemon.grpc.GrpcVersionService;
|
||||
import haveno.daemon.grpc.interceptor.GrpcServiceRateMeteringConfig;
|
||||
|
||||
public class ApiTestRateMeterInterceptorConfig {
|
||||
|
||||
public static File getTestRateMeterInterceptorConfig() {
|
||||
|
|
|
@ -17,22 +17,19 @@
|
|||
|
||||
package haveno.apitest.linux;
|
||||
|
||||
import java.nio.file.Paths;
|
||||
import haveno.apitest.config.ApiTestConfig;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
import java.nio.file.Paths;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import static haveno.apitest.linux.BashCommand.isAlive;
|
||||
import static java.lang.String.format;
|
||||
import static joptsimple.internal.Strings.EMPTY;
|
||||
|
||||
import haveno.apitest.config.ApiTestConfig;
|
||||
|
||||
@Slf4j
|
||||
abstract class AbstractLinuxProcess implements LinuxProcess {
|
||||
|
||||
|
|
|
@ -17,14 +17,12 @@
|
|||
|
||||
package haveno.apitest.linux;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import static haveno.apitest.config.ApiTestConfig.BASH_PATH_VALUE;
|
||||
import static java.lang.management.ManagementFactory.getRuntimeMXBean;
|
||||
|
|
|
@ -18,10 +18,10 @@
|
|||
package haveno.apitest.linux;
|
||||
|
||||
import haveno.apitest.config.ApiTestConfig;
|
||||
import java.io.IOException;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
@Slf4j
|
||||
public class BitcoinCli extends AbstractLinuxProcess implements LinuxProcess {
|
||||
|
||||
|
|
|
@ -17,17 +17,16 @@
|
|||
|
||||
package haveno.apitest.linux;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import haveno.apitest.config.ApiTestConfig;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import static haveno.apitest.linux.BashCommand.isAlive;
|
||||
import static java.lang.String.format;
|
||||
import static java.util.concurrent.TimeUnit.MILLISECONDS;
|
||||
import static joptsimple.internal.Strings.EMPTY;
|
||||
|
||||
import haveno.apitest.config.ApiTestConfig;
|
||||
|
||||
@Slf4j
|
||||
public class BitcoinDaemon extends AbstractLinuxProcess implements LinuxProcess {
|
||||
|
||||
|
|
|
@ -17,24 +17,21 @@
|
|||
|
||||
package haveno.apitest.linux;
|
||||
|
||||
import java.nio.file.Paths;
|
||||
import haveno.apitest.config.ApiTestConfig;
|
||||
import haveno.apitest.config.HavenoAppConfig;
|
||||
import haveno.daemon.app.HavenoDaemonMain;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
import java.nio.file.Paths;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import static haveno.apitest.linux.BashCommand.isAlive;
|
||||
import static java.lang.String.format;
|
||||
import static java.util.concurrent.TimeUnit.MILLISECONDS;
|
||||
|
||||
import haveno.apitest.config.ApiTestConfig;
|
||||
import haveno.apitest.config.HavenoAppConfig;
|
||||
import haveno.daemon.app.HavenoDaemonMain;
|
||||
|
||||
/**
|
||||
* Runs a regtest/dao Haveno application instance in the background.
|
||||
*/
|
||||
|
|
|
@ -18,7 +18,6 @@
|
|||
package haveno.apitest.linux;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface LinuxProcess {
|
||||
|
|
|
@ -17,13 +17,12 @@
|
|||
|
||||
package haveno.apitest.linux;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
* This class can be used to execute a system command from a Java application.
|
||||
* See the documentation for the public methods of this class for more
|
||||
|
|
|
@ -17,12 +17,12 @@
|
|||
|
||||
package haveno.apitest.linux;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.InputStream;
|
||||
import java.io.InputStreamReader;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
* This class is intended to be used with the SystemCommandExecutor
|
||||
* class to let users execute system commands from Java applications.
|
||||
|
|
|
@ -17,18 +17,17 @@
|
|||
|
||||
package haveno.apitest;
|
||||
|
||||
import java.time.Duration;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import java.util.concurrent.ExecutionException;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import haveno.apitest.config.ApiTestConfig;
|
||||
import haveno.apitest.method.BitcoinCliHelper;
|
||||
import haveno.cli.GrpcClient;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.junit.jupiter.api.TestInfo;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import org.junit.jupiter.api.TestInfo;
|
||||
import java.io.IOException;
|
||||
import java.time.Duration;
|
||||
import java.util.concurrent.ExecutionException;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static com.google.common.util.concurrent.Uninterruptibles.sleepUninterruptibly;
|
||||
import static haveno.apitest.config.ApiTestRateMeterInterceptorConfig.getTestRateMeterInterceptorConfig;
|
||||
|
@ -38,11 +37,6 @@ import static haveno.apitest.config.HavenoAppConfig.bobdaemon;
|
|||
import static java.net.InetAddress.getLoopbackAddress;
|
||||
import static java.util.Arrays.stream;
|
||||
|
||||
import haveno.apitest.Scaffold;
|
||||
import haveno.apitest.config.ApiTestConfig;
|
||||
import haveno.apitest.method.BitcoinCliHelper;
|
||||
import haveno.cli.GrpcClient;
|
||||
|
||||
/**
|
||||
* Base class for all test types: 'method', 'scenario' and 'e2e'.
|
||||
* <p>
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
package haveno.apitest;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import org.junit.runner.Description;
|
||||
import org.junit.runner.JUnitCore;
|
||||
import org.junit.runner.Result;
|
||||
|
|
|
@ -17,14 +17,14 @@
|
|||
|
||||
package haveno.apitest.method;
|
||||
|
||||
import haveno.apitest.config.ApiTestConfig;
|
||||
import haveno.apitest.linux.BitcoinCli;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import static java.lang.String.format;
|
||||
import static org.junit.jupiter.api.Assertions.fail;
|
||||
|
||||
import haveno.apitest.config.ApiTestConfig;
|
||||
import haveno.apitest.linux.BitcoinCli;
|
||||
|
||||
public final class BitcoinCliHelper {
|
||||
|
||||
private final ApiTestConfig config;
|
||||
|
|
|
@ -18,9 +18,7 @@
|
|||
package haveno.apitest.method;
|
||||
|
||||
import io.grpc.StatusRuntimeException;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import org.junit.jupiter.api.AfterAll;
|
||||
import org.junit.jupiter.api.BeforeAll;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
|
|
|
@ -18,7 +18,6 @@
|
|||
package haveno.apitest.method;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import org.junit.jupiter.api.AfterAll;
|
||||
import org.junit.jupiter.api.BeforeAll;
|
||||
import org.junit.jupiter.api.Disabled;
|
||||
|
|
|
@ -18,7 +18,6 @@
|
|||
package haveno.apitest.method;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import org.junit.jupiter.api.AfterAll;
|
||||
import org.junit.jupiter.api.BeforeAll;
|
||||
import org.junit.jupiter.api.Disabled;
|
||||
|
|
|
@ -17,7 +17,6 @@
|
|||
|
||||
package haveno.apitest.method;
|
||||
|
||||
import haveno.proto.grpc.BalancesInfo;
|
||||
import haveno.apitest.ApiTestCase;
|
||||
import haveno.apitest.linux.BashCommand;
|
||||
import haveno.cli.GrpcClient;
|
||||
|
@ -27,22 +26,19 @@ import haveno.core.api.model.PaymentAccountForm;
|
|||
import haveno.core.payment.F2FAccount;
|
||||
import haveno.core.payment.NationalBankAccount;
|
||||
import haveno.core.proto.CoreProtoResolver;
|
||||
import haveno.proto.grpc.BalancesInfo;
|
||||
import io.grpc.Status;
|
||||
import io.grpc.StatusRuntimeException;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.PrintWriter;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import java.util.function.Function;
|
||||
import java.util.function.Supplier;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.PrintWriter;
|
||||
import java.math.BigDecimal;
|
||||
import java.util.function.Function;
|
||||
import java.util.function.Supplier;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static haveno.apitest.config.ApiTestConfig.BTC;
|
||||
import static haveno.apitest.config.ApiTestRateMeterInterceptorConfig.getTestRateMeterInterceptorConfig;
|
||||
|
|
|
@ -18,9 +18,7 @@
|
|||
package haveno.apitest.method;
|
||||
|
||||
import io.grpc.StatusRuntimeException;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import org.junit.jupiter.api.AfterAll;
|
||||
import org.junit.jupiter.api.BeforeAll;
|
||||
import org.junit.jupiter.api.Disabled;
|
||||
|
|
|
@ -17,24 +17,21 @@
|
|||
|
||||
package haveno.apitest.method.offer;
|
||||
|
||||
import haveno.proto.grpc.OfferInfo;
|
||||
import haveno.apitest.method.MethodTest;
|
||||
import haveno.cli.CliMain;
|
||||
import haveno.cli.table.builder.TableBuilder;
|
||||
import haveno.proto.grpc.OfferInfo;
|
||||
import lombok.Setter;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.junit.jupiter.api.AfterAll;
|
||||
import org.junit.jupiter.api.BeforeAll;
|
||||
import protobuf.PaymentAccount;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.math.MathContext;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.function.Function;
|
||||
|
||||
import lombok.Setter;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import org.junit.jupiter.api.AfterAll;
|
||||
import org.junit.jupiter.api.BeforeAll;
|
||||
|
||||
import static haveno.apitest.Scaffold.BitcoinCoreApp.bitcoind;
|
||||
import static haveno.apitest.config.ApiTestConfig.XMR;
|
||||
import static haveno.apitest.config.HavenoAppConfig.alicedaemon;
|
||||
|
|
|
@ -17,19 +17,18 @@
|
|||
|
||||
package haveno.apitest.method.offer;
|
||||
|
||||
import haveno.proto.grpc.OfferInfo;
|
||||
import haveno.core.payment.PaymentAccount;
|
||||
import java.util.List;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
import haveno.proto.grpc.OfferInfo;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import org.junit.jupiter.api.Disabled;
|
||||
import org.junit.jupiter.api.MethodOrderer;
|
||||
import org.junit.jupiter.api.Order;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.api.TestMethodOrder;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.function.Consumer;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import static protobuf.OfferDirection.BUY;
|
||||
|
||||
|
|
|
@ -17,8 +17,8 @@
|
|||
|
||||
package haveno.apitest.method.offer;
|
||||
|
||||
import haveno.core.payment.PaymentAccount;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import org.junit.jupiter.api.Disabled;
|
||||
import org.junit.jupiter.api.MethodOrderer;
|
||||
import org.junit.jupiter.api.Order;
|
||||
|
@ -35,8 +35,6 @@ import static org.junit.jupiter.api.Assertions.assertTrue;
|
|||
import static protobuf.OfferDirection.BUY;
|
||||
import static protobuf.OfferDirection.SELL;
|
||||
|
||||
import haveno.core.payment.PaymentAccount;
|
||||
|
||||
@Disabled
|
||||
@Slf4j
|
||||
@TestMethodOrder(MethodOrderer.OrderAnnotation.class)
|
||||
|
|
|
@ -17,20 +17,18 @@
|
|||
|
||||
package haveno.apitest.method.offer;
|
||||
|
||||
import haveno.proto.grpc.OfferInfo;
|
||||
import haveno.core.payment.PaymentAccount;
|
||||
import java.text.DecimalFormat;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import haveno.proto.grpc.OfferInfo;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import org.junit.jupiter.api.Disabled;
|
||||
import org.junit.jupiter.api.MethodOrderer;
|
||||
import org.junit.jupiter.api.Order;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.api.TestMethodOrder;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.text.DecimalFormat;
|
||||
|
||||
import static haveno.apitest.config.ApiTestConfig.BTC;
|
||||
import static haveno.apitest.config.ApiTestConfig.USD;
|
||||
import static haveno.common.util.MathUtils.roundDouble;
|
||||
|
|
|
@ -18,11 +18,7 @@
|
|||
package haveno.apitest.method.offer;
|
||||
|
||||
import haveno.proto.grpc.OfferInfo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import org.junit.jupiter.api.BeforeAll;
|
||||
import org.junit.jupiter.api.Disabled;
|
||||
import org.junit.jupiter.api.MethodOrderer;
|
||||
|
@ -30,6 +26,8 @@ import org.junit.jupiter.api.Order;
|
|||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.api.TestMethodOrder;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import static haveno.apitest.config.ApiTestConfig.BTC;
|
||||
import static haveno.apitest.config.ApiTestConfig.XMR;
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
|
|
|
@ -17,24 +17,20 @@
|
|||
|
||||
package haveno.apitest.method.offer;
|
||||
|
||||
import haveno.core.payment.PaymentAccount;
|
||||
import io.grpc.StatusRuntimeException;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import org.junit.jupiter.api.Disabled;
|
||||
import org.junit.jupiter.api.MethodOrderer;
|
||||
import org.junit.jupiter.api.Order;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.api.TestMethodOrder;
|
||||
|
||||
import static haveno.apitest.config.ApiTestConfig.BTC;
|
||||
import static java.lang.String.format;
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import static org.junit.jupiter.api.Assertions.assertThrows;
|
||||
import static protobuf.OfferDirection.BUY;
|
||||
|
||||
import haveno.core.payment.PaymentAccount;
|
||||
|
||||
@Disabled
|
||||
@Slf4j
|
||||
@TestMethodOrder(MethodOrderer.OrderAnnotation.class)
|
||||
|
|
|
@ -10,13 +10,15 @@ import haveno.core.locale.FiatCurrency;
|
|||
import haveno.core.locale.Res;
|
||||
import haveno.core.locale.TradeCurrency;
|
||||
import haveno.core.payment.PaymentAccount;
|
||||
import java.nio.file.Paths;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.TestInfo;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.FileOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.OutputStreamWriter;
|
||||
|
||||
import java.nio.file.Paths;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Comparator;
|
||||
|
@ -26,15 +28,14 @@ import java.util.Map;
|
|||
import java.util.Optional;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.TestInfo;
|
||||
|
||||
import static java.lang.String.format;
|
||||
import static java.lang.System.getProperty;
|
||||
import static java.nio.charset.StandardCharsets.UTF_8;
|
||||
import static org.junit.jupiter.api.Assertions.*;
|
||||
import static org.junit.jupiter.api.Assertions.assertArrayEquals;
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import static org.junit.jupiter.api.Assertions.assertNotNull;
|
||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
import static org.junit.jupiter.api.Assertions.fail;
|
||||
|
||||
@Slf4j
|
||||
public class AbstractPaymentAccountTest extends MethodTest {
|
||||
|
|
|
@ -58,17 +58,7 @@ import haveno.core.payment.payload.SameBankAccountPayload;
|
|||
import haveno.core.payment.payload.SpecificBanksAccountPayload;
|
||||
import haveno.core.payment.payload.SwiftAccountPayload;
|
||||
import io.grpc.StatusRuntimeException;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import org.junit.jupiter.api.AfterAll;
|
||||
import org.junit.jupiter.api.BeforeAll;
|
||||
import org.junit.jupiter.api.Disabled;
|
||||
|
@ -76,6 +66,13 @@ import org.junit.jupiter.api.Test;
|
|||
import org.junit.jupiter.api.TestInfo;
|
||||
import org.junit.jupiter.api.TestMethodOrder;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static haveno.apitest.Scaffold.BitcoinCoreApp.bitcoind;
|
||||
import static haveno.apitest.config.ApiTestConfig.EUR;
|
||||
import static haveno.apitest.config.ApiTestConfig.USD;
|
||||
|
@ -83,7 +80,37 @@ import static haveno.apitest.config.HavenoAppConfig.alicedaemon;
|
|||
import static haveno.cli.table.builder.TableType.PAYMENT_ACCOUNT_TBL;
|
||||
import static haveno.core.locale.CurrencyUtil.getAllSortedFiatCurrencies;
|
||||
import static haveno.core.locale.CurrencyUtil.getTradeCurrency;
|
||||
import static haveno.core.payment.payload.PaymentMethod.*;
|
||||
import static haveno.core.payment.payload.PaymentMethod.ADVANCED_CASH_ID;
|
||||
import static haveno.core.payment.payload.PaymentMethod.ALI_PAY_ID;
|
||||
import static haveno.core.payment.payload.PaymentMethod.AUSTRALIA_PAYID_ID;
|
||||
import static haveno.core.payment.payload.PaymentMethod.CAPITUAL_ID;
|
||||
import static haveno.core.payment.payload.PaymentMethod.CASH_DEPOSIT_ID;
|
||||
import static haveno.core.payment.payload.PaymentMethod.CLEAR_X_CHANGE_ID;
|
||||
import static haveno.core.payment.payload.PaymentMethod.F2F_ID;
|
||||
import static haveno.core.payment.payload.PaymentMethod.FASTER_PAYMENTS_ID;
|
||||
import static haveno.core.payment.payload.PaymentMethod.HAL_CASH_ID;
|
||||
import static haveno.core.payment.payload.PaymentMethod.INTERAC_E_TRANSFER_ID;
|
||||
import static haveno.core.payment.payload.PaymentMethod.JAPAN_BANK_ID;
|
||||
import static haveno.core.payment.payload.PaymentMethod.MONEY_BEAM_ID;
|
||||
import static haveno.core.payment.payload.PaymentMethod.MONEY_GRAM_ID;
|
||||
import static haveno.core.payment.payload.PaymentMethod.NATIONAL_BANK_ID;
|
||||
import static haveno.core.payment.payload.PaymentMethod.PAXUM_ID;
|
||||
import static haveno.core.payment.payload.PaymentMethod.PAYSERA_ID;
|
||||
import static haveno.core.payment.payload.PaymentMethod.PERFECT_MONEY_ID;
|
||||
import static haveno.core.payment.payload.PaymentMethod.POPMONEY_ID;
|
||||
import static haveno.core.payment.payload.PaymentMethod.PROMPT_PAY_ID;
|
||||
import static haveno.core.payment.payload.PaymentMethod.REVOLUT_ID;
|
||||
import static haveno.core.payment.payload.PaymentMethod.SAME_BANK_ID;
|
||||
import static haveno.core.payment.payload.PaymentMethod.SEPA_ID;
|
||||
import static haveno.core.payment.payload.PaymentMethod.SEPA_INSTANT_ID;
|
||||
import static haveno.core.payment.payload.PaymentMethod.SPECIFIC_BANKS_ID;
|
||||
import static haveno.core.payment.payload.PaymentMethod.SWIFT_ID;
|
||||
import static haveno.core.payment.payload.PaymentMethod.SWISH_ID;
|
||||
import static haveno.core.payment.payload.PaymentMethod.TRANSFERWISE_ID;
|
||||
import static haveno.core.payment.payload.PaymentMethod.UPHOLD_ID;
|
||||
import static haveno.core.payment.payload.PaymentMethod.US_POSTAL_MONEY_ORDER_ID;
|
||||
import static haveno.core.payment.payload.PaymentMethod.WECHAT_PAY_ID;
|
||||
import static haveno.core.payment.payload.PaymentMethod.WESTERN_UNION_ID;
|
||||
import static java.util.Comparator.comparing;
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import static org.junit.jupiter.api.Assertions.assertThrows;
|
||||
|
|
|
@ -1,12 +1,7 @@
|
|||
package haveno.apitest.method.payment;
|
||||
|
||||
import protobuf.PaymentMethod;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import haveno.apitest.method.MethodTest;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import org.junit.jupiter.api.AfterAll;
|
||||
import org.junit.jupiter.api.BeforeAll;
|
||||
import org.junit.jupiter.api.Disabled;
|
||||
|
@ -14,14 +9,16 @@ import org.junit.jupiter.api.MethodOrderer;
|
|||
import org.junit.jupiter.api.Order;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.api.TestMethodOrder;
|
||||
import protobuf.PaymentMethod;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static haveno.apitest.Scaffold.BitcoinCoreApp.bitcoind;
|
||||
import static haveno.apitest.config.HavenoAppConfig.alicedaemon;
|
||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
import static org.junit.jupiter.api.Assertions.fail;
|
||||
|
||||
import haveno.apitest.method.MethodTest;
|
||||
|
||||
@Disabled
|
||||
@Slf4j
|
||||
@TestMethodOrder(MethodOrderer.OrderAnnotation.class)
|
||||
|
|
|
@ -1,31 +1,30 @@
|
|||
package haveno.apitest.method.trade;
|
||||
|
||||
import haveno.proto.grpc.TradeInfo;
|
||||
import haveno.apitest.method.offer.AbstractOfferTest;
|
||||
import haveno.cli.CliMain;
|
||||
import haveno.cli.GrpcClient;
|
||||
import haveno.cli.table.builder.TableBuilder;
|
||||
import haveno.proto.grpc.TradeInfo;
|
||||
import lombok.Getter;
|
||||
import org.junit.jupiter.api.BeforeAll;
|
||||
import org.junit.jupiter.api.TestInfo;
|
||||
import org.slf4j.Logger;
|
||||
|
||||
import java.util.function.Function;
|
||||
import java.util.function.Predicate;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
|
||||
import lombok.Getter;
|
||||
|
||||
import org.junit.jupiter.api.BeforeAll;
|
||||
import org.junit.jupiter.api.TestInfo;
|
||||
|
||||
import static haveno.cli.table.builder.TableType.TRADE_DETAIL_TBL;
|
||||
import static haveno.core.trade.Trade.Phase.DEPOSITS_UNLOCKED;
|
||||
import static haveno.core.trade.Trade.Phase.PAYMENT_RECEIVED;
|
||||
import static haveno.core.trade.Trade.Phase.PAYMENT_SENT;
|
||||
import static haveno.core.trade.Trade.State.BUYER_SAW_ARRIVED_PAYMENT_SENT_MSG;
|
||||
import static haveno.core.trade.Trade.State.DEPOSIT_TXS_UNLOCKED_IN_BLOCKCHAIN;
|
||||
import static haveno.core.trade.Trade.State.SELLER_RECEIVED_PAYMENT_SENT_MSG;
|
||||
import static java.lang.String.format;
|
||||
import static java.lang.System.out;
|
||||
import static org.junit.jupiter.api.Assertions.*;
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import static org.junit.jupiter.api.Assertions.assertNotNull;
|
||||
import static org.junit.jupiter.api.Assertions.fail;
|
||||
|
||||
public class AbstractTradeTest extends AbstractOfferTest {
|
||||
|
||||
|
|
|
@ -17,10 +17,9 @@
|
|||
|
||||
package haveno.apitest.method.trade;
|
||||
|
||||
import haveno.core.payment.PaymentAccount;
|
||||
import io.grpc.StatusRuntimeException;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import org.junit.jupiter.api.Disabled;
|
||||
import org.junit.jupiter.api.MethodOrderer;
|
||||
import org.junit.jupiter.api.Order;
|
||||
|
@ -36,8 +35,6 @@ import static org.junit.jupiter.api.Assertions.fail;
|
|||
import static protobuf.OfferDirection.BUY;
|
||||
import static protobuf.OpenOffer.State.AVAILABLE;
|
||||
|
||||
import haveno.core.payment.PaymentAccount;
|
||||
|
||||
@Disabled
|
||||
@Slf4j
|
||||
@TestMethodOrder(MethodOrderer.OrderAnnotation.class)
|
||||
|
|
|
@ -34,10 +34,10 @@
|
|||
|
||||
package haveno.apitest.method.trade;
|
||||
|
||||
import haveno.core.payment.PaymentAccount;
|
||||
import haveno.core.payment.payload.NationalBankAccountPayload;
|
||||
import io.grpc.StatusRuntimeException;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import org.junit.jupiter.api.BeforeAll;
|
||||
import org.junit.jupiter.api.Disabled;
|
||||
import org.junit.jupiter.api.MethodOrderer;
|
||||
|
@ -46,17 +46,17 @@ import org.junit.jupiter.api.Test;
|
|||
import org.junit.jupiter.api.TestInfo;
|
||||
import org.junit.jupiter.api.TestMethodOrder;
|
||||
|
||||
import static haveno.apitest.config.ApiTestConfig.BTC;
|
||||
import static haveno.core.trade.Trade.Phase.PAYMENT_RECEIVED;
|
||||
import static haveno.core.trade.Trade.State.SELLER_SAW_ARRIVED_PAYMENT_RECEIVED_MSG;
|
||||
import static org.junit.jupiter.api.Assertions.*;
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import static org.junit.jupiter.api.Assertions.assertNotEquals;
|
||||
import static org.junit.jupiter.api.Assertions.assertNotNull;
|
||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
import static org.junit.jupiter.api.Assertions.fail;
|
||||
import static protobuf.Offer.State.OFFER_FEE_RESERVED;
|
||||
import static protobuf.OfferDirection.BUY;
|
||||
import static protobuf.OpenOffer.State.AVAILABLE;
|
||||
|
||||
import haveno.core.payment.PaymentAccount;
|
||||
import haveno.core.payment.payload.NationalBankAccountPayload;
|
||||
|
||||
/**
|
||||
* Test case verifies trade can be made with national bank payment method,
|
||||
* and json contracts exclude bank acct details until deposit tx is confirmed.
|
||||
|
|
|
@ -17,10 +17,10 @@
|
|||
|
||||
package haveno.apitest.method.trade;
|
||||
|
||||
import haveno.apitest.method.offer.AbstractOfferTest;
|
||||
import haveno.cli.table.builder.TableBuilder;
|
||||
import io.grpc.StatusRuntimeException;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import org.junit.jupiter.api.BeforeAll;
|
||||
import org.junit.jupiter.api.Disabled;
|
||||
import org.junit.jupiter.api.MethodOrderer;
|
||||
|
@ -38,9 +38,6 @@ import static org.junit.jupiter.api.Assertions.fail;
|
|||
import static protobuf.Offer.State.OFFER_FEE_RESERVED;
|
||||
import static protobuf.OfferDirection.SELL;
|
||||
|
||||
import haveno.apitest.method.offer.AbstractOfferTest;
|
||||
import haveno.cli.table.builder.TableBuilder;
|
||||
|
||||
@Disabled
|
||||
@Slf4j
|
||||
@TestMethodOrder(MethodOrderer.OrderAnnotation.class)
|
||||
|
|
|
@ -17,10 +17,9 @@
|
|||
|
||||
package haveno.apitest.method.trade;
|
||||
|
||||
import haveno.core.payment.PaymentAccount;
|
||||
import io.grpc.StatusRuntimeException;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import org.junit.jupiter.api.Disabled;
|
||||
import org.junit.jupiter.api.MethodOrderer;
|
||||
import org.junit.jupiter.api.Order;
|
||||
|
@ -30,18 +29,13 @@ import org.junit.jupiter.api.TestMethodOrder;
|
|||
|
||||
import static haveno.apitest.config.ApiTestConfig.BTC;
|
||||
import static haveno.apitest.config.ApiTestConfig.USD;
|
||||
import static haveno.core.trade.Trade.Phase.COMPLETED;
|
||||
import static haveno.core.trade.Trade.Phase.PAYMENT_RECEIVED;
|
||||
import static haveno.core.trade.Trade.State.SELLER_SAW_ARRIVED_PAYMENT_RECEIVED_MSG;
|
||||
import static haveno.core.trade.Trade.State.TRADE_COMPLETED;
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
import static org.junit.jupiter.api.Assertions.fail;
|
||||
import static protobuf.Offer.State.OFFER_FEE_RESERVED;
|
||||
import static protobuf.OfferDirection.SELL;
|
||||
|
||||
import haveno.core.payment.PaymentAccount;
|
||||
|
||||
@Disabled
|
||||
@Slf4j
|
||||
@TestMethodOrder(MethodOrderer.OrderAnnotation.class)
|
||||
|
|
|
@ -17,10 +17,10 @@
|
|||
|
||||
package haveno.apitest.method.trade;
|
||||
|
||||
import haveno.apitest.method.offer.AbstractOfferTest;
|
||||
import haveno.cli.table.builder.TableBuilder;
|
||||
import io.grpc.StatusRuntimeException;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import org.junit.jupiter.api.BeforeAll;
|
||||
import org.junit.jupiter.api.Disabled;
|
||||
import org.junit.jupiter.api.MethodOrderer;
|
||||
|
@ -38,9 +38,6 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
|
|||
import static org.junit.jupiter.api.Assertions.fail;
|
||||
import static protobuf.OfferDirection.BUY;
|
||||
|
||||
import haveno.apitest.method.offer.AbstractOfferTest;
|
||||
import haveno.cli.table.builder.TableBuilder;
|
||||
|
||||
@Disabled
|
||||
@Slf4j
|
||||
@TestMethodOrder(MethodOrderer.OrderAnnotation.class)
|
||||
|
|
|
@ -1,10 +1,9 @@
|
|||
package haveno.apitest.method.wallet;
|
||||
|
||||
import haveno.proto.grpc.BtcBalanceInfo;
|
||||
import haveno.apitest.method.MethodTest;
|
||||
import haveno.cli.table.builder.TableBuilder;
|
||||
import haveno.proto.grpc.BtcBalanceInfo;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import org.junit.jupiter.api.AfterAll;
|
||||
import org.junit.jupiter.api.BeforeAll;
|
||||
import org.junit.jupiter.api.Disabled;
|
||||
|
@ -22,8 +21,6 @@ import static haveno.apitest.method.wallet.WalletTestUtil.verifyBtcBalances;
|
|||
import static haveno.cli.table.builder.TableType.ADDRESS_BALANCE_TBL;
|
||||
import static haveno.cli.table.builder.TableType.BTC_BALANCE_TBL;
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import static org.junit.jupiter.api.Assertions.assertFalse;
|
||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||
import static org.junit.jupiter.api.MethodOrderer.OrderAnnotation;
|
||||
|
||||
@Disabled
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
package haveno.apitest.method.wallet;
|
||||
|
||||
import haveno.apitest.method.MethodTest;
|
||||
import io.grpc.StatusRuntimeException;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import org.junit.jupiter.api.AfterAll;
|
||||
import org.junit.jupiter.api.BeforeAll;
|
||||
import org.junit.jupiter.api.Disabled;
|
||||
|
@ -18,8 +17,6 @@ import static org.junit.jupiter.api.Assertions.assertThrows;
|
|||
import static org.junit.jupiter.api.Assertions.fail;
|
||||
import static org.junit.jupiter.api.MethodOrderer.OrderAnnotation;
|
||||
|
||||
import haveno.apitest.method.MethodTest;
|
||||
|
||||
@SuppressWarnings("ResultOfMethodCallIgnored")
|
||||
@Disabled
|
||||
@Slf4j
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
package haveno.apitest.method.wallet;
|
||||
|
||||
import haveno.proto.grpc.BtcBalanceInfo;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
|
|
|
@ -17,11 +17,10 @@
|
|||
|
||||
package haveno.apitest.scenario;
|
||||
|
||||
import haveno.proto.grpc.OfferInfo;
|
||||
import haveno.apitest.method.offer.AbstractOfferTest;
|
||||
import haveno.core.payment.PaymentAccount;
|
||||
import haveno.proto.grpc.OfferInfo;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import org.junit.jupiter.api.MethodOrderer;
|
||||
import org.junit.jupiter.api.Order;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
|
|
@ -17,8 +17,10 @@
|
|||
|
||||
package haveno.apitest.scenario;
|
||||
|
||||
import haveno.apitest.method.trade.AbstractTradeTest;
|
||||
import haveno.apitest.method.trade.TakeBuyBTCOfferTest;
|
||||
import haveno.apitest.method.trade.TakeSellBTCOfferTest;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import org.junit.jupiter.api.MethodOrderer;
|
||||
import org.junit.jupiter.api.Order;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
@ -28,10 +30,6 @@ import org.junit.jupiter.api.condition.EnabledIf;
|
|||
|
||||
import static java.lang.System.getenv;
|
||||
|
||||
import haveno.apitest.method.trade.AbstractTradeTest;
|
||||
import haveno.apitest.method.trade.TakeBuyBTCOfferTest;
|
||||
import haveno.apitest.method.trade.TakeSellBTCOfferTest;
|
||||
|
||||
@EnabledIf("envLongRunningTestEnabled")
|
||||
@Slf4j
|
||||
@TestMethodOrder(MethodOrderer.OrderAnnotation.class)
|
||||
|
|
|
@ -25,7 +25,6 @@ import haveno.apitest.method.offer.CreateOfferUsingMarketPriceMarginTest;
|
|||
import haveno.apitest.method.offer.CreateXMROffersTest;
|
||||
import haveno.apitest.method.offer.ValidateCreateOfferTest;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import org.junit.jupiter.api.BeforeAll;
|
||||
import org.junit.jupiter.api.MethodOrderer;
|
||||
import org.junit.jupiter.api.Order;
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
package haveno.apitest.scenario;
|
||||
|
||||
import haveno.apitest.method.payment.AbstractPaymentAccountTest;
|
||||
import haveno.apitest.method.payment.CreatePaymentAccountTest;
|
||||
import haveno.apitest.method.payment.GetPaymentMethodsTest;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import org.junit.jupiter.api.AfterAll;
|
||||
import org.junit.jupiter.api.BeforeAll;
|
||||
import org.junit.jupiter.api.MethodOrderer;
|
||||
|
@ -15,10 +17,6 @@ import static haveno.apitest.config.HavenoAppConfig.alicedaemon;
|
|||
import static haveno.apitest.config.HavenoAppConfig.seednode;
|
||||
import static org.junit.jupiter.api.Assertions.fail;
|
||||
|
||||
import haveno.apitest.method.payment.AbstractPaymentAccountTest;
|
||||
import haveno.apitest.method.payment.CreatePaymentAccountTest;
|
||||
import haveno.apitest.method.payment.GetPaymentMethodsTest;
|
||||
|
||||
@Slf4j
|
||||
@TestMethodOrder(MethodOrderer.OrderAnnotation.class)
|
||||
public class PaymentAccountTest extends AbstractPaymentAccountTest {
|
||||
|
|
|
@ -17,8 +17,14 @@
|
|||
|
||||
package haveno.apitest.scenario;
|
||||
|
||||
import haveno.apitest.config.ApiTestConfig;
|
||||
import haveno.apitest.method.BitcoinCliHelper;
|
||||
import haveno.apitest.scenario.bot.AbstractBotTest;
|
||||
import haveno.apitest.scenario.bot.BotClient;
|
||||
import haveno.apitest.scenario.bot.RobotBob;
|
||||
import haveno.apitest.scenario.bot.script.BashScriptGenerator;
|
||||
import haveno.apitest.scenario.bot.shutdown.ManualBotShutdownException;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import org.junit.jupiter.api.AfterAll;
|
||||
import org.junit.jupiter.api.BeforeAll;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
|
@ -36,14 +42,6 @@ import static haveno.apitest.config.HavenoAppConfig.seednode;
|
|||
import static haveno.apitest.scenario.bot.shutdown.ManualShutdown.startShutdownTimer;
|
||||
import static org.junit.jupiter.api.Assertions.fail;
|
||||
|
||||
import haveno.apitest.config.ApiTestConfig;
|
||||
import haveno.apitest.method.BitcoinCliHelper;
|
||||
import haveno.apitest.scenario.bot.AbstractBotTest;
|
||||
import haveno.apitest.scenario.bot.BotClient;
|
||||
import haveno.apitest.scenario.bot.RobotBob;
|
||||
import haveno.apitest.scenario.bot.script.BashScriptGenerator;
|
||||
import haveno.apitest.scenario.bot.shutdown.ManualBotShutdownException;
|
||||
|
||||
// The test case is enabled if AbstractBotTest#botScriptExists() returns true.
|
||||
@EnabledIf("botScriptExists")
|
||||
@Slf4j
|
||||
|
|
|
@ -17,11 +17,12 @@
|
|||
|
||||
package haveno.apitest.scenario;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
import haveno.apitest.method.CallRateMeteringInterceptorTest;
|
||||
import haveno.apitest.method.GetMethodHelpTest;
|
||||
import haveno.apitest.method.GetVersionTest;
|
||||
import haveno.apitest.method.MethodTest;
|
||||
import haveno.apitest.method.RegisterDisputeAgentsTest;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import org.junit.jupiter.api.AfterAll;
|
||||
import org.junit.jupiter.api.BeforeAll;
|
||||
import org.junit.jupiter.api.MethodOrderer;
|
||||
|
@ -29,6 +30,9 @@ import org.junit.jupiter.api.Order;
|
|||
import org.junit.jupiter.api.Test;
|
||||
import org.junit.jupiter.api.TestMethodOrder;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
import static haveno.apitest.Scaffold.BitcoinCoreApp.bitcoind;
|
||||
import static haveno.apitest.config.ApiTestRateMeterInterceptorConfig.getTestRateMeterInterceptorConfig;
|
||||
import static haveno.apitest.config.HavenoAppConfig.alicedaemon;
|
||||
|
@ -37,12 +41,6 @@ import static haveno.apitest.config.HavenoAppConfig.seednode;
|
|||
import static haveno.common.file.FileUtil.deleteFileIfExists;
|
||||
import static org.junit.jupiter.api.Assertions.fail;
|
||||
|
||||
import haveno.apitest.method.CallRateMeteringInterceptorTest;
|
||||
import haveno.apitest.method.GetMethodHelpTest;
|
||||
import haveno.apitest.method.GetVersionTest;
|
||||
import haveno.apitest.method.MethodTest;
|
||||
import haveno.apitest.method.RegisterDisputeAgentsTest;
|
||||
|
||||
|
||||
@Slf4j
|
||||
@TestMethodOrder(MethodOrderer.OrderAnnotation.class)
|
||||
|
|
|
@ -24,7 +24,6 @@ import haveno.apitest.method.trade.TakeBuyXMROfferTest;
|
|||
import haveno.apitest.method.trade.TakeSellBTCOfferTest;
|
||||
import haveno.apitest.method.trade.TakeSellXMROfferTest;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.MethodOrderer;
|
||||
import org.junit.jupiter.api.Order;
|
||||
|
|
|
@ -17,8 +17,10 @@
|
|||
|
||||
package haveno.apitest.scenario;
|
||||
|
||||
import haveno.apitest.method.MethodTest;
|
||||
import haveno.apitest.method.wallet.BtcWalletTest;
|
||||
import haveno.apitest.method.wallet.WalletProtectionTest;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import org.junit.jupiter.api.AfterAll;
|
||||
import org.junit.jupiter.api.BeforeAll;
|
||||
import org.junit.jupiter.api.MethodOrderer;
|
||||
|
@ -33,10 +35,6 @@ import static haveno.apitest.config.HavenoAppConfig.arbdaemon;
|
|||
import static haveno.apitest.config.HavenoAppConfig.bobdaemon;
|
||||
import static haveno.apitest.config.HavenoAppConfig.seednode;
|
||||
|
||||
import haveno.apitest.method.MethodTest;
|
||||
import haveno.apitest.method.wallet.BtcWalletTest;
|
||||
import haveno.apitest.method.wallet.WalletProtectionTest;
|
||||
|
||||
@Slf4j
|
||||
@TestMethodOrder(MethodOrderer.OrderAnnotation.class)
|
||||
public class WalletTest extends MethodTest {
|
||||
|
|
|
@ -17,19 +17,17 @@
|
|||
|
||||
package haveno.apitest.scenario.bot;
|
||||
|
||||
import protobuf.PaymentAccount;
|
||||
|
||||
import com.google.gson.GsonBuilder;
|
||||
import haveno.apitest.method.MethodTest;
|
||||
import haveno.apitest.scenario.bot.script.BashScriptGenerator;
|
||||
import haveno.apitest.scenario.bot.script.BotScript;
|
||||
import haveno.core.locale.Country;
|
||||
import java.nio.file.Paths;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import protobuf.PaymentAccount;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import java.nio.file.Paths;
|
||||
|
||||
import static haveno.core.locale.CountryUtil.findCountryByCode;
|
||||
import static haveno.core.payment.payload.PaymentMethod.CLEAR_X_CHANGE_ID;
|
||||
|
|
|
@ -4,9 +4,8 @@ import haveno.apitest.method.BitcoinCliHelper;
|
|||
import haveno.apitest.scenario.bot.script.BashScriptGenerator;
|
||||
import haveno.apitest.scenario.bot.script.BotScript;
|
||||
import haveno.core.locale.Country;
|
||||
import protobuf.PaymentAccount;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import protobuf.PaymentAccount;
|
||||
|
||||
import static haveno.core.locale.CountryUtil.findCountryByCode;
|
||||
import static haveno.core.payment.payload.PaymentMethod.CLEAR_X_CHANGE_ID;
|
||||
|
|
|
@ -17,21 +17,18 @@
|
|||
|
||||
package haveno.apitest.scenario.bot;
|
||||
|
||||
import haveno.cli.GrpcClient;
|
||||
import haveno.proto.grpc.BalancesInfo;
|
||||
import haveno.proto.grpc.GetPaymentAccountsRequest;
|
||||
import haveno.proto.grpc.OfferInfo;
|
||||
import haveno.proto.grpc.TradeInfo;
|
||||
import haveno.cli.GrpcClient;
|
||||
import haveno.core.api.model.PaymentAccountForm;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import protobuf.PaymentAccount;
|
||||
|
||||
import java.text.DecimalFormat;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.function.BiPredicate;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import static org.apache.commons.lang3.StringUtils.capitalize;
|
||||
|
||||
/**
|
||||
|
|
|
@ -1,19 +1,17 @@
|
|||
package haveno.apitest.scenario.bot;
|
||||
|
||||
import protobuf.PaymentAccount;
|
||||
|
||||
import static haveno.core.payment.payload.PaymentMethod.CLEAR_X_CHANGE_ID;
|
||||
import static haveno.core.payment.payload.PaymentMethod.F2F_ID;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import com.google.gson.GsonBuilder;
|
||||
import haveno.core.api.model.PaymentAccountForm;
|
||||
import haveno.core.locale.Country;
|
||||
import java.io.File;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import protobuf.PaymentAccount;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.Map;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import static haveno.core.payment.payload.PaymentMethod.CLEAR_X_CHANGE_ID;
|
||||
import static haveno.core.payment.payload.PaymentMethod.F2F_ID;
|
||||
|
||||
@Slf4j
|
||||
public class BotPaymentAccountGenerator {
|
||||
|
|
|
@ -18,20 +18,15 @@
|
|||
package haveno.apitest.scenario.bot;
|
||||
|
||||
import haveno.proto.grpc.OfferInfo;
|
||||
|
||||
import protobuf.PaymentAccount;
|
||||
|
||||
import java.security.SecureRandom;
|
||||
|
||||
import java.text.DecimalFormat;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
import java.util.Objects;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import protobuf.PaymentAccount;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.security.SecureRandom;
|
||||
import java.text.DecimalFormat;
|
||||
import java.util.Objects;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
import static haveno.apitest.method.offer.AbstractOfferTest.defaultBuyerSecurityDepositPct;
|
||||
import static haveno.cli.CurrencyFormat.formatInternalFiatPrice;
|
||||
|
|
|
@ -17,14 +17,6 @@
|
|||
|
||||
package haveno.apitest.scenario.bot;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import static haveno.apitest.scenario.bot.protocol.ProtocolStep.DONE;
|
||||
import static haveno.apitest.scenario.bot.shutdown.ManualShutdown.isShutdownCalled;
|
||||
import static haveno.cli.table.builder.TableType.BTC_BALANCE_TBL;
|
||||
import static java.util.concurrent.TimeUnit.SECONDS;
|
||||
|
||||
import haveno.apitest.method.BitcoinCliHelper;
|
||||
import haveno.apitest.scenario.bot.protocol.BotProtocol;
|
||||
import haveno.apitest.scenario.bot.protocol.MakerBotProtocol;
|
||||
|
@ -33,6 +25,13 @@ import haveno.apitest.scenario.bot.script.BashScriptGenerator;
|
|||
import haveno.apitest.scenario.bot.script.BotScript;
|
||||
import haveno.apitest.scenario.bot.shutdown.ManualBotShutdownException;
|
||||
import haveno.cli.table.builder.TableBuilder;
|
||||
import lombok.Getter;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import static haveno.apitest.scenario.bot.protocol.ProtocolStep.DONE;
|
||||
import static haveno.apitest.scenario.bot.shutdown.ManualShutdown.isShutdownCalled;
|
||||
import static haveno.cli.table.builder.TableType.BTC_BALANCE_TBL;
|
||||
import static java.util.concurrent.TimeUnit.SECONDS;
|
||||
|
||||
@Slf4j
|
||||
public
|
||||
|
|
|
@ -18,18 +18,18 @@
|
|||
package haveno.apitest.scenario.bot.protocol;
|
||||
|
||||
|
||||
import haveno.proto.grpc.TradeInfo;
|
||||
import haveno.apitest.method.BitcoinCliHelper;
|
||||
import haveno.apitest.scenario.bot.BotClient;
|
||||
import haveno.apitest.scenario.bot.script.BashScriptGenerator;
|
||||
import haveno.apitest.scenario.bot.shutdown.ManualBotShutdownException;
|
||||
import haveno.cli.table.builder.TableBuilder;
|
||||
import haveno.proto.grpc.TradeInfo;
|
||||
import lombok.Getter;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import protobuf.PaymentAccount;
|
||||
|
||||
import java.security.SecureRandom;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
import java.security.SecureRandom;
|
||||
import java.util.Objects;
|
||||
import java.util.concurrent.atomic.AtomicLong;
|
||||
import java.util.function.Consumer;
|
||||
|
@ -38,10 +38,14 @@ import java.util.function.Predicate;
|
|||
import java.util.function.Supplier;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import static haveno.apitest.scenario.bot.protocol.ProtocolStep.*;
|
||||
import static haveno.apitest.scenario.bot.protocol.ProtocolStep.SEND_PAYMENT_RECEIVED_CONFIRMATION_MESSAGE;
|
||||
import static haveno.apitest.scenario.bot.protocol.ProtocolStep.SEND_PAYMENT_SENT_MESSAGE;
|
||||
import static haveno.apitest.scenario.bot.protocol.ProtocolStep.START;
|
||||
import static haveno.apitest.scenario.bot.protocol.ProtocolStep.WAIT_FOR_PAYMENT_RECEIVED_CONFIRMATION_MESSAGE;
|
||||
import static haveno.apitest.scenario.bot.protocol.ProtocolStep.WAIT_FOR_PAYMENT_SENT_MESSAGE;
|
||||
import static haveno.apitest.scenario.bot.protocol.ProtocolStep.WAIT_FOR_PAYOUT_TX;
|
||||
import static haveno.apitest.scenario.bot.protocol.ProtocolStep.WAIT_FOR_TAKER_DEPOSIT_TX_CONFIRMED;
|
||||
import static haveno.apitest.scenario.bot.protocol.ProtocolStep.WAIT_FOR_TAKER_DEPOSIT_TX_PUBLISHED;
|
||||
import static haveno.apitest.scenario.bot.shutdown.ManualShutdown.checkIfShutdownCalled;
|
||||
import static haveno.cli.table.builder.TableType.TRADE_DETAIL_TBL;
|
||||
import static java.lang.String.format;
|
||||
|
|
|
@ -1,23 +1,21 @@
|
|||
package haveno.apitest.scenario.bot.protocol;
|
||||
|
||||
import haveno.proto.grpc.OfferInfo;
|
||||
import haveno.proto.grpc.TradeInfo;
|
||||
import haveno.apitest.method.BitcoinCliHelper;
|
||||
import haveno.apitest.scenario.bot.BotClient;
|
||||
import haveno.apitest.scenario.bot.RandomOffer;
|
||||
import haveno.apitest.scenario.bot.script.BashScriptGenerator;
|
||||
import haveno.apitest.scenario.bot.shutdown.ManualBotShutdownException;
|
||||
import haveno.cli.table.builder.TableBuilder;
|
||||
import haveno.proto.grpc.OfferInfo;
|
||||
import haveno.proto.grpc.TradeInfo;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import protobuf.PaymentAccount;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
import java.util.Optional;
|
||||
import java.util.function.Function;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import static haveno.apitest.scenario.bot.protocol.ProtocolStep.DONE;
|
||||
import static haveno.apitest.scenario.bot.protocol.ProtocolStep.WAIT_FOR_OFFER_TAKER;
|
||||
import static haveno.apitest.scenario.bot.shutdown.ManualShutdown.checkIfShutdownCalled;
|
||||
|
|
|
@ -1,22 +1,20 @@
|
|||
package haveno.apitest.scenario.bot.protocol;
|
||||
|
||||
import haveno.proto.grpc.OfferInfo;
|
||||
import haveno.proto.grpc.TradeInfo;
|
||||
import haveno.apitest.method.BitcoinCliHelper;
|
||||
import haveno.apitest.scenario.bot.BotClient;
|
||||
import haveno.apitest.scenario.bot.script.BashScriptGenerator;
|
||||
import haveno.apitest.scenario.bot.shutdown.ManualBotShutdownException;
|
||||
import haveno.cli.table.builder.TableBuilder;
|
||||
import haveno.proto.grpc.OfferInfo;
|
||||
import haveno.proto.grpc.TradeInfo;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import protobuf.PaymentAccount;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
import java.util.Optional;
|
||||
import java.util.function.Function;
|
||||
import java.util.function.Supplier;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import static haveno.apitest.scenario.bot.protocol.ProtocolStep.DONE;
|
||||
import static haveno.apitest.scenario.bot.protocol.ProtocolStep.FIND_OFFER;
|
||||
import static haveno.apitest.scenario.bot.protocol.ProtocolStep.TAKE_OFFER;
|
||||
|
|
|
@ -17,23 +17,20 @@
|
|||
|
||||
package haveno.apitest.scenario.bot.script;
|
||||
|
||||
import haveno.proto.grpc.OfferInfo;
|
||||
import haveno.proto.grpc.TradeInfo;
|
||||
|
||||
import com.google.common.io.Files;
|
||||
import haveno.common.file.FileUtil;
|
||||
import java.nio.file.Paths;
|
||||
import haveno.proto.grpc.OfferInfo;
|
||||
import haveno.proto.grpc.TradeInfo;
|
||||
import lombok.Getter;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
import java.nio.file.Paths;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import static com.google.common.io.FileWriteMode.APPEND;
|
||||
import static java.lang.String.format;
|
||||
import static java.lang.System.getProperty;
|
||||
|
|
|
@ -23,14 +23,12 @@ import joptsimple.BuiltinHelpFormatter;
|
|||
import joptsimple.OptionParser;
|
||||
import joptsimple.OptionSet;
|
||||
import joptsimple.OptionSpec;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.PrintStream;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.io.PrintStream;
|
||||
|
||||
import static java.lang.System.err;
|
||||
import static java.lang.System.exit;
|
||||
|
|
|
@ -1,17 +1,15 @@
|
|||
package haveno.apitest.scenario.bot.shutdown;
|
||||
|
||||
import haveno.common.UserThread;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
|
||||
import java.util.concurrent.atomic.AtomicBoolean;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
import static haveno.common.file.FileUtil.deleteFileIfExists;
|
||||
import static java.util.concurrent.TimeUnit.MILLISECONDS;
|
||||
|
||||
import haveno.common.UserThread;
|
||||
|
||||
@Slf4j
|
||||
public class ManualShutdown {
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue