package restImplementation; import database.Wallet.Wallet; import org.apache.log4j.BasicConfigurator; import org.apache.log4j.Logger; import org.junit.Ignore; import org.junit.Test; import java.util.Map; @Ignore public class WalletImplementationTest { private static Logger logger = Logger.getLogger(UserImplementationTest.class); /* @Test public void UserACreateWallet() { // OK BasicConfigurator.configure(); Wallet wallet = new Wallet("client","$2a$10$tdkMwJ7BQSOXO2uofu/fEOlncUfuX7SsjB.2N9KVsXJUQiarAQzpG"); WalletImplementation walletImplementation = new WalletImplementation(); try{ Map walletResponse = walletImplementation.createWallet(wallet); Wallet returnWallet = new Wallet(); returnWallet.setWallet_hash(walletResponse.get("walletHash")); returnWallet.setBalance(Double.parseDouble(walletResponse.get("walletSold"))); returnWallet.setType(walletResponse.get("walletType")); logger.info("wallet hash: "+returnWallet.getWallet_hash()); logger.info("wallet sold: "+returnWallet.getBalance()); logger.info("wallet type: "+returnWallet.getType()); } catch (Exception e){ logger.warn("Error: "+e.getMessage()); } } */ /* @Test public void UserBCreateWallet() { //OK BasicConfigurator.configure(); Wallet wallet = new Wallet("fournisseur","$2a$10$iMk/RWukka34xhF7drB7z.mb3YWbRh0qtunTpPXLbTBaZu2TxAOAW"); WalletImplementation walletImplementation = new WalletImplementation(); try{ Map walletResponse = walletImplementation.createWallet(wallet); Wallet returnWallet = new Wallet(); returnWallet.setWallet_hash(walletResponse.get("walletHash")); returnWallet.setBalance(Double.parseDouble(walletResponse.get("walletSold"))); returnWallet.setType(walletResponse.get("walletType")); logger.info("wallet hash: "+returnWallet.getWallet_hash()); logger.info("wallet sold: "+returnWallet.getBalance()); logger.info("wallet type: "+returnWallet.getType()); } catch (Exception e){ logger.warn("Error: "+e.getMessage()); } } */ /* @Test public void UserB2CreateWallet() { //OK BasicConfigurator.configure(); Wallet wallet = new Wallet("client","$2a$10$iMk/RWukka34xhF7drB7z.mb3YWbRh0qtunTpPXLbTBaZu2TxAOAW"); WalletImplementation walletImplementation = new WalletImplementation(); try{ Map walletResponse = walletImplementation.createWallet(wallet); Wallet returnWallet = new Wallet(); returnWallet.setWallet_hash(walletResponse.get("walletHash")); returnWallet.setBalance(Double.parseDouble(walletResponse.get("walletSold"))); returnWallet.setType(walletResponse.get("walletType")); logger.info("wallet hash: "+returnWallet.getWallet_hash()); logger.info("wallet sold: "+returnWallet.getBalance()); logger.info("wallet type: "+returnWallet.getType()); } catch (Exception e){ logger.warn("Error: "+e.getMessage()); } } */ /* @Test public void TestDeleteWallet() { //OK BasicConfigurator.configure(); WalletImplementation walletImplementation = new WalletImplementation(); try{ walletImplementation.deleteWallet("$2a$10$X2xW3CH/q7nij8yJpQTao.vEnuV31lNSMPhTCjGNl4oFp6MXW/6w6","$2a$10$iMk/RWukka34xhF7drB7z.mb3YWbRh0qtunTpPXLbTBaZu2TxAOAW"); } catch (Exception e){ logger.warn("Error: "+e.getMessage()); } } */ /* @Test public void TestGetWallet(){ //OK BasicConfigurator.configure(); WalletImplementation walletImplementation = new WalletImplementation(); try{ Wallet wallet = walletImplementation.getWallet("$2a$10$PuJBO70uMfzUwbQ/Qz9kTe7JYJppwetyLyP0e6JAITr3B6pQf0cbe"); logger.info("Wallet hash : "+wallet.getWallet_hash()); logger.info("Wallet owner : "+wallet.getUser_hash()); logger.info("Wallet type : "+wallet.getType()); logger.info("Wallet balance : "+wallet.getBalance()); } catch (Exception e){ logger.warn("Error: "+e.getMessage()); } } */ @Test public void TestSetBalance(){ //TODO BasicConfigurator.configure(); WalletImplementation walletImplementation = new WalletImplementation(); try{ walletImplementation.setBalanceToWallet("$2a$10$B2bESpzYaYlGtuf69Y8HIu1.libPO5NGKRnatvd2R7K/vciTAj/DS",20.0); } catch (Exception e){ logger.warn("Error: "+e.getMessage()); } } @Test public void TestTransferWalelt(){ //TODO BasicConfigurator.configure(); WalletImplementation walletImplementation = new WalletImplementation(); try{ walletImplementation.transferWallet("$2a$10$PuJBO70uMfzUwbQ/Qz9kTe7JYJppwetyLyP0e6JAITr3B6pQf0cbe","$2a$10$tdkMwJ7BQSOXO2uofu/fEOlncUfuX7SsjB.2N9KVsXJUQiarAQzpG"); } catch (Exception e){ logger.warn("Error: "+e.getMessage()); } } @Test public void TestGetUserWallet(){ //TODO BasicConfigurator.configure(); WalletImplementation walletImplementation = new WalletImplementation(); try{ walletImplementation.getAllUserWallets("$2a$10$tdkMwJ7BQSOXO2uofu/fEOlncUfuX7SsjB.2N9KVsXJUQiarAQzpG"); } catch (Exception e){ logger.warn("Error: "+e.getMessage()); } } }