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 LaunchConfig
public HandlerFactory getHandlerFactory()
getHandlerFactory
in interface LaunchConfig
public int getPort()
getPort
in interface LaunchConfig
@Nullable public InetAddress getAddress()
getAddress
in interface LaunchConfig
public boolean isReloadable()
isReloadable
in interface LaunchConfig
public int getThreads()
getThreads
in interface LaunchConfig
public Background getBackground()
getBackground
in interface LaunchConfig
ReadOnlyContext.background(java.util.concurrent.Callable)
public Foreground getForeground()
getForeground
in interface LaunchConfig
Foreground
public ByteBufAllocator getBufferAllocator()
getBufferAllocator
in interface LaunchConfig
public URI getPublicAddress()
new URI("http://localhost:5050")
.getPublicAddress
in interface LaunchConfig
new URI("http://localhost:5050")
public List<String> getIndexFiles()
Collections.emptyList()
.getIndexFiles
in interface LaunchConfig
Collections.emptyList()
@Nullable public SSLContext getSSLContext()
getSSLContext
in interface LaunchConfig
public String getOther(String key, String defaultValue)
defaultValue
,getOther
in interface LaunchConfig
key
- 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 LaunchConfig
prefix
- Property name prefix that should be used for filteringCollections.emptyMap()
public int getMaxContentLength()
getMaxContentLength
in interface LaunchConfig
public boolean isTimeResponses()
isTimeResponses
in interface LaunchConfig
public boolean isCompressResponses()
isCompressResponses
in interface LaunchConfig