From 032c7351ca3c0e5d7729e6c1206d80dd711e0acd Mon Sep 17 00:00:00 2001 From: JSoi Date: Sat, 23 Jul 2022 05:09:20 +0900 Subject: [PATCH] =?UTF-8?q?#37=20[Test]=20Bean=20=EB=93=B1=EB=A1=9D=20?= =?UTF-8?q?=ED=99=95=EC=9D=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/mpnp/baechelin/BeanTest.java | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 src/test/java/com/mpnp/baechelin/BeanTest.java diff --git a/src/test/java/com/mpnp/baechelin/BeanTest.java b/src/test/java/com/mpnp/baechelin/BeanTest.java new file mode 100644 index 0000000..13f5930 --- /dev/null +++ b/src/test/java/com/mpnp/baechelin/BeanTest.java @@ -0,0 +1,21 @@ +package com.mpnp.baechelin; + +import com.mpnp.baechelin.api.service.LocationService; +import com.mpnp.baechelin.api.service.LocationServiceWC; +import com.mpnp.baechelin.config.AppConfig; +import org.assertj.core.api.Assertions; +import org.junit.Test; +import org.junit.jupiter.api.DisplayName; +import org.springframework.context.annotation.AnnotationConfigApplicationContext; + +public class BeanTest { + AnnotationConfigApplicationContext ac = new + AnnotationConfigApplicationContext(AppConfig.class); + @Test + @DisplayName("빈 확인") + public void findBeanByName() { + LocationService locationService = ac.getBean("locationService", + LocationService.class); + Assertions.assertThat(locationService).isInstanceOf(LocationServiceWC.class); + } +}