package com.wuban.tron.explore.dao;

import com.wuban.tron.explore.BaseTest;
import com.wuban.tron.explore.entity.Address;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.ArrayList;
import java.util.List;

class AddressRepositoryTest extends BaseTest {

    @Autowired
    private AddressRepository addressRepository;

    List<Address> records = null;

    @BeforeEach
    void setUp() {
        records = new ArrayList<>();
        Address addr = Address.builder().address("4142d5087e49e930fc4ff81308e9b7bd1b2b7c914c").balance(0L).build();
        Address addr2 = Address.builder().address("a2").balance(0L).build();
        records.add(addr);
        //records.add(addr2);
    }

    @Test
    void test() {
        this.addressRepository.batchInsertOnDuplicateKey(records);
        System.out.println("**************");
    }


}