39
39
import static org .hamcrest .MatcherAssert .assertThat ;
40
40
41
41
@ ExtendWith (MockitoExtension .class )
42
- public class MakerInvalidFeeBtcValidationTests {
42
+ public class InvalidFeeBtcAddressTests {
43
43
private TxValidator txValidator ;
44
44
45
45
@ BeforeEach
@@ -49,15 +49,26 @@ void setup(@Mock DaoStateService daoStateService, @Mock FilterManager filterMana
49
49
}
50
50
51
51
@ Test
52
- void makerCheckFeeAddressBtcInvalidFeeAddress () {
52
+ void makerInvalidFeeBtcAddressTest () {
53
+ String jsonContent = createJsonResponseString ();
54
+ TxValidator txValidator1 = txValidator .parseJsonValidateMakerFeeTx (jsonContent , Collections .emptyList ());
55
+ assertThat (txValidator1 .getStatus (), is (FeeValidationStatus .NACK_UNKNOWN_FEE_RECEIVER ));
56
+ }
57
+
58
+ @ Test
59
+ void takerInvalidFeeBtcAddressTest () {
60
+ String jsonContent = createJsonResponseString ();
61
+ TxValidator txValidator1 = txValidator .parseJsonValidateTakerFeeTx (jsonContent , Collections .emptyList ());
62
+ assertThat (txValidator1 .getStatus (), is (FeeValidationStatus .NACK_UNKNOWN_FEE_RECEIVER ));
63
+ }
64
+
65
+ private String createJsonResponseString () {
53
66
JsonObject json = MakerTxValidatorSanityCheckTests .getValidBtcMakerFeeMempoolJsonResponse ();
54
67
json .get ("status" ).getAsJsonObject ().add ("block_height" , new JsonPrimitive (600_000 ));
55
68
56
69
var newBlockHeight = json .get ("status" ).getAsJsonObject ().get ("block_height" ).getAsInt ();
57
70
assertThat (newBlockHeight , is (600_000 ));
58
71
59
- String jsonContent = new Gson ().toJson (json );
60
- TxValidator txValidator1 = txValidator .parseJsonValidateMakerFeeTx (jsonContent , Collections .emptyList ());
61
- assertThat (txValidator1 .getStatus (), is (FeeValidationStatus .NACK_UNKNOWN_FEE_RECEIVER ));
72
+ return new Gson ().toJson (json );
62
73
}
63
74
}
0 commit comments