public class MutabilityAsserter extends Object
AssertionError
if the result is not as expected.
Instances of this class provide the methods accessed by
MutabilityAssert
. More detailed documentation can be found there.
Modifier and Type | Method and Description |
---|---|
void |
assertImmutable(Class<?> expectedImmutableClass) |
void |
assertInstancesOf(Class<?> clazz,
org.hamcrest.Matcher<AnalysisResult> mutabilityMatcher) |
void |
assertInstancesOf(Class<?> clazz,
org.hamcrest.Matcher<AnalysisResult> mutabilityMatcher,
Iterable<org.hamcrest.Matcher<MutableReasonDetail>> allowingAll) |
void |
assertInstancesOf(Class<?> clazz,
org.hamcrest.Matcher<AnalysisResult> mutabilityMatcher,
org.hamcrest.Matcher<MutableReasonDetail> allowing) |
void |
assertInstancesOf(Class<?> clazz,
org.hamcrest.Matcher<AnalysisResult> mutabilityMatcher,
org.hamcrest.Matcher<MutableReasonDetail> allowingFirst,
org.hamcrest.Matcher<MutableReasonDetail> allowingSecond) |
void |
assertInstancesOf(Class<?> clazz,
org.hamcrest.Matcher<AnalysisResult> mutabilityMatcher,
org.hamcrest.Matcher<MutableReasonDetail> allowingFirst,
org.hamcrest.Matcher<MutableReasonDetail> allowingSecond,
org.hamcrest.Matcher<MutableReasonDetail> allowingThird) |
void |
assertInstancesOf(Class<?> clazz,
org.hamcrest.Matcher<AnalysisResult> mutabilityMatcher,
org.hamcrest.Matcher<MutableReasonDetail> allowingFirst,
org.hamcrest.Matcher<MutableReasonDetail> allowingSecond,
org.hamcrest.Matcher<MutableReasonDetail> allowingThird,
org.hamcrest.Matcher<MutableReasonDetail>... allowingRest) |
static MutabilityAsserter |
configured(Configuration configuration)
Create a new asserter with an existing
Configuration . |
static MutabilityAsserter |
configured(ConfigurationBuilder configuration)
Create a new asserter with a
Configuration as built by the given
ConfigurationBuilder . |
public static MutabilityAsserter configured(Configuration configuration)
Configuration
.
Example:
MutabilityAsserter.configured(MyConfigurations.DEFAULT_CONFIGURATIONS);
public static MutabilityAsserter configured(ConfigurationBuilder configuration)
Configuration
as built by the given
ConfigurationBuilder
.
Use this method when you want to build a one-time Configuration inline..
Example:
MutabilityAsserter.configured(new ConfigurationBuilder() {
@Override public void configure() {
hardcodeAsDefinitelyImmutable(ActuallyImmutable.class);
}
});
public void assertImmutable(Class<?> expectedImmutableClass)
MutabilityAssert.assertImmutable(Class)
public void assertInstancesOf(Class<?> clazz, org.hamcrest.Matcher<AnalysisResult> mutabilityMatcher)
public void assertInstancesOf(Class<?> clazz, org.hamcrest.Matcher<AnalysisResult> mutabilityMatcher, org.hamcrest.Matcher<MutableReasonDetail> allowing)
public void assertInstancesOf(Class<?> clazz, org.hamcrest.Matcher<AnalysisResult> mutabilityMatcher, org.hamcrest.Matcher<MutableReasonDetail> allowingFirst, org.hamcrest.Matcher<MutableReasonDetail> allowingSecond)
public void assertInstancesOf(Class<?> clazz, org.hamcrest.Matcher<AnalysisResult> mutabilityMatcher, org.hamcrest.Matcher<MutableReasonDetail> allowingFirst, org.hamcrest.Matcher<MutableReasonDetail> allowingSecond, org.hamcrest.Matcher<MutableReasonDetail> allowingThird)
public void assertInstancesOf(Class<?> clazz, org.hamcrest.Matcher<AnalysisResult> mutabilityMatcher, org.hamcrest.Matcher<MutableReasonDetail> allowingFirst, org.hamcrest.Matcher<MutableReasonDetail> allowingSecond, org.hamcrest.Matcher<MutableReasonDetail> allowingThird, org.hamcrest.Matcher<MutableReasonDetail>... allowingRest)
public void assertInstancesOf(Class<?> clazz, org.hamcrest.Matcher<AnalysisResult> mutabilityMatcher, Iterable<org.hamcrest.Matcher<MutableReasonDetail>> allowingAll)
Copyright © 2008–2022 Graham Allan. All rights reserved.