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

Extend Apache HttpClient 5 test assertions for actual headers #638

Closed
wants to merge 2 commits into from

Conversation

newtork
Copy link
Contributor

@newtork newtork commented Nov 12, 2024

Instead of asserting on Java objects and fields, let's check for actual headers being used.

Context

# Conflicts:
#	cloudplatform/connectivity-apache-httpclient5/src/test/java/com/sap/cloud/sdk/cloudplatform/connectivity/ApacheHttpClient5FactoryBuilderTest.java
@newtork newtork added please merge Request to merge a pull request please review Request to review a pull request labels Nov 12, 2024
.extracting("httpClient", as(type(Configurable.class)))
.satisfies(client -> assertThat(client.getConfig().isProtocolUpgradeEnabled()).isFalse());
@SneakyThrows
private TlsUpgradeAssertion withUpgradeHeader(
Copy link
Member

Choose a reason for hiding this comment

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

yeah this is a bit complicated, maybe you can try using a parameterized test or wiremock scenario instead?

Copy link
Contributor Author

@newtork newtork Nov 12, 2024

Choose a reason for hiding this comment

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

Yeah.... I wanted to avoid writing additional class definition. But maybe this code really is too much.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Please find my proposal for parameterized test, not sure whether it's better...
#640

@newtork newtork removed please merge Request to merge a pull request please review Request to review a pull request labels Nov 12, 2024
@newtork newtork closed this Nov 13, 2024
@newtork newtork deleted the extend-apache5-test branch November 13, 2024 13:13
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

Successfully merging this pull request may close these issues.

3 participants