Skip to content

Use Hamcrest instead of deprecated JUnit methods#883

Merged
MarkEWaite merged 3 commits intojenkinsci:masterfrom
MarkEWaite:handle-junit-assertThat-deprecation
Apr 20, 2020
Merged

Use Hamcrest instead of deprecated JUnit methods#883
MarkEWaite merged 3 commits intojenkinsci:masterfrom
MarkEWaite:handle-junit-assertThat-deprecation

Conversation

@MarkEWaite
Copy link
Contributor

@MarkEWaite MarkEWaite commented Apr 20, 2020

Use Hamcrest instead of deprecated JUnit methods

JUnit 4.13 deprecated the Assert.assertThat method. The Hamcrest assertThat is the replacement for Assert.assertThat. Use the replacement.

JUnit 4.13 deprecated the ExpectedException class. The Assert.assertThrows method is the replacement. Use the replacement.

Checklist

  • I have read the CONTRIBUTING doc
  • I have added tests that verify my changes
  • Unit tests pass locally with my changes
  • I have added documentation as necessary
  • No Javadoc warnings were introduced with my changes
  • No spotbugs warnings were introduced with my changes

Types of changes

  • Dependency or infrastructure update

JUnit 4.13 has deprecated Assert.assertThat in favor of the Hamcrest
implementation of assertThat.  Switch to use the Hamcrest assertThat
method instead of the JUnit assertThat method.
@MarkEWaite MarkEWaite changed the title Use Hamcrest instead of deprecatd JUnit methods Use Hamcrest instead of deprecated JUnit methods Apr 20, 2020
@MarkEWaite MarkEWaite merged commit c99d18f into jenkinsci:master Apr 20, 2020
@MarkEWaite MarkEWaite deleted the handle-junit-assertThat-deprecation branch April 20, 2020 21:35
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.

1 participant