-
Notifications
You must be signed in to change notification settings - Fork 828
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
base: develop
Are you sure you want to change the base?
Testing Updates #3195
Conversation
5f72b01
to
dc5fda7
Compare
There was a problem hiding this 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.
server/src/test/java/org/cloudfoundry/identity/uaa/ServerRunningExtension.java
Outdated
Show resolved
Hide resolved
uaa/src/test/java/org/cloudfoundry/identity/uaa/integration/util/ScreenshotOnFailExtension.java
Outdated
Show resolved
Hide resolved
# 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
dc5fda7
to
0746985
Compare
0746985
to
5e1c30c
Compare
This PR attempts to provide more consistency in our test suites, standardizing on Junit5 and AssetJ.
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.