XmppAppender extends AppenderBase<E> { @Override public void start() { Roster.setDefaultSubscriptionMode(Roster.SubscriptionMode.accept_all); connectionConfiguration = new ConnectionConfiguration(xmmpServer, xmmpPort); xmmpConnect(); super.start(); }  void setSendToJid(String sendToJid); void setLayout(Layout<E> layout); void setXmmpAccount(String xmmpAccount); void setUsername(String username); void setPassword(String password); void setResourceName(String resourceName); @Override void stop(); @Override void start();  }
@Test public void testStart() throws Exception { Assert.assertFalse(appender.isStarted()); appender.start(); verify(roster).contains(SEND_TO); verify(connection).connect(); Assert.assertTrue(appender.isStarted()); }
@Test public void testAppendOn() throws Exception { appender.start(); appender.doAppend("Test message"); ArgumentCaptor<Message> messageArgumentCaptor = ArgumentCaptor.forClass(Message.class); verify(chat).sendMessage(messageArgumentCaptor.capture()); Message message = messageArgumentCaptor.getValue(); Assert.assertEquals("Test message", message.getBody()); }