Skip to content

Commit

Permalink
Issue checkstyle#4931: removed powermock tests for AuditEventDefaultF…
Browse files Browse the repository at this point in the history
…ormatter
  • Loading branch information
rnveach authored and ArneLimburg committed Aug 23, 2017
1 parent 2146d39 commit d907819
Showing 1 changed file with 4 additions and 9 deletions.
Expand Up @@ -99,19 +99,14 @@ public void testFormatModuleNameDoesNotContainCheckSuffix() {

@Test
public void testFormatModuleWithModuleId() {
final AuditEvent mock = PowerMockito.mock(AuditEvent.class);
when(mock.getSourceName()).thenReturn("TestModule");
when(mock.getSeverityLevel()).thenReturn(SeverityLevel.WARNING);
when(mock.getLine()).thenReturn(1);
when(mock.getColumn()).thenReturn(1);
when(mock.getMessage()).thenReturn("Mocked message.");
when(mock.getFileName()).thenReturn("InputMockFile.java");
when(mock.getModuleId()).thenReturn("ModuleId");
final LocalizedMessage message = new LocalizedMessage(1, 1, null, null, null,
SeverityLevel.WARNING, "ModuleId", TestModule.class, "Mocked message.");
final AuditEvent event = new AuditEvent("", "InputMockFile.java", message);
final AuditEventFormatter formatter = new AuditEventDefaultFormatter();

final String expected = "[WARN] InputMockFile.java:1:1: Mocked message. [ModuleId]";

assertEquals("Invalid format", expected, formatter.format(mock));
assertEquals("Invalid format", expected, formatter.format(event));
}

@Test
Expand Down

0 comments on commit d907819

Please sign in to comment.