Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(tests): refactor tests and junit platform name to execute startup…
… tests (#4764) Startup test under module keiko-mem-spring and keiko-redis-spring are not executing and throwing below error: ``` > Task :keiko-mem-spring:test FAILED FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':keiko-mem-spring:test'. > No tests found for given includes: [com.netflix.spinnaker.q.mem.spring.SpringStartupTests](--tests filter) ``` ``` > Task :keiko-redis-spring:test FAILED FAILURE: Build failed with an exception. * What went wrong: Execution failed for task ':keiko-redis-spring:test'. > No tests found for given includes: [com.netflix.spinnaker.q.redis.spring.SpringStartupTests](--tests filter) ``` After fixing these issues by refactoring the junit platform as `junit-jupiter`, encountered below errors while execution: ``` Failed to load ApplicationContext Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No qualifying bean of type 'com.netflix.spectator.api.Registry' available: expected at least 1 bean which qualifies as autowire candidate. Dependency annotations: {} at app//org.springframework.beans.factory.support.DefaultListableBeanFactory.raiseNoMatchingBeanFound(DefaultListableBeanFactory.java:1801) at app//org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1357) at app//org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1311) at app//org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:911) at app//org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:788) ... 133 more ``` ``` Failed to load ApplicationContext Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.netflix.spinnaker.q.redis.RedisQueue]: Factory method 'queue' threw exception; nested exception is redis.clients.jedis.exceptions.JedisConnectionException: Could not get a resource from the pool at app//org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:185) at app//org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:648) ... 120 more ``` To fix these errors refactored the test by adding `Registry` and `JedisPool` beans.
- Loading branch information