|
6 | 6 | import com.hedera.hashgraph.sdk.Hbar; |
7 | 7 | import com.hedera.hashgraph.sdk.PrivateKey; |
8 | 8 | import com.hedera.hashgraph.sdk.Status; |
| 9 | +import com.hedera.hashgraph.sdk.TopicId; |
9 | 10 | import com.hedera.hashgraph.sdk.TransactionId; |
10 | 11 | import com.hedera.hashgraph.sdk.ContractFunctionResult; |
11 | 12 | import com.hedera.hashgraph.sdk.proto.ContractFunctionResultOrBuilder; |
|
48 | 49 | import com.openelements.hedera.base.protocol.FileDeleteRequest; |
49 | 50 | import com.openelements.hedera.base.protocol.FileCreateRequest; |
50 | 51 | import com.openelements.hedera.base.protocol.TopicSubmitMessageResult; |
| 52 | +import com.openelements.hedera.base.protocol.TopicDeleteRequest; |
51 | 53 |
|
52 | 54 | import java.lang.reflect.Constructor; |
53 | 55 | import java.nio.charset.StandardCharsets; |
@@ -727,4 +729,21 @@ void testTopicSubmitMessageResultCreation() { |
727 | 729 | Assertions.assertThrows(NullPointerException.class, () -> new TopicSubmitMessageResult(null, validStatus)); |
728 | 730 | Assertions.assertThrows(NullPointerException.class, () -> new TopicSubmitMessageResult(validTransactionId, null)); |
729 | 731 | } |
| 732 | + |
| 733 | + @Test |
| 734 | + void testTopicDeleteRequestCreation() { |
| 735 | + //given |
| 736 | + final Hbar maxTransactionFee = Hbar.fromTinybars(1000); |
| 737 | + final Duration transactionValidDuration = Duration.ofSeconds(10); |
| 738 | + final String topicIdString = "0.0.12345"; |
| 739 | + final TopicId topicId = TopicId.fromString(topicIdString); |
| 740 | + |
| 741 | + //then |
| 742 | + Assertions.assertDoesNotThrow(() -> TopicDeleteRequest.of(topicId)); |
| 743 | + Assertions.assertDoesNotThrow(() -> new TopicDeleteRequest(maxTransactionFee, transactionValidDuration, topicId)); |
| 744 | + Assertions.assertThrows(NullPointerException.class, () -> TopicDeleteRequest.of(null)); |
| 745 | + Assertions.assertThrows(NullPointerException.class, () -> new TopicDeleteRequest(null, transactionValidDuration, topicId)); |
| 746 | + Assertions.assertThrows(NullPointerException.class, () -> new TopicDeleteRequest(maxTransactionFee, null, topicId)); |
| 747 | + Assertions.assertThrows(NullPointerException.class, () -> new TopicDeleteRequest(maxTransactionFee, transactionValidDuration, null)); |
| 748 | + } |
730 | 749 | } |
0 commit comments