Created
September 11, 2011 23:52
-
-
Save coderunner/1210314 to your computer and use it in GitHub Desktop.
abstract logger setup
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class TestLogger | |
| { | |
| private static final String LOGGER_NAME = "logger_name"; | |
| private static final Level LEVEL = Level.INFO; | |
| private static final String MESSAGE = "message"; | |
| private static final String FORMATTED_LOG = LOGGER_NAME + " - " + LEVEL + " : " + MESSAGE; | |
| private Logger logger; | |
| @Before | |
| public void setup() | |
| { | |
| logger = spy(new Logger(LOGGER_NAME) | |
| { | |
| @Override | |
| protected void log(String formattedLog) | |
| {} | |
| }); | |
| //mock abstract method | |
| doNothing().when(logger).log(anyString()); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment