@Test
public void testRunWithBadKey() throws Exception {

    expectedException.expect(OpenSSLRSAPEM.DER.MalformedDERException.class);
    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.der").getFile());
    replay(opts, userStore, communications, option);
    server.run();
}