Skip to content

Upgrade to JUnit 5#86

Merged
ajkyffin merged 3 commits intomasterfrom
junit5
Jun 23, 2025
Merged

Upgrade to JUnit 5#86
ajkyffin merged 3 commits intomasterfrom
junit5

Conversation

@ajkyffin
Copy link
Member

Upgrade from JUnit 4 to 5.

Also upgrades the maven surefire plugin and arquillian components for compatibility.

Fixes the tests on jdk 17/21.

@ajkyffin ajkyffin requested a review from patrick-austin June 18, 2025 09:56
Copy link

@patrick-austin patrick-austin left a comment

Choose a reason for hiding this comment

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

Changes and CI results look good.

Out of interest,, looking at the diff some of the older tests do:

try {
	response = adminResource.getDownloads(facilityName, nonAdminSessionId, null);
	// We should not see the following
	System.out.println("DEBUG: AdminRT.getDownloads response: " + response.getStatus() + ", "
			+ (String) response.getEntity());
	fail("AdminResource.getDownloads did not raise exception for non-admin user");
} catch (ForbiddenException fe) {
	assertTrue(true);
}

The tests I've added recently used ThrowingRunnable, now Executable:

Executable runnable = () -> userResource.queueFiles(facilityName, sessionId, transport, null, email, null);
Throwable throwable = assertThrows(BadRequestException.class, runnable);

Since it felt better to me to use the "official" assert. Just wondered if you had an opinion on which is the best to use going forward?

@ajkyffin
Copy link
Member Author

assertThrows would be better, but there is some debugging output before fail that would be lost it was changed.

@ajkyffin ajkyffin merged commit b7efe5e into master Jun 23, 2025
2 checks passed
@ajkyffin ajkyffin deleted the junit5 branch June 23, 2025 16:17
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.

2 participants