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

Getting 500 instead of 404 with integration tests when updating from Spring Boot 3.1.x to to 3.2.4 #40113

Closed
lakshmipasupuleti opened this issue Mar 27, 2024 · 6 comments
Labels
status: invalid An issue that we don't feel is valid

Comments

@lakshmipasupuleti
Copy link

lakshmipasupuleti commented Mar 27, 2024

Hi,

I have an integration test passing with Spring Boot (3.1.6) but when I use the latest version 3.2.4, it is failing with below error

Assertion error: Status expected:<404 NOT_FOUND> but was:<500 INTERNAL_SERVER_ERROR>

Sharing sample code below

@ExtendWith(SpringExtension.class)
@SpringBootTest
@EnableDevelopmentSecurityValidator
@AutoConfigureMockMvc
public class TestControllerIT{

      private WebTestClient testClient;
 public void getTestDetails(){
 testClient.get()
.uri(uriBuilder -> uriBuilder.path("/getUsers")
.queryParam ("id", 123)
.build())
.headers(xxx)
.exchange()
.expectStatus ()
.isNotFound();
   }
   }

TestController.java

@RestController
@Validated
public class TestController{
@GetMapping(value="getEmployees")
Public Mono<Response entity<List<Employees>>> getEmployees(){
}
}

Can someone please check this issue and provide the fix for this issue?

Thanks,
Lakshmi

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Mar 27, 2024
@mhalbritter
Copy link
Contributor

If you'd like us to spend some time investigating, please take the time to provide a complete minimal sample (something that we can unzip or git clone, build, and deploy) that reproduces the problem.

@mhalbritter mhalbritter added the status: waiting-for-feedback We need additional information before we can continue label Mar 27, 2024
@lakshmipasupuleti
Copy link
Author

lakshmipasupuleti commented Mar 27, 2024

Sorry I can't share the code, if you could check above sample code and provide any solution it would be helpful.

@mhalbritter
Copy link
Contributor

Unfortunately it's not possible to tell from the code above what's wrong. It could be the changes in validation in Spring Framework, e.g. something like this: #40055

But without code, we can't really tell.

We don't need the original code, just one example which passes with Boot 3.1 and fails with Boot 3.2.

@spring-projects-issues spring-projects-issues added status: feedback-provided Feedback has been provided and removed status: waiting-for-feedback We need additional information before we can continue labels Mar 27, 2024
@mhalbritter mhalbritter added status: waiting-for-feedback We need additional information before we can continue and removed status: feedback-provided Feedback has been provided labels Mar 27, 2024
@lakshmipasupuleti
Copy link
Author

We haven't made any code changes, just updated spring boot from 3.1.x to 3.2.4

@spring-projects-issues spring-projects-issues added status: feedback-provided Feedback has been provided and removed status: waiting-for-feedback We need additional information before we can continue labels Mar 27, 2024
@bclozel
Copy link
Member

bclozel commented Mar 27, 2024

Moritz already linked to related issues. If you're not willing to share a sample application we cannot justify spending the time trying to reproduce a behavior we have not seen. Very often code snippets are not enough and crucial information can be in other parts of the application.

We can reopen this issue once the requested sample is provided.

@bclozel bclozel closed this as not planned Won't fix, can't repro, duplicate, stale Mar 27, 2024
@bclozel bclozel added status: invalid An issue that we don't feel is valid and removed status: waiting-for-triage An issue we've not yet triaged status: feedback-provided Feedback has been provided labels Mar 27, 2024
@lakshmipasupuleti
Copy link
Author

lakshmipasupuleti commented Mar 28, 2024

Thanks for looking into it, I am able to resolve the issue with the help of the steps mentioned in below link
#38733
Hope it will be helpful for others who are facing this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: invalid An issue that we don't feel is valid
Projects
None yet
Development

No branches or pull requests

4 participants