@@ -0,0 +1,1838 @@
+package com.episode6.hackit.chop;%0A%0Aimport org.junit.After;%0Aimport org.junit.Before;%0Aimport org.junit.Test;%0Aimport org.junit.runner.RunWith;%0Aimport org.mockito.Mock;%0A%0Aimport static org.mockito.Matchers.any;%0Aimport static org.mockito.Matchers.anyString;%0Aimport static org.mockito.Matchers.eq;%0Aimport static org.mockito.Mockito.verify;%0Aimport static org.mockito.Mockito.when;%0A%0A/**%0A * Tests usage of a custom formatter to ensure the expected Strings get output to the trees%0A */%0A@RunWith(ChopTestTestRunner.class)%0Apublic class CustomFormatterTest %7B%0A%0A  @Mock Chop.Tree mTree;%0A  @Mock Chop.Formatter mFormatter;%0A%0A  @Before%0A  public void setUp() %7B%0A    when(mTree.supportsLevel(any(Chop.Level.class)))%0A        .thenReturn(true);%0A%0A    Chop.plantTree(mTree);%0A  %7D%0A%0A  @After%0A  public void cleanUp() %7B%0A    ChopInternals.TREE_FARM.digUpTree(mTree);%0A  %7D%0A%0A  @Test%0A  public void testSimpleMessage() %7B%0A    String expectedMessage = %22STOLEN MESSAGE%22;%0A    when(mFormatter.formatLog(anyString()))%0A        .thenReturn(expectedMessage);%0A%0A    Chop.withFormatter(mFormatter).d(%22My Log Message%22);%0A%0A    verify(mTree).chopLog(%0A        any(Chop.Level.class),%0A        anyString(),%0A        eq(expectedMessage));%0A  %7D%0A%0A  @Test%0A  public void testThrowableMessage() %7B%0A    String firstExpectedMessage = %22STOLEN MESSAGE%22;%0A    String secondExpectedMessage = %22STOLEN THROWABLE%22;%0A    when(mFormatter.formatLog(anyString()))%0A        .thenReturn(firstExpectedMessage);%0A    when(mFormatter.formatThrowable(any(Throwable.class)))%0A        .thenReturn(secondExpectedMessage);%0A%0A    Chop.withFormatter(mFormatter).d(new Throwable(), %22My Log Message%22);%0A%0A    verify(mTree).chopLog(%0A        any(Chop.Level.class),%0A        anyString(),%0A        eq(firstExpectedMessage));%0A    verify(mTree).chopLog(%0A        any(Chop.Level.class),%0A        anyString(),%0A        eq(secondExpectedMessage));%0A  %7D%0A%7D%0A

add a custom formatter test