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

Testing Updates #3195

Open
wants to merge 6 commits into
base: develop
Choose a base branch
from
Open

Testing Updates #3195

wants to merge 6 commits into from

Conversation

duanemay
Copy link
Member

@duanemay duanemay commented Dec 13, 2024

This PR attempts to provide more consistency in our test suites, standardizing on Junit5 and AssetJ.

  • Migrate to Junit 5
  • Migrate to AssertJ
  • Migrate Hamcrest Assertions
  • Use SpringJUnitConfig

We have had a mix of Junit 4 and 5 annotations, and a mix of Junit, Hamcrest, and AssertJ asserts, and various hamcrest matchers.
The Junit Annotations have all been moved to v5. Junit Rules have been migrated to Extensions. There remain places where Junit 4 support code is used notably in Extensions, e.g. OAuth2ContextExtension.
Hamcrest Matchers are still used in the production code and a few places in the tests.

@duanemay duanemay force-pushed the testing-updates branch 6 times, most recently from 5f72b01 to dc5fda7 Compare December 19, 2024 22:29
@duanemay duanemay marked this pull request as ready for review December 19, 2024 22:29
@duanemay duanemay requested a review from strehle December 19, 2024 23:34
Copy link
Contributor

@Kehrlann Kehrlann left a comment

Choose a reason for hiding this comment

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

I have skimmed some of the changes at random, nothing jumped out.

I have taken a closer look at the extensions ; they are still used as "old-style" JUnit rules, instead of newer @ExtendWith. I think it's fine, might be worth changing in the future if we do more work on the integration tests themselves. Of all the extensions, the ScreenshotOnFailExtension one can be more easily changed to be @ExtendWith(ScreenshotOnFailExtension.class).

There is a comment that seems off in the ServerRunningExtension though.

# Conflicts:
#	server/src/test/java/org/cloudfoundry/identity/uaa/db/DbMigrationIntegrationTestParent.java
#	server/src/test/java/org/cloudfoundry/identity/uaa/db/HsqlDbMigrationIntegrationTest.java
#	server/src/test/java/org/cloudfoundry/identity/uaa/db/MySqlDbMigrationIntegrationTest.java
#	server/src/test/java/org/cloudfoundry/identity/uaa/db/PostgresDbMigrationIntegrationTest.java
#	server/src/test/java/org/cloudfoundry/identity/uaa/db/TableAndColumnNormalizationTest.java
# Conflicts:
#	uaa/src/test/java/org/cloudfoundry/identity/uaa/integration/feature/LdapLoginIT.java
#	uaa/src/test/java/org/cloudfoundry/identity/uaa/mock/providers/IdentityProviderEndpointsMockMvcTests.java

# Conflicts:
#	uaa/src/test/java/org/cloudfoundry/identity/uaa/mock/audit/AuditCheckMockMvcTests.java
Remove
@ExtendWith(SpringExtension.class) and @ContextConfiguration
in favor of @SpringJUnitConfig
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

2 participants