-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4724 from ghubstan/17-fix-testfixture-init
Refactor api test fixture setup
- Loading branch information
Showing
7 changed files
with
120 additions
and
141 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
69 changes: 69 additions & 0 deletions
69
apitest/src/test/java/bisq/apitest/method/trade/ExpectedProtocolStatus.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
package bisq.apitest.method.trade; | ||
|
||
import bisq.core.trade.Trade; | ||
|
||
/** | ||
* A test fixture encapsulating expected trade protocol status. | ||
* Status flags should be cleared via init() before starting a new trade protocol. | ||
*/ | ||
public class ExpectedProtocolStatus { | ||
Trade.State state; | ||
Trade.Phase phase; | ||
boolean isDepositPublished; | ||
boolean isDepositConfirmed; | ||
boolean isFiatSent; | ||
boolean isFiatReceived; | ||
boolean isPayoutPublished; | ||
boolean isWithdrawn; | ||
|
||
public ExpectedProtocolStatus setState(Trade.State state) { | ||
this.state = state; | ||
return this; | ||
} | ||
|
||
public ExpectedProtocolStatus setPhase(Trade.Phase phase) { | ||
this.phase = phase; | ||
return this; | ||
} | ||
|
||
public ExpectedProtocolStatus setDepositPublished(boolean depositPublished) { | ||
isDepositPublished = depositPublished; | ||
return this; | ||
} | ||
|
||
public ExpectedProtocolStatus setDepositConfirmed(boolean depositConfirmed) { | ||
isDepositConfirmed = depositConfirmed; | ||
return this; | ||
} | ||
|
||
public ExpectedProtocolStatus setFiatSent(boolean fiatSent) { | ||
isFiatSent = fiatSent; | ||
return this; | ||
} | ||
|
||
public ExpectedProtocolStatus setFiatReceived(boolean fiatReceived) { | ||
isFiatReceived = fiatReceived; | ||
return this; | ||
} | ||
|
||
public ExpectedProtocolStatus setPayoutPublished(boolean payoutPublished) { | ||
isPayoutPublished = payoutPublished; | ||
return this; | ||
} | ||
|
||
public ExpectedProtocolStatus setWithdrawn(boolean withdrawn) { | ||
isWithdrawn = withdrawn; | ||
return this; | ||
} | ||
|
||
public void init() { | ||
state = null; | ||
phase = null; | ||
isDepositPublished = false; | ||
isDepositConfirmed = false; | ||
isFiatSent = false; | ||
isFiatReceived = false; | ||
isPayoutPublished = false; | ||
isWithdrawn = false; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 0 additions & 28 deletions
28
apitest/src/test/java/bisq/apitest/scenario/ScenarioTest.java
This file was deleted.
Oops, something went wrong.