diff --git a/apitest/src/test/java/bisq/apitest/method/CreatePaymentAccountTest.java b/apitest/src/test/java/bisq/apitest/method/CreatePaymentAccountTest.java
index 661205c74d..9e8b0af878 100644
--- a/apitest/src/test/java/bisq/apitest/method/CreatePaymentAccountTest.java
+++ b/apitest/src/test/java/bisq/apitest/method/CreatePaymentAccountTest.java
@@ -29,6 +29,7 @@ import lombok.extern.slf4j.Slf4j;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Order;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.TestMethodOrder;
@@ -40,7 +41,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.fail;
import static org.junit.jupiter.api.MethodOrderer.OrderAnnotation;
-
+@Disabled
@Slf4j
@TestMethodOrder(OrderAnnotation.class)
public class CreatePaymentAccountTest extends MethodTest {
diff --git a/apitest/src/test/java/bisq/apitest/method/GetBalanceTest.java b/apitest/src/test/java/bisq/apitest/method/GetBalanceTest.java
index abce9a78a6..1d44590837 100644
--- a/apitest/src/test/java/bisq/apitest/method/GetBalanceTest.java
+++ b/apitest/src/test/java/bisq/apitest/method/GetBalanceTest.java
@@ -23,6 +23,7 @@ import lombok.extern.slf4j.Slf4j;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Order;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.TestMethodOrder;
@@ -35,7 +36,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.fail;
import static org.junit.jupiter.api.MethodOrderer.OrderAnnotation;
-
+@Disabled
@Slf4j
@TestMethodOrder(OrderAnnotation.class)
public class GetBalanceTest extends MethodTest {
diff --git a/apitest/src/test/java/bisq/apitest/method/GetVersionTest.java b/apitest/src/test/java/bisq/apitest/method/GetVersionTest.java
index 82780340ee..212eb5ca43 100644
--- a/apitest/src/test/java/bisq/apitest/method/GetVersionTest.java
+++ b/apitest/src/test/java/bisq/apitest/method/GetVersionTest.java
@@ -23,6 +23,7 @@ import lombok.extern.slf4j.Slf4j;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Order;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.TestMethodOrder;
@@ -33,7 +34,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.fail;
import static org.junit.jupiter.api.MethodOrderer.OrderAnnotation;
-
+@Disabled
@Slf4j
@TestMethodOrder(OrderAnnotation.class)
public class GetVersionTest extends MethodTest {
diff --git a/apitest/src/test/java/bisq/apitest/method/MethodTest.java b/apitest/src/test/java/bisq/apitest/method/MethodTest.java
index 6b21d76fb4..43073ba995 100644
--- a/apitest/src/test/java/bisq/apitest/method/MethodTest.java
+++ b/apitest/src/test/java/bisq/apitest/method/MethodTest.java
@@ -96,7 +96,6 @@ public class MethodTest extends ApiTestCase {
// show 10 BTC balance, and allow time for daemons parse the new block.
if (generateBtcBlock)
genBtcBlocksThenWait(1, 1500);
-
} catch (Exception ex) {
fail(ex);
}
diff --git a/apitest/src/test/java/bisq/apitest/method/RegisterDisputeAgentsTest.java b/apitest/src/test/java/bisq/apitest/method/RegisterDisputeAgentsTest.java
index 379fbc3a00..746c851b4d 100644
--- a/apitest/src/test/java/bisq/apitest/method/RegisterDisputeAgentsTest.java
+++ b/apitest/src/test/java/bisq/apitest/method/RegisterDisputeAgentsTest.java
@@ -25,6 +25,7 @@ import lombok.extern.slf4j.Slf4j;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Order;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.TestMethodOrder;
@@ -40,6 +41,7 @@ import static org.junit.jupiter.api.MethodOrderer.OrderAnnotation;
@SuppressWarnings("ResultOfMethodCallIgnored")
+@Disabled
@Slf4j
@TestMethodOrder(OrderAnnotation.class)
public class RegisterDisputeAgentsTest extends MethodTest {
diff --git a/apitest/src/test/java/bisq/apitest/method/WalletProtectionTest.java b/apitest/src/test/java/bisq/apitest/method/WalletProtectionTest.java
index 61f3c27e4a..08547e9ebb 100644
--- a/apitest/src/test/java/bisq/apitest/method/WalletProtectionTest.java
+++ b/apitest/src/test/java/bisq/apitest/method/WalletProtectionTest.java
@@ -6,6 +6,7 @@ import lombok.extern.slf4j.Slf4j;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;
+import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Order;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.TestMethodOrder;
@@ -18,6 +19,7 @@ import static org.junit.jupiter.api.Assertions.fail;
import static org.junit.jupiter.api.MethodOrderer.OrderAnnotation;
@SuppressWarnings("ResultOfMethodCallIgnored")
+@Disabled
@Slf4j
@TestMethodOrder(OrderAnnotation.class)
public class WalletProtectionTest extends MethodTest {
diff --git a/apitest/src/test/java/bisq/apitest/method/offer/CancelOfferTest.java b/apitest/src/test/java/bisq/apitest/method/offer/CancelOfferTest.java
index 6affb9ac38..334fb022bb 100644
--- a/apitest/src/test/java/bisq/apitest/method/offer/CancelOfferTest.java
+++ b/apitest/src/test/java/bisq/apitest/method/offer/CancelOfferTest.java
@@ -26,6 +26,7 @@ import java.util.List;
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;
@@ -33,7 +34,7 @@ import org.junit.jupiter.api.TestMethodOrder;
import static org.junit.jupiter.api.Assertions.assertEquals;
-
+@Disabled
@Slf4j
@TestMethodOrder(MethodOrderer.OrderAnnotation.class)
public class CancelOfferTest extends AbstractOfferTest {
diff --git a/apitest/src/test/java/bisq/apitest/method/offer/CreateOfferUsingFixedPriceTest.java b/apitest/src/test/java/bisq/apitest/method/offer/CreateOfferUsingFixedPriceTest.java
index 10ca6c9e4c..72ff91f311 100644
--- a/apitest/src/test/java/bisq/apitest/method/offer/CreateOfferUsingFixedPriceTest.java
+++ b/apitest/src/test/java/bisq/apitest/method/offer/CreateOfferUsingFixedPriceTest.java
@@ -23,6 +23,7 @@ import bisq.proto.grpc.CreateOfferRequest;
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;
@@ -32,11 +33,11 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertNotEquals;
+@Disabled
@Slf4j
@TestMethodOrder(MethodOrderer.OrderAnnotation.class)
public class CreateOfferUsingFixedPriceTest extends AbstractOfferTest {
-
@Test
@Order(1)
public void testCreateAUDBTCBuyOfferUsingFixedPrice16000() {
diff --git a/apitest/src/test/java/bisq/apitest/method/offer/CreateOfferUsingMarketPriceMarginTest.java b/apitest/src/test/java/bisq/apitest/method/offer/CreateOfferUsingMarketPriceMarginTest.java
index b0c017baff..345bd130d7 100644
--- a/apitest/src/test/java/bisq/apitest/method/offer/CreateOfferUsingMarketPriceMarginTest.java
+++ b/apitest/src/test/java/bisq/apitest/method/offer/CreateOfferUsingMarketPriceMarginTest.java
@@ -26,6 +26,7 @@ import java.text.DecimalFormat;
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;
@@ -40,6 +41,7 @@ import static org.junit.jupiter.api.Assertions.assertNotEquals;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static protobuf.OfferPayload.Direction.BUY;
+@Disabled
@Slf4j
@TestMethodOrder(MethodOrderer.OrderAnnotation.class)
public class CreateOfferUsingMarketPriceMarginTest extends AbstractOfferTest {
diff --git a/apitest/src/test/java/bisq/apitest/method/offer/ValidateCreateOfferTest.java b/apitest/src/test/java/bisq/apitest/method/offer/ValidateCreateOfferTest.java
index ecf09b1e42..3ddd8cb303 100644
--- a/apitest/src/test/java/bisq/apitest/method/offer/ValidateCreateOfferTest.java
+++ b/apitest/src/test/java/bisq/apitest/method/offer/ValidateCreateOfferTest.java
@@ -25,6 +25,7 @@ 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;
@@ -33,6 +34,7 @@ import org.junit.jupiter.api.TestMethodOrder;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertThrows;
+@Disabled
@Slf4j
@TestMethodOrder(MethodOrderer.OrderAnnotation.class)
public class ValidateCreateOfferTest extends AbstractOfferTest {
diff --git a/apitest/src/test/java/bisq/apitest/method/trade/TakeBuyBTCOfferTest.java b/apitest/src/test/java/bisq/apitest/method/trade/TakeBuyBTCOfferTest.java
index bb7d8ea823..3561787c45 100644
--- a/apitest/src/test/java/bisq/apitest/method/trade/TakeBuyBTCOfferTest.java
+++ b/apitest/src/test/java/bisq/apitest/method/trade/TakeBuyBTCOfferTest.java
@@ -21,6 +21,7 @@ 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;
@@ -41,6 +42,7 @@ import static org.junit.jupiter.api.Assertions.fail;
import static protobuf.Offer.State.OFFER_FEE_PAID;
import static protobuf.OpenOffer.State.AVAILABLE;
+@Disabled
@Slf4j
@TestMethodOrder(MethodOrderer.OrderAnnotation.class)
public class TakeBuyBTCOfferTest extends AbstractTradeTest {
diff --git a/apitest/src/test/java/bisq/apitest/method/trade/TakeSellBTCOfferTest.java b/apitest/src/test/java/bisq/apitest/method/trade/TakeSellBTCOfferTest.java
index c1786082ba..35e13c002f 100644
--- a/apitest/src/test/java/bisq/apitest/method/trade/TakeSellBTCOfferTest.java
+++ b/apitest/src/test/java/bisq/apitest/method/trade/TakeSellBTCOfferTest.java
@@ -21,6 +21,7 @@ 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;
@@ -38,6 +39,7 @@ import static org.junit.jupiter.api.Assertions.fail;
import static protobuf.Offer.State.OFFER_FEE_PAID;
import static protobuf.OpenOffer.State.AVAILABLE;
+@Disabled
@Slf4j
@TestMethodOrder(MethodOrderer.OrderAnnotation.class)
public class TakeSellBTCOfferTest extends AbstractTradeTest {
diff --git a/apitest/src/test/java/bisq/apitest/scenario/OfferTest.java b/apitest/src/test/java/bisq/apitest/scenario/OfferTest.java
new file mode 100644
index 0000000000..b01a9486ea
--- /dev/null
+++ b/apitest/src/test/java/bisq/apitest/scenario/OfferTest.java
@@ -0,0 +1,72 @@
+/*
+ * This file is part of Bisq.
+ *
+ * Bisq is free software: you can redistribute it and/or modify it
+ * under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or (at
+ * your option) any later version.
+ *
+ * Bisq is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with Bisq. If not, see .
+ */
+
+package bisq.apitest.scenario;
+
+
+import lombok.extern.slf4j.Slf4j;
+
+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 bisq.apitest.method.offer.AbstractOfferTest;
+import bisq.apitest.method.offer.CancelOfferTest;
+import bisq.apitest.method.offer.CreateOfferUsingFixedPriceTest;
+import bisq.apitest.method.offer.CreateOfferUsingMarketPriceMarginTest;
+import bisq.apitest.method.offer.ValidateCreateOfferTest;
+
+@Slf4j
+@TestMethodOrder(MethodOrderer.OrderAnnotation.class)
+public class OfferTest extends AbstractOfferTest {
+
+ @Test
+ @Order(1)
+ public void testAmtTooLargeShouldThrowException() {
+ ValidateCreateOfferTest test = new ValidateCreateOfferTest();
+ test.testAmtTooLargeShouldThrowException();
+ }
+
+ @Test
+ @Order(2)
+ public void testCancelOffer() {
+ CancelOfferTest test = new CancelOfferTest();
+ test.testCancelOffer();
+ }
+
+ @Test
+ @Order(3)
+ public void testCreateOfferUsingFixedPrice() {
+ CreateOfferUsingFixedPriceTest test = new CreateOfferUsingFixedPriceTest();
+ test.testCreateAUDBTCBuyOfferUsingFixedPrice16000();
+ test.testCreateUSDBTCBuyOfferUsingFixedPrice100001234();
+ test.testCreateEURBTCSellOfferUsingFixedPrice95001234();
+ }
+
+ @Test
+ @Order(4)
+ public void testCreateOfferUsingMarketPriceMargin() {
+ CreateOfferUsingMarketPriceMarginTest test = new CreateOfferUsingMarketPriceMarginTest();
+ test.testCreateUSDBTCBuyOffer5PctPriceMargin();
+ test.testCreateNZDBTCBuyOfferMinus2PctPriceMargin();
+ test.testCreateGBPBTCSellOfferMinus1Point5PctPriceMargin();
+ test.testCreateBRLBTCSellOffer6Point55PctPriceMargin();
+ }
+}
diff --git a/apitest/src/test/java/bisq/apitest/scenario/StartupTest.java b/apitest/src/test/java/bisq/apitest/scenario/StartupTest.java
new file mode 100644
index 0000000000..fa81ddff6b
--- /dev/null
+++ b/apitest/src/test/java/bisq/apitest/scenario/StartupTest.java
@@ -0,0 +1,85 @@
+/*
+ * This file is part of Bisq.
+ *
+ * Bisq is free software: you can redistribute it and/or modify it
+ * under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or (at
+ * your option) any later version.
+ *
+ * Bisq is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with Bisq. If not, see .
+ */
+
+package bisq.apitest.scenario;
+
+import lombok.extern.slf4j.Slf4j;
+
+import org.junit.jupiter.api.AfterAll;
+import org.junit.jupiter.api.BeforeAll;
+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 bisq.apitest.Scaffold.BitcoinCoreApp.bitcoind;
+import static bisq.apitest.config.BisqAppConfig.alicedaemon;
+import static bisq.apitest.config.BisqAppConfig.arbdaemon;
+import static bisq.apitest.config.BisqAppConfig.seednode;
+import static org.junit.jupiter.api.Assertions.fail;
+
+
+
+import bisq.apitest.method.CreatePaymentAccountTest;
+import bisq.apitest.method.GetVersionTest;
+import bisq.apitest.method.MethodTest;
+import bisq.apitest.method.RegisterDisputeAgentsTest;
+
+
+@Slf4j
+@TestMethodOrder(MethodOrderer.OrderAnnotation.class)
+public class StartupTest extends MethodTest {
+
+ @BeforeAll
+ public static void setUp() {
+ try {
+ setUpScaffold(bitcoind, seednode, arbdaemon, alicedaemon);
+ } catch (Exception ex) {
+ fail(ex);
+ }
+ }
+
+ @Test
+ @Order(1)
+ public void testGetVersion() {
+ GetVersionTest test = new GetVersionTest();
+ test.testGetVersion();
+ }
+
+ @Test
+ @Order(2)
+ public void testRegisterDisputeAgents() {
+ RegisterDisputeAgentsTest test = new RegisterDisputeAgentsTest();
+ test.testRegisterArbitratorShouldThrowException();
+ test.testInvalidDisputeAgentTypeArgShouldThrowException();
+ test.testInvalidRegistrationKeyArgShouldThrowException();
+ test.testRegisterMediator();
+ test.testRegisterRefundAgent();
+ }
+
+ @Test
+ @Order(3)
+ public void testCreatePaymentAccount() {
+ CreatePaymentAccountTest test = new CreatePaymentAccountTest();
+ test.testCreatePerfectMoneyUSDPaymentAccount();
+ }
+
+ @AfterAll
+ public static void tearDown() {
+ tearDownScaffold();
+ }
+}
diff --git a/apitest/src/test/java/bisq/apitest/scenario/TradeTest.java b/apitest/src/test/java/bisq/apitest/scenario/TradeTest.java
new file mode 100644
index 0000000000..4c07452abc
--- /dev/null
+++ b/apitest/src/test/java/bisq/apitest/scenario/TradeTest.java
@@ -0,0 +1,64 @@
+/*
+ * This file is part of Bisq.
+ *
+ * Bisq is free software: you can redistribute it and/or modify it
+ * under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or (at
+ * your option) any later version.
+ *
+ * Bisq is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with Bisq. If not, see .
+ */
+
+package bisq.apitest.scenario;
+
+import lombok.extern.slf4j.Slf4j;
+
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.MethodOrderer;
+import org.junit.jupiter.api.Order;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.api.TestInfo;
+import org.junit.jupiter.api.TestMethodOrder;
+
+
+
+import bisq.apitest.method.trade.AbstractTradeTest;
+import bisq.apitest.method.trade.TakeBuyBTCOfferTest;
+import bisq.apitest.method.trade.TakeSellBTCOfferTest;
+
+
+@Slf4j
+@TestMethodOrder(MethodOrderer.OrderAnnotation.class)
+public class TradeTest extends AbstractTradeTest {
+
+ @BeforeEach
+ public void init() {
+ EXPECTED_PROTOCOL_STATUS.init();
+ }
+
+ @Test
+ @Order(1)
+ public void testTakeBuyBTCOffer(final TestInfo testInfo) {
+ TakeBuyBTCOfferTest test = new TakeBuyBTCOfferTest();
+ test.testTakeAlicesBuyOffer(testInfo);
+ test.testAlicesConfirmPaymentStarted(testInfo);
+ test.testBobsConfirmPaymentReceived(testInfo);
+ test.testAlicesKeepFunds(testInfo);
+ }
+
+ @Test
+ @Order(2)
+ public void testTakeSellBTCOffer(final TestInfo testInfo) {
+ TakeSellBTCOfferTest test = new TakeSellBTCOfferTest();
+ test.testTakeAlicesSellOffer(testInfo);
+ test.testBobsConfirmPaymentStarted(testInfo);
+ test.testAlicesConfirmPaymentReceived(testInfo);
+ test.testBobsBtcWithdrawalToExternalAddress(testInfo);
+ }
+}
diff --git a/apitest/src/test/java/bisq/apitest/scenario/WalletTest.java b/apitest/src/test/java/bisq/apitest/scenario/WalletTest.java
new file mode 100644
index 0000000000..ecd38dc229
--- /dev/null
+++ b/apitest/src/test/java/bisq/apitest/scenario/WalletTest.java
@@ -0,0 +1,99 @@
+/*
+ * This file is part of Bisq.
+ *
+ * Bisq is free software: you can redistribute it and/or modify it
+ * under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or (at
+ * your option) any later version.
+ *
+ * Bisq is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public
+ * License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with Bisq. If not, see .
+ */
+
+package bisq.apitest.scenario;
+
+import lombok.extern.slf4j.Slf4j;
+
+import org.junit.jupiter.api.AfterAll;
+import org.junit.jupiter.api.BeforeAll;
+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 bisq.apitest.Scaffold.BitcoinCoreApp.bitcoind;
+import static bisq.apitest.config.BisqAppConfig.alicedaemon;
+import static bisq.apitest.config.BisqAppConfig.seednode;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.fail;
+
+
+
+import bisq.apitest.method.MethodTest;
+import bisq.apitest.method.WalletProtectionTest;
+
+@Slf4j
+@TestMethodOrder(MethodOrderer.OrderAnnotation.class)
+public class WalletTest extends MethodTest {
+
+ // All tests depend on the DAO / regtest environment, and Alice's wallet is
+ // initialized with 10 BTC during the scaffolding setup.
+
+ @BeforeAll
+ public static void setUp() {
+ try {
+ setUpScaffold(bitcoind, seednode, alicedaemon);
+ genBtcBlocksThenWait(1, 1500);
+ } catch (Exception ex) {
+ fail(ex);
+ }
+ }
+
+ @Test
+ @Order(1)
+ public void testFundWallet() {
+ // The regtest Bisq wallet was initialized with 10 BTC.
+ long balance = getBalance(alicedaemon);
+ assertEquals(1000000000, balance);
+
+ String unusedAddress = getUnusedBtcAddress(alicedaemon);
+ bitcoinCli.sendToAddress(unusedAddress, "2.5");
+
+ bitcoinCli.generateBlocks(1);
+ sleep(1500);
+
+ balance = getBalance(alicedaemon);
+ assertEquals(1250000000L, balance); // new balance is 12.5 btc
+ }
+
+ @Test
+ @Order(2)
+ public void testWalletProtection() {
+ // Batching all wallet tests in this test case reduces scaffold setup
+ // time. Here, we create a method WalletProtectionTest instance and run each
+ // test in declared order.
+
+ WalletProtectionTest walletProtectionTest = new WalletProtectionTest();
+
+ walletProtectionTest.testSetWalletPassword();
+ walletProtectionTest.testGetBalanceOnEncryptedWalletShouldThrowException();
+ walletProtectionTest.testUnlockWalletFor4Seconds();
+ walletProtectionTest.testGetBalanceAfterUnlockTimeExpiryShouldThrowException();
+ walletProtectionTest.testLockWalletBeforeUnlockTimeoutExpiry();
+ walletProtectionTest.testLockWalletWhenWalletAlreadyLockedShouldThrowException();
+ walletProtectionTest.testUnlockWalletTimeoutOverride();
+ walletProtectionTest.testSetNewWalletPassword();
+ walletProtectionTest.testSetNewWalletPasswordWithIncorrectNewPasswordShouldThrowException();
+ walletProtectionTest.testRemoveNewWalletPassword();
+ }
+
+ @AfterAll
+ public static void tearDown() {
+ tearDownScaffold();
+ }
+}