use of com.thoughtworks.go.server.Jetty9Server in project gocd by gocd.
the class GoPlainSocketConnectorTest method setUp.
@Before
public void setUp() {
SystemEnvironment systemEnvironment = mock(SystemEnvironment.class);
when(systemEnvironment.getServerPort()).thenReturn(1234);
when(systemEnvironment.get(SystemEnvironment.RESPONSE_BUFFER_SIZE)).thenReturn(100);
when(systemEnvironment.get(SystemEnvironment.IDLE_TIMEOUT)).thenReturn(200);
when(systemEnvironment.getListenHost()).thenReturn("foo");
when(systemEnvironment.get(SystemEnvironment.GO_SSL_CONFIG_ALLOW)).thenReturn(true);
when(systemEnvironment.get(SystemEnvironment.GO_SSL_RENEGOTIATION_ALLOWED)).thenReturn(true);
Jetty9Server server = new Jetty9Server(systemEnvironment, null, mock(SSLSocketFactory.class));
connector = (ServerConnector) new GoPlainSocketConnector(server, systemEnvironment).getConnector();
HttpConnectionFactory connectionFactory = (HttpConnectionFactory) connector.getDefaultConnectionFactory();
configuration = connectionFactory.getHttpConfiguration();
}
use of com.thoughtworks.go.server.Jetty9Server in project gocd by gocd.
the class GoSslSocketConnectorTest method setUp.
@Before
public void setUp() throws Exception {
keystore = folder.newFile("keystore");
truststore = folder.newFile("truststore");
GoSSLConfig cipherSuite = mock(GoSSLConfig.class);
String[] cipherSuitesToBeIncluded = { "FOO" };
when(cipherSuite.getCipherSuitesToBeIncluded()).thenReturn(cipherSuitesToBeIncluded);
SystemEnvironment systemEnvironment = mock(SystemEnvironment.class);
when(systemEnvironment.getSslServerPort()).thenReturn(1234);
when(systemEnvironment.keystore()).thenReturn(keystore);
when(systemEnvironment.truststore()).thenReturn(truststore);
when(systemEnvironment.get(SystemEnvironment.RESPONSE_BUFFER_SIZE)).thenReturn(100);
when(systemEnvironment.get(SystemEnvironment.IDLE_TIMEOUT)).thenReturn(200);
when(systemEnvironment.getListenHost()).thenReturn("foo");
Jetty9Server jettyServer = mock(Jetty9Server.class);
when(jettyServer.getServer()).thenReturn(new Server());
sslSocketConnector = new GoSslSocketConnector(jettyServer, "password", systemEnvironment, cipherSuite);
}
Aggregations