package Ġcom . rar ible . protocol . nft . migration . service Ċ Ċ import Ġcom . rar ible . protocol . nft . core . model . Item Attribute Ċ import Ġcom . rar ible . protocol . nft . core . service . Crypto P unk s Meta Service Ċ import Ġcom . rar ible . protocol . nft . core . service . item . meta . Item Properties Service Ċ import Ġcom . rar ible . protocol . nft . migration . configuration . Ip fs Properties Ċ import Ġcom . rar ible . protocol . nft . migration . integration . Abstract IntegrationTest Ċ import Ġcom . rar ible . protocol . nft . migration . integration . IntegrationTest Ċ import Ġcom . rar ible . protocol . nft . migration . mong ock . mongo . Change Log 0 0 0 1 3 Insert Attributes For Crypto P unk s Ċ import Ġcom . rar ible . protocol . nft . migration . mong ock . mongo . Change Log 0 0 0 1 4 Upload Sv gs For Crypto P unk s Ċ import Ġkotlinx . coroutines . reactive . await First OrNull Ċ import Ġkotlinx . coroutines . reactive . await Single Ċ import Ġkotlinx . coroutines . run Blocking Ċ import Ġorg . assertj . core . api . Assertions . assertThat Ċ import Ġorg . junit . jupiter . api . Assertions . assertEquals Ċ import Ġorg . junit . jupiter . api . Disabled Ċ import Ġorg . junit . jupiter . api . Test Ċ import Ġorg . springframework . beans . factory . annotation . Autowired Ċ import Ġorg . springframework . data . mongodb . core . query . Query Ċ import Ġscale ther . domain . Address Ċ import Ġjava . math . BigInteger Ċ Ċ @ IntegrationTest Ċ class ĠCrypto P unk Svg Migration Test Ġ: ĠAbstract IntegrationTest () Ġ{ ĊĊĠĠĠ Ġprivate Ġval Ġinsert Attributes Ġ= ĠChange Log 0 0 0 1 3 Insert Attributes For Crypto P unk s () ĊĠĠĠ Ġprivate Ġval Ġup loader Svg Ġ= ĠChange Log 0 0 0 1 4 Upload Sv gs For Crypto P unk s () ĊĊĠĠĠ Ġ@ Autowired ĊĠĠĠ Ġprivate Ġlateinit Ġvar Ġitem Properties Service : ĠItem Properties Service ĊĊĠĠĠ Ġ@ Autowired ĊĠĠĠ Ġprivate Ġlateinit Ġvar Ġcrypto P unk s Meta Service : ĠCrypto P unk s Meta Service ĊĊĠĠĠ Ġ@ Autowired ĊĠĠĠ Ġprivate Ġlateinit Ġvar Ġip fs Properties : ĠIp fs Properties ĊĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġ` should Ġsave Ġsvg Ġimage `() Ġ= Ġrun Blocking Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġtoken Ġ= ĠAddress . apply ( nft Indexer Properties . crypto P unk s Contract Address ) ĊĠĠĠĠĠĠĠ Ġval Ġtoken Id Ġ= ĠBigInteger . valueOf ( 2 L ) ĊĊĠĠĠĠĠĠĠ Ġval Ġp unk Ġ= Ġ" 2 , ĠHuman , ĠF emale , ĠLight , Ġ 1 , ĠW ild ĠH air " ĊĠĠĠĠĠĠĠ Ġinsert Attributes . save P unk ( p unk , Ġcrypto P unk s Meta Service ) ĊĠĠĠĠĠĠĠ Ġval Ġbs Ġ= Ġjava Class . getResource AsStream ("/ data / crypt op unk s / 2 . svg "). read Bytes () ĊĠĠĠĠĠĠĠ Ġup loader Svg . upload (" 2 . svg ", Ġbs , Ġcrypto P unk s Meta Service , Ġip fs Properties ) ĊĊĠĠĠĠĠĠĠ ĠassertEquals ( 1 , Ġmongo . count ( Query (), Ġ" crypt op unk s _ meta "). await Single ()) ĊĊĠĠĠĠĠĠĠ Ġval Ġitem Props Ġ= Ġitem Properties Service . getProperties ( token , Ġtoken Id ). await First OrNull () ĊĠĠĠĠĠĠĠ ĠassertEquals (" Crypto P unk Ġ# 2 ", Ġitem Props ?. name ) ĊĠĠĠĠĠĠĠ ĠassertEquals (" https :// rar ible . my pin ata . cloud / ipfs / Qm WM VU Q 4 Q id z C 2 rg 6 h BE JM gi h iz ra W 2 9 h St y VL NP fm U 4 WS ", Ġitem Props ?. image ) ĊĠĠĠĠĠĠĠ ĠassertThat ( item Props ?. attributes ). contains ( Item Attribute (" type ", Ġ" Human ")) ĊĠĠĠĠĠĠĠ ĠassertThat ( item Props ?. attributes ). contains ( Item Attribute (" gender ", Ġ" Female ")) ĊĠĠĠĠĠĠĠ ĠassertThat ( item Props ?. attributes ). contains ( Item Attribute (" skin Ġtone ", Ġ" Light ")) ĊĠĠĠĠĠĠĠ ĠassertThat ( item Props ?. attributes ). contains ( Item Attribute (" count ", Ġ" 1 ")) ĊĠĠĠĠĠĠĠ ĠassertThat ( item Props ?. attributes ). contains ( Item Attribute (" access ory ", Ġ" W ild ĠH air ")) ĊĠĠĠĠĠĠĠ ĠassertEquals ( 5 , Ġitem Props ?. attributes ?. size ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġ// ĠIt 's Ġa Ġvery Ġslow Ġtest ĊĠĠĠ Ġ@ Disabled ĊĠĠĠ Ġ@ Test ĊĠĠĠ Ġfun Ġ` should Ġupload Ġall Ġsvg Ġimages `() Ġ= Ġrun Blocking Ġ{ ĊĠĠĠĠĠĠĠ Ġinsert Attributes . create ( crypto P unk s Meta Service ) ĊĠĠĠĠĠĠĠ Ġup loader Svg . create ( crypto P unk s Meta Service , Ġip fs Properties ) ĊĠĠĠĠĠĠĠ ĠassertEquals ( 1 0 0 0 0 , Ġmongo . count ( Query (), Ġ" item _ properties "). await Single ()) ĊĠĠĠ Ġ} Ċ } Ċ