Skip to content

Fix broken e2e tests due to Quarkus RestClient requiring CDI context #1170

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

Merged
merged 1 commit into from
Apr 6, 2024

Conversation

nscuro
Copy link
Member

@nscuro nscuro commented Apr 3, 2024

As of Quarkus 3.9.x(?), the RestClient can no longer be used without an CDI context being present. This is causing test failures, e.g. https://github.com/DependencyTrack/hyades/actions/runs/8535995179/job/23383687429

java.lang.IllegalStateException: The Reactive REST Client needs to be built within the context of a Quarkus application with a valid ArC (CDI) context running.

This replaces the Quarkus RestClient with OpenFeign (https://github.com/OpenFeign/feign), which is largely compatible, although requiring a few customizations when it comes to encoding and decoding.

As of Quarkus 3.9.x(?), the RestClient can no longer be used without an CDI context being present. This is causing test failures, e.g. https://github.com/DependencyTrack/hyades/actions/runs/8535995179/job/23383687429

```
java.lang.IllegalStateException: The Reactive REST Client needs to be built within the context of a Quarkus application with a valid ArC (CDI) context running.
```

This replaces the Quarkus RestClient with OpenFeign (https://github.com/OpenFeign/feign), which is largely compatible, although requiring a few customizations when it comes to encoding and decoding.

Signed-off-by: nscuro <[email protected]>
@nscuro nscuro added defect Something isn't working qa labels Apr 3, 2024
@nscuro nscuro added this to the 0.5.0 milestone Apr 3, 2024
Copy link

sonarqubecloud bot commented Apr 3, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

Copy link
Collaborator

@VinodAnandan VinodAnandan left a comment

Choose a reason for hiding this comment

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

LGTM

@nscuro nscuro merged commit 2df43f1 into main Apr 6, 2024
@nscuro nscuro deleted the fix-e2e-tests branch April 6, 2024 09:22
nscuro added a commit that referenced this pull request Apr 9, 2024
As of #1170, `apiServerClient` no longer throws `WebApplicationException`s.

Signed-off-by: nscuro <[email protected]>
@nscuro nscuro mentioned this pull request Apr 9, 2024
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
defect Something isn't working qa
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants