Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Used global instance for ConncetionFailureTests #598

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,16 @@

package bisq.wallets.bitcoind;

import bisq.wallets.regtest.AbstractRegtestSetup;
import bisq.wallets.bitcoind.regtest.BitcoindExtension;
import bisq.wallets.regtest.ConnectionFailureIntegrationTests;
import bisq.wallets.regtest.bitcoind.BitcoindRegtestSetup;
import bisq.wallets.regtest.process.MultiProcessCoordinator;
import org.junit.jupiter.api.extension.ExtendWith;

import java.io.IOException;

@ExtendWith(BitcoindExtension.class)
public class BitcoindConnectionFailureIntegrationTests
extends ConnectionFailureIntegrationTests<MultiProcessCoordinator> {
@Override
protected AbstractRegtestSetup<MultiProcessCoordinator> createRegtestSetup() throws IOException {
return new BitcoindRegtestSetup();
public BitcoindConnectionFailureIntegrationTests(BitcoindRegtestSetup regtestSetup) {
super(regtestSetup);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,10 @@

package bisq.wallets.elementsd;

import bisq.wallets.elementsd.regtest.ElementsdRegtestSetup;
import bisq.wallets.regtest.AbstractRegtestSetup;
import bisq.wallets.regtest.ConnectionFailureIntegrationTests;
import bisq.wallets.regtest.process.MultiProcessCoordinator;

import java.io.IOException;

public class ElementsdConnectionFailureIntegrationTests
extends ConnectionFailureIntegrationTests<MultiProcessCoordinator> {
@Override
/* extends ConnectionFailureIntegrationTests<MultiProcessCoordinator> */ {
/* @Override
protected AbstractRegtestSetup<MultiProcessCoordinator> createRegtestSetup() throws IOException {
return new ElementsdRegtestSetup();
}
} */
}
Original file line number Diff line number Diff line change
Expand Up @@ -24,30 +24,16 @@
import bisq.wallets.json_rpc.exceptions.InvalidRpcCredentialsException;
import bisq.wallets.process.BisqProcess;
import org.assertj.core.api.Assertions;
import org.junit.jupiter.api.AfterAll;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.TestInstance;

import java.io.IOException;

@TestInstance(TestInstance.Lifecycle.PER_CLASS)
public abstract class ConnectionFailureIntegrationTests<T extends BisqProcess> {

private AbstractRegtestSetup<T> regtestSetup;

protected abstract AbstractRegtestSetup<T> createRegtestSetup() throws IOException;
private final AbstractRegtestSetup<T> regtestSetup;

@BeforeAll
void setup() throws IOException, InterruptedException {
regtestSetup = createRegtestSetup();
regtestSetup.start();
public ConnectionFailureIntegrationTests(AbstractRegtestSetup<T> regtestSetup) {
this.regtestSetup = regtestSetup;
}

@AfterAll
void cleanUp() {
regtestSetup.shutdown();
}

@Test
void wrongRpcCredentialsTest() {
Expand Down