Add MutabilityDetector
This commit is contained in:
parent
591e3507fb
commit
7b1c77c6bc
@ -26,6 +26,12 @@
|
|||||||
<version>3.5.2</version>
|
<version>3.5.2</version>
|
||||||
<scope>test</scope>
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.mutabilitydetector</groupId>
|
||||||
|
<artifactId>MutabilityDetector</artifactId>
|
||||||
|
<version>0.9.5</version>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
|
@ -3,6 +3,7 @@ package com.baeldung.immutable;
|
|||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
import static org.assertj.core.api.Assertions.assertThat;
|
import static org.assertj.core.api.Assertions.assertThat;
|
||||||
|
import static org.mutabilitydetector.unittesting.MutabilityAssert.assertImmutable;
|
||||||
|
|
||||||
public class ImmutablePersonTest {
|
public class ImmutablePersonTest {
|
||||||
|
|
||||||
@ -20,5 +21,7 @@ public class ImmutablePersonTest {
|
|||||||
|
|
||||||
assertThat(john.getAge())
|
assertThat(john.getAge())
|
||||||
.isEqualTo(42);
|
.isEqualTo(42);
|
||||||
|
|
||||||
|
assertImmutable(com.baeldung.immutable.ImmutablePerson.class);
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user