|
11 | 11 | import com.hedera.hashgraph.sdk.proto.ContractFunctionResultOrBuilder; |
12 | 12 | import com.hedera.hashgraph.sdk.TokenId; |
13 | 13 | import com.hedera.hashgraph.sdk.TokenType; |
| 14 | +import com.hedera.hashgraph.sdk.TopicId; |
14 | 15 | import com.openelements.hedera.base.Account; |
15 | 16 | import com.openelements.hedera.base.ContractParam; |
16 | 17 | import com.openelements.hedera.base.protocol.AccountBalanceRequest; |
|
28 | 29 | import com.openelements.hedera.base.protocol.FileAppendRequest; |
29 | 30 | import com.openelements.hedera.base.protocol.TokenTransferResult; |
30 | 31 | import com.openelements.hedera.base.protocol.TopicDeleteResult; |
| 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; |
|
49 | 51 | import com.openelements.hedera.base.protocol.FileDeleteRequest; |
50 | 52 | import com.openelements.hedera.base.protocol.FileCreateRequest; |
51 | 53 | import com.openelements.hedera.base.protocol.TopicSubmitMessageResult; |
| 54 | +import com.openelements.hedera.base.protocol.TopicCreateRequest; |
52 | 55 |
|
53 | 56 | import java.lang.reflect.Constructor; |
54 | 57 | import java.nio.charset.StandardCharsets; |
@@ -176,6 +179,17 @@ void testAccountDeleteResultCreation() { |
176 | 179 | Assertions.assertThrows(NullPointerException.class, () -> new AccountDeleteResult(transactionId, status, null, consensusTimestamp, transactionFee)); |
177 | 180 | } |
178 | 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 | + |
179 | 193 | @Test |
180 | 194 | void testContractCallRequestCreation() { |
181 | 195 | //given |
@@ -740,4 +754,18 @@ void testTopicDeleteResultCreation() { |
740 | 754 | Assertions.assertThrows(NullPointerException.class, () -> new TopicDeleteResult(null, validStatus)); |
741 | 755 | Assertions.assertThrows(NullPointerException.class, () -> new TopicDeleteResult(validTransactionId, null)); |
742 | 756 | } |
| 757 | + |
| 758 | + @Test |
| 759 | + void testTopicCreateResultCreation() { |
| 760 | + //given |
| 761 | + final TransactionId validTransactionId = TransactionId. fromString( "[email protected]"); |
| 762 | + final Status validStatus =Status.SUCCESS; |
| 763 | + final TopicId validTopicId = TopicId.fromString("0.0.12345"); |
| 764 | + |
| 765 | + //then |
| 766 | + Assertions.assertDoesNotThrow(() -> new TopicCreateResult(validTransactionId,validStatus,validTopicId)); |
| 767 | + Assertions.assertThrows(NullPointerException.class, () -> new TopicCreateResult(null, validStatus, validTopicId)); |
| 768 | + Assertions.assertThrows(NullPointerException.class, () -> new TopicCreateResult(validTransactionId, null, validTopicId)); |
| 769 | + Assertions.assertThrows(NullPointerException.class, () -> new TopicCreateResult(validTransactionId, validStatus, null)); |
| 770 | + } |
743 | 771 | } |
0 commit comments