33import com .hedera .hashgraph .sdk .AccountId ;
44import com .hedera .hashgraph .sdk .PrivateKey ;
55import com .hedera .hashgraph .sdk .TokenId ;
6- import com .openelements .hiero .base .data .Account ;
76import com .openelements .hiero .base .AccountClient ;
8- import com .openelements .hiero .base .data . Nft ;
7+ import com .openelements .hiero .base .HieroContext ;
98import com .openelements .hiero .base .NftClient ;
10- import com .openelements .hiero .base .mirrornode .NftRepository ;
9+ import com .openelements .hiero .base .data .Account ;
10+ import com .openelements .hiero .base .data .Nft ;
1111import com .openelements .hiero .base .data .Page ;
12+ import com .openelements .hiero .base .mirrornode .NftRepository ;
1213import java .nio .charset .StandardCharsets ;
1314import java .util .ArrayList ;
1415import java .util .List ;
@@ -35,7 +36,7 @@ public class NftRepositoryTests {
3536 private AccountClient accountClient ;
3637
3738 @ Autowired
38- private Account operatorAccount ;
39+ private HieroContext hieroContext ;
3940
4041 private <T > List <T > getAll (Page <T > page ) {
4142 if (!page .isFirst ()) {
@@ -163,8 +164,8 @@ void findByAccountId() throws Exception {
163164 final byte [] metadata2 = "https://example.com/metadata2" .getBytes (StandardCharsets .UTF_8 );
164165 final TokenId tokenId = nftClient .createNftType (name , symbol );
165166 final List <Long > serial = nftClient .mintNfts (tokenId , metadata1 , metadata2 );
166- final AccountId adminAccountId = operatorAccount .accountId ();
167- final PrivateKey adminAccountPrivateKey = operatorAccount .privateKey ();
167+ final AccountId adminAccountId = hieroContext . getOperatorAccount () .accountId ();
168+ final PrivateKey adminAccountPrivateKey = hieroContext . getOperatorAccount () .privateKey ();
168169 final Account account = accountClient .createAccount ();
169170 final AccountId newOwner = account .accountId ();
170171 final PrivateKey newOwnerPrivateKey = account .privateKey ();
@@ -204,7 +205,7 @@ void findByAccountIdForSomePages() throws Exception {
204205 final int start = i ;
205206 final int end = Math .min (i + transferBatchSize , metadata .size ());
206207 final List <Long > serial = nftClient .mintNfts (tokenId , metadata .subList (start , end ).toArray (new byte [0 ][]));
207- nftClient .transferNfts (tokenId , serial , operatorAccount , newOwnerId );
208+ nftClient .transferNfts (tokenId , serial , hieroContext . getOperatorAccount () , newOwnerId );
208209 }
209210 hieroTestUtils .waitForMirrorNodeRecords ();
210211
@@ -249,8 +250,8 @@ void findByTokenIdAndAccountId() throws Exception {
249250 final byte [] metadata2 = "https://example.com/metadata2" .getBytes (StandardCharsets .UTF_8 );
250251 final TokenId tokenId = nftClient .createNftType (name , symbol );
251252 final List <Long > serial = nftClient .mintNfts (tokenId , metadata1 , metadata2 );
252- final AccountId adminAccountId = operatorAccount .accountId ();
253- final PrivateKey adminAccountPrivateKey = operatorAccount .privateKey ();
253+ final AccountId adminAccountId = hieroContext . getOperatorAccount () .accountId ();
254+ final PrivateKey adminAccountPrivateKey = hieroContext . getOperatorAccount () .privateKey ();
254255 final Account account = accountClient .createAccount ();
255256 final AccountId newOwner = account .accountId ();
256257 final PrivateKey newOwnerPrivateKey = account .privateKey ();
@@ -289,7 +290,7 @@ void findByTokenIdAndAccountIdForSomePages() throws Exception {
289290 final int start = i ;
290291 final int end = Math .min (i + transferBatchSize , metadata .size ());
291292 final List <Long > serial = nftClient .mintNfts (tokenId , metadata .subList (start , end ).toArray (new byte [0 ][]));
292- nftClient .transferNfts (tokenId , serial , operatorAccount , newOwnerId );
293+ nftClient .transferNfts (tokenId , serial , hieroContext . getOperatorAccount () , newOwnerId );
293294 }
294295 hieroTestUtils .waitForMirrorNodeRecords ();
295296
@@ -369,8 +370,8 @@ void findByTokenIdAndAccountIdAndSerial() throws Exception {
369370 final byte [] metadata = "https://example.com/metadata1" .getBytes (StandardCharsets .UTF_8 );
370371 final TokenId tokenId = nftClient .createNftType (name , symbol );
371372 final long serial = nftClient .mintNft (tokenId , metadata );
372- final AccountId adminAccountId = operatorAccount .accountId ();
373- final PrivateKey adminAccountPrivateKey = operatorAccount .privateKey ();
373+ final AccountId adminAccountId = hieroContext . getOperatorAccount () .accountId ();
374+ final PrivateKey adminAccountPrivateKey = hieroContext . getOperatorAccount () .privateKey ();
374375 final Account account = accountClient .createAccount ();
375376 final AccountId newOwner = account .accountId ();
376377 final PrivateKey newOwnerPrivateKey = account .privateKey ();
0 commit comments