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

Use core M2 #428

Merged
merged 4 commits into from
Apr 19, 2023
Merged

Use core M2 #428

merged 4 commits into from
Apr 19, 2023

Conversation

timyates
Copy link
Contributor

Fix up removed and deprecated methods

Fix up removed and deprecated methods
@timyates timyates self-assigned this Apr 17, 2023
@timyates timyates requested a review from sdelamo April 17, 2023 13:14
Argument<?> bodyType = route.getBodyArgument()
Argument<?> bodyType = route.getRouteInfo().getFullBodyArgument()
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@graemerocher Is this the correct replacement?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems not (or something else has changed) as now this is failing

void "test an exception handler returning the body"() {
when:
client.toBlocking().retrieve("/exception/my")
then:
def ex = thrown(HttpClientResponseException)
ex.response.status() == HttpStatus.INTERNAL_SERVER_ERROR
ex.response.getBody().get() == "hello"
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks correct

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dstepanov There's also route.getRouteInfo().getBodyArgument()... What's the difference?

@timyates
Copy link
Contributor Author

So it seems the issue with the failing test:

void "test an exception handler returning the body"() {
when:
client.toBlocking().retrieve("/exception/my")
then:
def ex = thrown(HttpClientResponseException)
ex.response.status() == HttpStatus.INTERNAL_SERVER_ERROR
ex.response.getBody().get() == "hello"
}

Is that when we execute normalFlow() for the request lifecycle here

lc.handleNormal()
.onComplete((response, throwable) -> onComplete(exchange, req, response, throwable, httpResponse -> {
asyncExecution.complete();
requestTerminated.accept(httpResponse);
}));

We're getting a 200 response (with the expected body) wheras prior to core-M2, we got a 500

@dstepanov Can you spot what I've missed? I'm assuming there's something new I need to set up in the RequestLifecycle?

@dstepanov
Copy link
Contributor

@timyates To me, the test doesn't look correct. The exception is remapped so there shouldn't be any error. Maybe we can add that test to TCK?

@sonarqubecloud
Copy link

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

@graemerocher graemerocher merged commit 95a120c into master Apr 19, 2023
@graemerocher graemerocher deleted the use-micronaut-m2 branch April 19, 2023 16:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Status: Done
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants