Deprecated API
Contents
-
Deprecated ClassesClassDescriptionPlease use
Assert
instead.Please useTypeSafeMatcher
.Included for backwards compatibility with JUnit 4.4. Will be removed in the next major release. Please useBlockJUnit4ClassRunner
in place ofJUnit4ClassRunner
.Included for backwards compatibility with JUnit 4.4. Will be removed in the next major release. Please useBlockJUnit4ClassRunner
in place ofJUnit4ClassRunner
.Included for backwards compatibility with JUnit 4.4. Will be removed in the next major release. Please useBlockJUnit4ClassRunner
in place ofJUnit4ClassRunner
.Included for backwards compatibility with JUnit 4.4. Will be removed in the next major release. Please useBlockJUnit4ClassRunner
in place ofJUnit4ClassRunner
.Included for backwards compatibility with JUnit 4.4. Will be removed in the next major release. Please useBlockJUnit4ClassRunner
in place ofJUnit4ClassRunner
.Included for backwards compatibility with JUnit 4.4. Will be removed in the next major release. Please useBlockJUnit4ClassRunner
in place ofJUnit4ClassRunner
.UseTestWatcher
(which implementsTestRule
) instead.
-
Deprecated Exception ClassesException ClassDescriptionIncluded for backwards compatibility with JUnit 4.4. Will be removed in the next major release. Please use
BlockJUnit4ClassRunner
in place ofJUnit4ClassRunner
.
-
Deprecated MethodsMethodDescriptionUse
assertEquals(double expected, double actual, double delta)
insteaduse assertArrayEqualsUseassertEquals(String message, double expected, double actual, double delta)
insteaduse assertArrayEqualsuseorg.hamcrest.MatcherAssert.assertThat()
useorg.hamcrest.MatcherAssert.assertThat()
use storedLocally()Please useCoreMatchers.both(Matcher)
instead.Please useCoreMatchers.containsString(String)
instead.Please useCoreMatchers.either(Matcher)
instead.Please useCoreMatchers.everyItem(Matcher)
instead.Please useCoreMatchers.hasItem(Matcher)
instead.Please useCoreMatchers.hasItem(Object)
instead.Please useCoreMatchers.hasItems(Matcher...)
instead.Please useCoreMatchers.hasItems(Object...)
instead.AssertionErrors are handled by default since JUnit 4.12. Just like in JUnit <= 4.10.AssumptionViolatedExceptions are handled by default since JUnit 4.12. Just like in JUnit <= 4.10.Since 4.13Assert.assertThrows
can be used to verify that your code throws a specific exception.This is used only by the Theories runner, and does not use all the generic type info that it ought to. It will be replaced with a forthcoming ParameterSignature#canAcceptResultOf(FrameworkMethod) once Theories moves to junit-contrib.Please useParentRunner(org.junit.runners.model.TestClass)
.
-
Deprecated ConstructorsConstructorDescriptionsince 4.13.will be private soon.Please use
AssumptionViolatedException
instead.Please useAssumptionViolatedException
instead.Please useAssumptionViolatedException
instead.Please useAssumptionViolatedException
instead.Please useAssumptionViolatedException
instead.will be private soon.useFailOnTimeout.builder()
instead.