{"componentChunkName":"component---src-templates-post-template-jsx","path":"/errors/posts/2020-09-22--001","result":{"data":{"site":{"siteMetadata":{"title":"Blog by Eunyoung","subtitle":"작업 기록 블로그","copyright":"© All rights reserved.","author":{"name":"EunYoung","twitter":"#"},"disqusShortname":"","url":"https://ssongey.github.io"}},"markdownRemark":{"id":"48ee158e-230f-51ee-96d6-5474327cabf8","html":"<h3>문제</h3>\n<p>테스트 코드 실행 시 아래와 같은 오류가 발생하였다.</p>\n<div class=\"gatsby-highlight\" data-language=\"text\"><pre class=\"language-text\"><code class=\"language-text\">Unable to find a @SpringBootConfiguration, you need to use @ContextConfiguration or @SpringBootTest(classes=...) with your test\njava.lang.IllegalStateException: Unable to find a @SpringBootConfiguration, you need to use @ContextConfiguration or @SpringBootTest(classes=...) with your test</code></pre></div>\n<h3>원인</h3>\n<p>@SpringBootApplication 애노테이션이 붙은 클래스가 존재하는 패키지의 하위 패키지에 테스트를 둬야 한다는 원칙을 어김</p>\n<h3>해결</h3>\n<p>test.java 패키지 바로 아래 있던 테스트 클래스를\nProjectApplication.java 의 패키지 depth 와 동일하게 맞춰서 재실행</p>\n<p>main: com.company.project.ProjectApplication.java<br>\ntest: com.company.project.TestApplication.java </p>","fields":{"tagSlugs":["/tags//"],"slug":"/errors/posts/2020-09-22--001"},"frontmatter":{"title":"Unable to find a @SpringBootConfiguration, you need to use @ContextConfiguration or @SpringBootTest(classes=...) with your test","tags":[""],"date":"2020-09-22","description":""}}},"pageContext":{"slug":"/errors/posts/2020-09-22--001"}},"staticQueryHashes":[]}