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