@Before public void setUp() { final Settings settings = mock(Settings.class); when(settings.getMe()).thenReturn(new User("Test", 1234)); messageParser = new MessageParser(mock(MessageResponder.class), settings); TestUtils.setFieldValue(messageParser, "loggedOn", true); log = TestUtils.setFieldValueWithMock(messageParser, "LOG", Logger.class); }