11package com .openelements .hedera .base .test ;
22
3+ import org .junit .jupiter .api .Assertions ;
4+ import org .junit .jupiter .api .Test ;
5+
36import com .hedera .hashgraph .sdk .AccountId ;
47import com .hedera .hashgraph .sdk .Client ;
58import com .hedera .hashgraph .sdk .PrivateKey ;
69import com .openelements .hedera .base .Account ;
710import com .openelements .hedera .base .implementation .ProtocolLayerClientImpl ;
8- import com .openelements .hedera .base .protocol .ProtocolLayerClient ;
9- import org .junit .jupiter .api .Assertions ;
10- import org .junit .jupiter .api .Test ;
1111
1212public class ProtocolLayerClientTests {
1313
1414 @ Test
1515 void testNullConstructorParam () {
16- //then
16+ //given
1717 final Client client = Client .forTestnet ();
1818 final Account account = new Account (AccountId .fromString ("0.0.12345" ), PrivateKey .generateED25519 ().getPublicKey (), PrivateKey .generateED25519 ());
19+
20+ //then
1921 Assertions .assertThrows (NullPointerException .class , () -> new ProtocolLayerClientImpl (client , null ));
2022 Assertions .assertThrows (NullPointerException .class , () -> new ProtocolLayerClientImpl (null , account ));
2123 Assertions .assertThrows (NullPointerException .class , () -> new ProtocolLayerClientImpl (null , null ));
@@ -25,7 +27,7 @@ void testNullConstructorParam() {
2527 void testNullParams () {
2628 //given
2729 final Account account = new Account (AccountId .fromString ("0.0.12345" ), PrivateKey .generateED25519 ().getPublicKey (), PrivateKey .generateED25519 ());
28- final ProtocolLayerClient client = new ProtocolLayerClientImpl (Client .forTestnet (), account );
30+ final ProtocolLayerClientImpl client = new ProtocolLayerClientImpl (Client .forTestnet (), account );
2931
3032 //then
3133 Assertions .assertThrows (NullPointerException .class , () -> client .executeAccountBalanceQuery (null ));
@@ -38,5 +40,16 @@ void testNullParams() {
3840 Assertions .assertThrows (NullPointerException .class , () -> client .executeContractCallTransaction (null ));
3941 Assertions .assertThrows (NullPointerException .class , () -> client .executeFileInfoQuery (null ));
4042 Assertions .assertThrows (NullPointerException .class , () -> client .executeAccountDeleteTransaction (null ));
43+ Assertions .assertThrows (NullPointerException .class , () -> client .executeContractDeleteTransaction (null ));
44+ Assertions .assertThrows (NullPointerException .class , () -> client .executeAccountCreateTransaction (null ));
45+ Assertions .assertThrows (NullPointerException .class , () -> client .executeTokenCreateTransaction (null ));
46+ Assertions .assertThrows (NullPointerException .class , () -> client .executeTokenAssociateTransaction (null ));
47+ Assertions .assertThrows (NullPointerException .class , () -> client .executeTopicCreateTransaction (null ));
48+ Assertions .assertThrows (NullPointerException .class , () -> client .executeTopicDeleteTransaction (null ));
49+ Assertions .assertThrows (NullPointerException .class , () -> client .executeTopicMessageSubmitTransaction (null ));
50+ Assertions .assertThrows (NullPointerException .class , () -> client .executeTokenCreateTransaction (null ));
51+ Assertions .assertThrows (NullPointerException .class , () -> client .executeBurnTokenTransaction (null ));
52+ Assertions .assertThrows (NullPointerException .class , () -> client .executeMintTokenTransaction (null ));
53+ Assertions .assertThrows (NullPointerException .class , () -> client .executeTransferTransactionForNft (null ));
4154 }
4255}
0 commit comments