public class MockLaunchConfig
extends java.lang.Object
implements ratpack.launch.LaunchConfig
LaunchConfig implementation designed to be used when unit testing.
Methods of this class return sensible default values where possible, and throw UnsupportedOperationException when that is not possible.
If your test requires specific values, simply override the relevant method.
| Constructor and Description |
|---|
MockLaunchConfig() |
| Modifier and Type | Method and Description |
|---|---|
java.net.InetAddress |
getAddress()
Returns null.
|
ratpack.handling.Background |
getBackground()
Throws
UnsupportedOperationException |
ratpack.file.FileSystemBinding |
getBaseDir()
Throws
UnsupportedOperationException |
io.netty.buffer.ByteBufAllocator |
getBufferAllocator()
Throws
UnsupportedOperationException |
ratpack.handling.Foreground |
getForeground()
Throws
UnsupportedOperationException |
ratpack.launch.HandlerFactory |
getHandlerFactory()
Throws
UnsupportedOperationException |
java.util.List<java.lang.String> |
getIndexFiles()
Returns
Collections.emptyList(). |
int |
getMaxContentLength()
Returns 0.
|
java.lang.String |
getOther(java.lang.String key,
java.lang.String defaultValue)
Returns the given
defaultValue, |
java.util.Map<java.lang.String,java.lang.String> |
getOtherPrefixedWith(java.lang.String prefix)
Returns
Collections.emptyMap() |
int |
getPort()
Returns 0.
|
java.net.URI |
getPublicAddress()
Returns
new URI("http://localhost:5050"). |
javax.net.ssl.SSLContext |
getSSLContext()
Returns null.
|
int |
getThreads()
Returns 0.
|
boolean |
isCompressResponses()
Returns false.
|
boolean |
isReloadable()
Returns false.
|
boolean |
isTimeResponses()
Returns false.
|
public ratpack.file.FileSystemBinding getBaseDir()
UnsupportedOperationExceptiongetBaseDir in interface ratpack.launch.LaunchConfigpublic ratpack.launch.HandlerFactory getHandlerFactory()
UnsupportedOperationExceptiongetHandlerFactory in interface ratpack.launch.LaunchConfigpublic int getPort()
getPort in interface ratpack.launch.LaunchConfig@Nullable public java.net.InetAddress getAddress()
getAddress in interface ratpack.launch.LaunchConfigpublic boolean isReloadable()
isReloadable in interface ratpack.launch.LaunchConfigpublic int getThreads()
getThreads in interface ratpack.launch.LaunchConfigpublic ratpack.handling.Background getBackground()
UnsupportedOperationExceptiongetBackground in interface ratpack.launch.LaunchConfigpublic ratpack.handling.Foreground getForeground()
UnsupportedOperationExceptiongetForeground in interface ratpack.launch.LaunchConfigpublic io.netty.buffer.ByteBufAllocator getBufferAllocator()
UnsupportedOperationExceptiongetBufferAllocator in interface ratpack.launch.LaunchConfigpublic java.net.URI getPublicAddress()
new URI("http://localhost:5050").getPublicAddress in interface ratpack.launch.LaunchConfignew URI("http://localhost:5050")public java.util.List<java.lang.String> getIndexFiles()
Collections.emptyList().getIndexFiles in interface ratpack.launch.LaunchConfigCollections.emptyList()@Nullable public javax.net.ssl.SSLContext getSSLContext()
getSSLContext in interface ratpack.launch.LaunchConfigpublic java.lang.String getOther(java.lang.String key,
java.lang.String defaultValue)
defaultValue,getOther in interface ratpack.launch.LaunchConfigkey - The property keydefaultValue - The value to return if the property was not setdefaultValue,public java.util.Map<java.lang.String,java.lang.String> getOtherPrefixedWith(java.lang.String prefix)
Collections.emptyMap()getOtherPrefixedWith in interface ratpack.launch.LaunchConfigprefix - Property name prefix that should be used for filteringCollections.emptyMap()public int getMaxContentLength()
getMaxContentLength in interface ratpack.launch.LaunchConfigpublic boolean isTimeResponses()
isTimeResponses in interface ratpack.launch.LaunchConfigpublic boolean isCompressResponses()
isCompressResponses in interface ratpack.launch.LaunchConfig