Skip to content
This repository was archived by the owner on May 29, 2026. It is now read-only.

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

Merged
nscuro merged 1 commit into
mainfrom
fix-e2e-tests
Apr 6, 2024
Merged

Fix broken e2e tests due to Quarkus RestClient requiring CDI context#1170
nscuro merged 1 commit into
mainfrom
fix-e2e-tests

Conversation

@nscuro

@nscuro nscuro commented Apr 3, 2024

Copy link
Copy Markdown
Member

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 <nscuro@protonmail.com>
@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
@sonarqubecloud

sonarqubecloud Bot commented Apr 3, 2024

Copy link
Copy Markdown

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

@VinodAnandan VinodAnandan left a comment

Copy link
Copy Markdown
Collaborator

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 <nscuro@protonmail.com>
@nscuro nscuro mentioned this pull request Apr 9, 2024
2 tasks
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

defect Something isn't working qa

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants