|
28 | 28 | import com.openelements.hedera.base.protocol.ContractDeleteResult; |
29 | 29 | import com.openelements.hedera.base.protocol.FileAppendRequest; |
30 | 30 | import com.openelements.hedera.base.protocol.TokenTransferResult; |
| 31 | +import com.openelements.hedera.base.protocol.TopicCreateResult; |
31 | 32 | import com.openelements.hedera.base.protocol.TokenMintResult; |
32 | 33 | import com.openelements.hedera.base.protocol.TokenCreateResult; |
33 | 34 | import com.openelements.hedera.base.protocol.TokenBurnResult; |
|
50 | 51 | import com.openelements.hedera.base.protocol.FileCreateRequest; |
51 | 52 | import com.openelements.hedera.base.protocol.TopicSubmitMessageResult; |
52 | 53 | import com.openelements.hedera.base.protocol.TopicSubmitMessageRequest; |
| 54 | +import com.openelements.hedera.base.protocol.TopicCreateRequest; |
53 | 55 |
|
54 | 56 | import java.lang.reflect.Constructor; |
55 | 57 | import java.nio.charset.StandardCharsets; |
@@ -177,6 +179,17 @@ void testAccountDeleteResultCreation() { |
177 | 179 | Assertions.assertThrows(NullPointerException.class, () -> new AccountDeleteResult(transactionId, status, null, consensusTimestamp, transactionFee)); |
178 | 180 | } |
179 | 181 |
|
| 182 | + @Test |
| 183 | + void testTopicCreateRequestCreation() { |
| 184 | + //given |
| 185 | + final Hbar validMaxTransactionFee = Hbar.fromTinybars(1000); |
| 186 | + final Duration validTransactionDuration = Duration.ofSeconds(120); |
| 187 | + |
| 188 | + Assertions.assertDoesNotThrow(() -> new TopicCreateRequest(validMaxTransactionFee, validTransactionDuration)); |
| 189 | + Assertions.assertThrows(NullPointerException.class, () -> new TopicCreateRequest(null, validTransactionDuration)); |
| 190 | + Assertions.assertThrows(NullPointerException.class, () -> new TopicCreateRequest(validMaxTransactionFee, null)); |
| 191 | + } |
| 192 | + |
180 | 193 | @Test |
181 | 194 | void testContractCallRequestCreation() { |
182 | 195 | //given |
@@ -751,4 +764,17 @@ void testTopicSubmitMessageRequestCreation() { |
751 | 764 | Assertions.assertThrows(NullPointerException.class, () -> new TopicSubmitMessageRequest(validMaxTransactionFee, validTransactionValidDuration, validTopicId, null)); |
752 | 765 | } |
753 | 766 |
|
| 767 | + @Test |
| 768 | + void testTopicCreateResultCreation() { |
| 769 | + //given |
| 770 | + final TransactionId validTransactionId = TransactionId. fromString( "[email protected]"); |
| 771 | + final Status validStatus =Status.SUCCESS; |
| 772 | + final TopicId validTopicId = TopicId.fromString("0.0.12345"); |
| 773 | + |
| 774 | + //then |
| 775 | + Assertions.assertDoesNotThrow(() -> new TopicCreateResult(validTransactionId,validStatus,validTopicId)); |
| 776 | + Assertions.assertThrows(NullPointerException.class, () -> new TopicCreateResult(null, validStatus, validTopicId)); |
| 777 | + Assertions.assertThrows(NullPointerException.class, () -> new TopicCreateResult(validTransactionId, null, validTopicId)); |
| 778 | + Assertions.assertThrows(NullPointerException.class, () -> new TopicCreateResult(validTransactionId, validStatus, null)); |
| 779 | + } |
754 | 780 | } |
0 commit comments