test code

2022. 6. 13. 10:58test

package com.imedisync.me.service;

import com.imedisync.me.mapper.CommonMapper;
import com.imedisync.me.repository.CountryRepository;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@SpringBootTest
@Transactional
class CommonServiceTest {

    @Autowired
    CountryRepository countryRepository;

    @Test
    void getCountry() {

        /**
         * 국가코드 목록 api 요청시 국가 id 추가
         * 국가 id - null check
         */

        List<CommonMapper.CountryDto> countryInfoList = countryRepository.findCountryInfo(null, null);
        System.out.println(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> countryInfoList: " + countryInfoList);
        countryInfoList.stream().forEach(Assertions::assertNotNull);
    }
}

'test' 카테고리의 다른 글

test code(+mockmvc)  (0) 2022.06.13