|
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; |
|
50 | 51 | import com.openelements.hedera.base.protocol.FileDeleteRequest; |
51 | 52 | import com.openelements.hedera.base.protocol.FileCreateRequest; |
52 | 53 | import com.openelements.hedera.base.protocol.TopicSubmitMessageResult; |
| 54 | +import com.openelements.hedera.base.protocol.TopicDeleteRequest; |
53 | 55 | import com.openelements.hedera.base.protocol.TopicCreateRequest; |
54 | 56 |
|
55 | 57 | import java.lang.reflect.Constructor; |
@@ -743,7 +745,28 @@ void testTopicSubmitMessageResultCreation() { |
743 | 745 | } |
744 | 746 |
|
745 | 747 | @Test |
746 | | - void testTopicCreateResultCreation() { |
| 748 | + void testTopicDeleteRequestCreation() { |
| 749 | + //given |
| 750 | + final Hbar maxTransactionFee = Hbar.fromTinybars(1000); |
| 751 | + final Duration transactionValidDuration = Duration.ofSeconds(10); |
| 752 | + final String topicIdString = "0.0.12345"; |
| 753 | + final TopicId topicId = TopicId.fromString(topicIdString); |
| 754 | + |
| 755 | + //then |
| 756 | + Assertions.assertDoesNotThrow(() -> TopicDeleteRequest.of(topicId)); |
| 757 | + Assertions.assertDoesNotThrow(() -> new TopicDeleteRequest(maxTransactionFee, transactionValidDuration, topicId)); |
| 758 | + Assertions.assertDoesNotThrow(() -> new TopicDeleteRequest(null, transactionValidDuration, topicId)); |
| 759 | + Assertions.assertDoesNotThrow(() -> new TopicDeleteRequest(maxTransactionFee, null, topicId)); |
| 760 | + Assertions.assertDoesNotThrow(() -> new TopicDeleteRequest(null, null, topicId)); |
| 761 | + Assertions.assertThrows(NullPointerException.class, () -> TopicDeleteRequest.of(null)); |
| 762 | + Assertions.assertThrows(NullPointerException.class, () -> new TopicDeleteRequest(maxTransactionFee, transactionValidDuration, null)); |
| 763 | + Assertions.assertThrows(NullPointerException.class, () -> new TopicDeleteRequest(null, transactionValidDuration, null)); |
| 764 | + Assertions.assertThrows(NullPointerException.class, () -> new TopicDeleteRequest(maxTransactionFee, null, null)); |
| 765 | + Assertions.assertThrows(NullPointerException.class, () -> new TopicDeleteRequest(null, null, null)); |
| 766 | + } |
| 767 | + |
| 768 | + @Test |
| 769 | + void testTopicCreateResultCreation() { |
747 | 770 | //given |
748 | 771 | final TransactionId validTransactionId = TransactionId. fromString( "[email protected]"); |
749 | 772 | final Status validStatus =Status.SUCCESS; |
|
0 commit comments