Package com.mimecast.robin.mx.util
Class LocalHttpsServer
java.lang.Object
com.mimecast.robin.mx.util.LocalHttpsServer
Local HTTPS Server.
Provides a HTTPS server for use in testing.
The server should be started after all path and responses have been put.
- Author:
- "Vlad Marian" (vmarian@mimecast.com)
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate HttpsServerHttpsServer instance.private static final Map<String, LocalHttpsResponse> HttpsServer database. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintgetPort()Gets port number.static voidput(String path, LocalHttpsResponse response) Put entries in database.voidstop()Stop server.
-
Field Details
-
map
HttpsServer database. -
httpServer
HttpsServer instance.
-
-
Constructor Details
-
LocalHttpsServer
public LocalHttpsServer() throws IOException, NoSuchAlgorithmException, KeyStoreException, CertificateException, UnrecoverableKeyException, KeyManagementExceptionConstructs a new HttpPolicyServerMock instance.- Throws:
IOException- IO exception.NoSuchAlgorithmException- No such algorithm exception.KeyStoreException- Key store exception.CertificateException- Certificate exception.UnrecoverableKeyException- Unrecoverable key exception.KeyManagementException- Key management exception.
-
-
Method Details
-
put
Put entries in database.- Parameters:
path- HTTP request path.response- LocalHttpsResponse instance.
-
getPort
public int getPort()Gets port number.- Returns:
- Port number.
-
stop
public void stop()Stop server.
-