Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Combining @SpringBootTest and @DataJpaTest leads to confusing error #6345

Closed
PWebb-Resmed opened this issue Jul 7, 2016 · 2 comments
Closed

Comments

@PWebb-Resmed
Copy link

The problem seems to occur in 1.4.0.M3 and 1.4.0.RC1, prior to M3 there's a totally different error.

I have a new application and a unit test, it works when running with the deprecated @SpringApplicationConfiguration , but not with the @SpringBootTest annotation. See the basic attached zip file.
test.zip

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Jul 7, 2016
@snicoll snicoll changed the title @SpringBootTest not finding SpringBootApplication class Combining @SpringBootTest and @DataJpaTest leads to confusing error Jul 7, 2016
@snicoll
Copy link
Member

snicoll commented Jul 7, 2016

@PWebb-Resmed that project is a bit weird. You are combining a @DataJpaTest with a regular @SpringBootTest that must start the servlet container.

So in one hand you're saying: "spring boot please only start the persistence layer and nothing else please because I want to focus on that" and on the other you're saying "start the container with that class and instead of mocking the MVC part, make sure to force the container to start".

I've removed @DataJpaTest and your project runs fine (with our without the classes attribute). I've also removed @SpringBootTest and replaced it with @DataJpaTest instead. Works fine as well.

TL;DR that project is invalid. But maybe we could do something to throw a different error?

@wilkinsona wilkinsona added usability and removed status: waiting-for-triage An issue we've not yet triaged labels Nov 6, 2016
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Mar 21, 2018
@mbhave mbhave added the for: team-attention An issue we'd like other members of the team to review label Apr 24, 2018
@philwebb philwebb added status: feedback-reminder We've sent a reminder that we need additional information before we can continue and removed for: team-attention An issue we'd like other members of the team to review labels May 4, 2018
@snicoll snicoll added the status: waiting-for-feedback We need additional information before we can continue label May 4, 2018
@spring-projects-issues
Copy link
Collaborator

Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open the issue.

@spring-projects-issues spring-projects-issues removed status: waiting-for-feedback We need additional information before we can continue status: feedback-reminder We've sent a reminder that we need additional information before we can continue status: waiting-for-triage An issue we've not yet triaged labels May 18, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants