public class MockLaunchConfig extends Object implements 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.
DEFAULT_MAX_CONTENT_LENGTH, DEFAULT_PORT| Constructor and Description |
|---|
MockLaunchConfig() |
| Modifier and Type | Method and Description |
|---|---|
InetAddress |
getAddress()
Returns null.
|
Background |
getBackground()
|
FileSystemBinding |
getBaseDir()
|
ByteBufAllocator |
getBufferAllocator()
|
Foreground |
getForeground()
|
HandlerFactory |
getHandlerFactory()
|
List<String> |
getIndexFiles()
Returns
Collections.emptyList(). |
int |
getMaxContentLength()
Returns 0.
|
String |
getOther(String key,
String defaultValue)
Returns the given
defaultValue, |
Map<String,String> |
getOtherPrefixedWith(String prefix)
Returns
Collections.emptyMap() |
int |
getPort()
Returns 0.
|
URI |
getPublicAddress()
Returns
new URI("http://localhost:5050"). |
SSLContext |
getSSLContext()
Returns null.
|
int |
getThreads()
Returns 0.
|
boolean |
isCompressResponses()
Returns false.
|
boolean |
isReloadable()
Returns false.
|
boolean |
isTimeResponses()
Returns false.
|
public FileSystemBinding getBaseDir()
getBaseDir in interface LaunchConfigpublic HandlerFactory getHandlerFactory()
getHandlerFactory in interface LaunchConfigpublic int getPort()
getPort in interface LaunchConfig@Nullable public InetAddress getAddress()
getAddress in interface LaunchConfigpublic boolean isReloadable()
isReloadable in interface LaunchConfigpublic int getThreads()
getThreads in interface LaunchConfigpublic Background getBackground()
getBackground in interface LaunchConfigReadOnlyContext.background(java.util.concurrent.Callable)public Foreground getForeground()
getForeground in interface LaunchConfigForegroundpublic ByteBufAllocator getBufferAllocator()
getBufferAllocator in interface LaunchConfigpublic URI getPublicAddress()
new URI("http://localhost:5050").getPublicAddress in interface LaunchConfignew URI("http://localhost:5050")public List<String> getIndexFiles()
Collections.emptyList().getIndexFiles in interface LaunchConfigCollections.emptyList()@Nullable public SSLContext getSSLContext()
getSSLContext in interface LaunchConfigpublic String getOther(String key, String defaultValue)
defaultValue,getOther in interface LaunchConfigkey - The property keydefaultValue - The value to return if the property was not setdefaultValue,public Map<String,String> getOtherPrefixedWith(String prefix)
Collections.emptyMap()getOtherPrefixedWith in interface LaunchConfigprefix - Property name prefix that should be used for filteringCollections.emptyMap()public int getMaxContentLength()
getMaxContentLength in interface LaunchConfigpublic boolean isTimeResponses()
isTimeResponses in interface LaunchConfigpublic boolean isCompressResponses()
isCompressResponses in interface LaunchConfig