@Test
public void testRun() throws Exception {

    Server server = new Server(opts, userStore, communications);
    CommandLine.Option option = createNiceMock(CommandLine.Option.class);
    expect(opts.findByLongOption("server-key")).andReturn(option);
    option.getValue();
    expectLastCall().andReturn(ClassLoader.getSystemResource("test.pem").getFile());
    communications.setListenerKey(anyObject(PrivateKey.class));
    expectLastCall().once();
    communications.listen();
    expectLastCall().andReturn(0).once();
    replay(opts, userStore, communications, option);
    server.run();
    verify(communications);
}