Skip to content
This repository has been archived by the owner on Feb 10, 2023. It is now read-only.

Commit

Permalink
Add a failing test that exposes a mutability detector bug
Browse files Browse the repository at this point in the history
This ought to work, but even if the test fails, the exception
currently thrown by the mutability detector indicates that
there is probably a problem with the mutability detector.
  • Loading branch information
seanjreilly committed Jul 8, 2014
1 parent e23fcba commit 184625f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion library/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ sourceCompatibility = "1.8"
targetCompatibility = "1.8"

dependencies {
testCompile junit, mockito, spring
testCompile junit, mockito, spring, mutabilityDetector
}

group = 'com.equalexperts'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

import static org.hamcrest.CoreMatchers.containsString;
import static org.junit.Assert.*;
import static org.mutabilitydetector.unittesting.MutabilityAssert.assertInstancesOf;
import static org.mutabilitydetector.unittesting.MutabilityMatchers.areImmutable;

public class LogicalLogRecordTest {

Expand Down Expand Up @@ -88,6 +90,11 @@ public void format_shouldProduceAnAppropriatelyFormattedMessage_givenAThrowable(
assertEquals("2014-04-01T13:37:00.123Z,CODE-Bar,A Bar event occurred, with argument 42 #EXCEPTION_HERE#", result);
}

@Test
public void class_shouldBeImmutable() throws Exception {
assertInstancesOf(LogicalLogRecord.class, areImmutable());
}

private static enum TestMessages implements LogMessage {
Foo("CODE-Foo", "An event of some kind occurred"),
Bar("CODE-Bar", "A Bar event occurred, with argument %d");
Expand Down

0 comments on commit 184625f

Please sign in to comment.