일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
Tags
- plugin
- 파이썬
- token filter test
- TensorFlow
- aggs
- high level client
- ELASTIC
- Kafka
- sort
- matplotlib
- flask
- licence delete curl
- Java
- Elasticsearch
- 차트
- docker
- Mac
- analyzer test
- License
- zip 파일 암호화
- API
- aggregation
- Test
- 900gle
- MySQL
- springboot
- query
- zip 암호화
- license delete
- Python
Archives
- Today
- Total
개발잡부
[TEST]ReflectionTestUtils 본문
반응형
ReflectionTestUtils??
ReflectionTestUtils 는 Spring Test Context 프레임워크의 일부입니다. 이는 단위에서 사용되는 리플렉션 기반 유틸리티 메서드의 모음이며, 비공개 필드를 설정하고 비공개 메서드를 호출하고 의존성을 주입하기 위한 통합 테스트 시나리오
import org.springframework.test.util.ReflectionTestUtils;
@Test
public void test_weightLogic_getPriceWeight(){
assertEquals(
ReflectionTestUtils.invokeMethod( new Weight(), "getPriceWeight", 5600L), (Double)1.49);
}
@Test
public void test_weightLogic_getStoreTypeWeight_hyper_nor(){
assertEquals(
ReflectionTestUtils.invokeMethod( new Weight(), "getStoreTypeWeight", StoreType.HYPER.name(), StoreKind.NOR.name()), (Double)1.0);
}
반응형
'JAVA > test code' 카테고리의 다른 글
[test] keywords Service TEST Code (0) | 2022.04.23 |
---|
Comments