@SuppressWarnings("unchecked") @Test public void testIsNotFooledByUnlikelyPackageNameClashes() { TestIdentifier test = new TestIdentifier(CLASS1_NAME, TEST1_NAME); SpyLogCatWriter logCatWriter = new SpyLogCatWriter(); LogCatSerializer serializer = new LogCatSerializer(test, logCatWriter); List<LogCatMessage> logCatMessages = new ArrayList<>(); addTestStartEnd(logCatMessages, TEST2_NAME, CLASS1_NAME); addTestStartEnd(logCatMessages, TEST1_NAME, CLASS1_NAME); addTestStartEnd(logCatMessages, TEST2_NAME, CLASS1d_NAME); addTestStartEnd(logCatMessages, TEST1_NAME, CLASS1d_NAME); serializer.serializeLogs(logCatMessages); MatcherAssert.assertThat(logCatWriter.logCatMessages, IsIterableContainingInOrder.contains( logCatMessageWithString(startedMessage(TEST1_NAME, CLASS1_NAME)), logCatMessageWithString(finishedMessage(TEST1_NAME, CLASS1_NAME)) )); }
public void serializeLogs(List<LogCatMessage> logCatMessages) { List<LogCatMessage> filterLogCatMessages = filterLogCatMessages(logCatMessages); logCatWriter.writeLogs(test, filterLogCatMessages); }
LogCatSerializer { public void serializeLogs(List<LogCatMessage> logCatMessages) { List<LogCatMessage> filterLogCatMessages = filterLogCatMessages(logCatMessages); logCatWriter.writeLogs(test, filterLogCatMessages); } }
LogCatSerializer { public void serializeLogs(List<LogCatMessage> logCatMessages) { List<LogCatMessage> filterLogCatMessages = filterLogCatMessages(logCatMessages); logCatWriter.writeLogs(test, filterLogCatMessages); } LogCatSerializer(TestIdentifier test, LogCatWriter logCatWriter); }
LogCatSerializer { public void serializeLogs(List<LogCatMessage> logCatMessages) { List<LogCatMessage> filterLogCatMessages = filterLogCatMessages(logCatMessages); logCatWriter.writeLogs(test, filterLogCatMessages); } LogCatSerializer(TestIdentifier test, LogCatWriter logCatWriter); void serializeLogs(List<LogCatMessage> logCatMessages); }
LogCatSerializer { public void serializeLogs(List<LogCatMessage> logCatMessages) { List<LogCatMessage> filterLogCatMessages = filterLogCatMessages(logCatMessages); logCatWriter.writeLogs(test, filterLogCatMessages); } LogCatSerializer(TestIdentifier test, LogCatWriter logCatWriter); void serializeLogs(List<LogCatMessage> logCatMessages);  }