올바르게 Bean이 설정되었는지 출력하는 코드 추가
This commit is contained in:
		| @@ -0,0 +1,21 @@ | |||||||
|  | package kr.co.vividnext.sodalive | ||||||
|  |  | ||||||
|  | import org.springframework.boot.ApplicationArguments | ||||||
|  | import org.springframework.boot.ApplicationRunner | ||||||
|  | import org.springframework.context.ApplicationContext | ||||||
|  | import org.springframework.data.redis.core.RedisTemplate | ||||||
|  | import org.springframework.data.repository.CrudRepository | ||||||
|  | import org.springframework.stereotype.Component | ||||||
|  |  | ||||||
|  | @Component | ||||||
|  | class RedisBeanInspector(val ctx: ApplicationContext) : ApplicationRunner { | ||||||
|  |     override fun run(args: ApplicationArguments?) { | ||||||
|  |         ctx.getBeansOfType(RedisTemplate::class.java).forEach { (name, bean) -> | ||||||
|  |             println("RedisTemplate Bean: $name -> $bean") | ||||||
|  |         } | ||||||
|  |  | ||||||
|  |         ctx.getBeansOfType(CrudRepository::class.java).forEach { (name, bean) -> | ||||||
|  |             println("CrudRepository Bean: $name -> ${bean.javaClass}") | ||||||
|  |         } | ||||||
|  |     } | ||||||
|  | } | ||||||
		Reference in New Issue
	
	Block a user