Skip to content

fix(core): fix PMD violations in core test sources - #830

Open
corioliskraft wants to merge 1 commit into
stackitcloud:mainfrom
corioliskraft:fix/pmd-test-violations
Open

fix(core): fix PMD violations in core test sources#830
corioliskraft wants to merge 1 commit into
stackitcloud:mainfrom
corioliskraft:fix/pmd-test-violations

Conversation

@corioliskraft

Copy link
Copy Markdown
Contributor

Replace java.util.Date round-trips with Instant, rename mockRequest to MOCK_REQUEST, and wrap the two stub Response objects in try-with-resources.

The stub responses hold ResponseBody.EMPTY, so closing them is a no-op today. try-with-resources is preferred over @SuppressWarnings(PMD.CloseResource) because the annotation is method-scoped and would also silence a genuine leak if these tests later use a live response.

issuedAt and expiredAt in mockResponseBody are now anchored to the same Instant instead of two separate clock reads.

Fixes #829 .

Replace java.util.Date round-trips with Instant, rename mockRequest to MOCK_REQUEST, and wrap the two stub Response objects in try-with-resources.

The stub responses hold ResponseBody.EMPTY, so closing them is a no-op today. try-with-resources is preferred over @SuppressWarnings(PMD.CloseResource) because the annotation is method-scoped and would also silence a genuine leak if these tests later use a live response.

issuedAt and expiredAt in mockResponseBody are now anchored to the same Instant instead of two separate clock reads.

Fixes stackitcloud#829 .
@GokceGK

GokceGK commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

Hi @corioliskraft,

thanks for your contribution. We will take a look at it.

Regards,
Gökce from the STACKIT Developer Tools Team

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

core: 12 PMD violations in test sources make ./gradlew build fail

2 participants