Package org.spincast.testing.core.utils
Class SpincastConfigTestingDefault
java.lang.Object
org.spincast.plugins.config.ConfigFinder
org.spincast.plugins.config.SpincastConfigDefault
org.spincast.testing.core.utils.SpincastConfigTestingDefault
- All Implemented Interfaces:
SpincastConfig
Default configurations for Spincast integration
testing.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.spincast.plugins.config.ConfigFinder
ConfigFinder.ConfigFinderBuilder
-
Field Summary
Fields inherited from class org.spincast.plugins.config.SpincastConfigDefault
ENVIRONMENT_NAME_DEFAULT
Fields inherited from class org.spincast.plugins.config.ConfigFinder
configs, logger, rawConfigs
-
Constructor Summary
ModifierConstructorDescriptionprotected
SpincastConfigTestingDefault
(SpincastConfigPluginConfig spincastConfigPluginConfig, boolean testingMode) Constructor -
Method Summary
Modifier and TypeMethodDescriptionIf a dictionary key is not found, how must Spincast react?int
The HTTP (unsecure) port on which the server will listen on.The "keypass" of theKeyStore
, for SSL.The path to theKeyStore
, for SSL.The "storepass" of theKeyStore
, for SSL.The type of theKeyStore
, for SSL.int
The HTTPS (secure) port on which the server will listen on.You should override this config!!!!The host/IP on which the server will listen to.boolean
We do not run in "debug" mode.boolean
Iftrue
, Spincast will always try to set a cookie to validate if cookies are enabled on the client.boolean
By default, ifSpincastConfig.getPublicServerHost()
returns"localhost"
,SpincastConfig.getEnvironmentName()
is not"local"
andSpincastConfig.isDevelopmentMode()
is false, an exception is thrown when the application starts.Methods inherited from class org.spincast.plugins.config.SpincastConfigDefault
getContentTypesToSkipGziping, getCookieNameFlashMessage, getCookieNameLocale, getCookieNameTimeZoneId, getCookiesValidatorCookieName, getDefaultLocale, getDefaultRouteCacheFilterSecondsNbr, getDefaultRouteCacheFilterSecondsNbrCdns, getDefaultStaticResourceCacheConfig, getDefaultTemplateVariablesFilterPosition, getDefaultTimeZone, getEnvironmentName, getHostForDefaultPublicServerSchemeHostPort, getJsonPathArrayIndexMax, getKeyMaxLengthWhenConvertingMapToJsonObject, getMaxNumberOfKeysWhenConvertingMapToJsonObject, getPublicServerHost, getPublicServerPort, getPublicServerScheme, getPublicURI, getQueryParamFlashMessageId, getRouteForwardingMaxNumber, getServerMaxRequestBodyBytes, getSpincastModelRootVariableName, getSpincastWritableDirPath, getTempDir, getValidationElementDefaultName, getWritableRootDir, init, isAddDefaultTemplateVariablesFilter, isDefaultRouteCacheFilterPrivate, isEnableHttp2, isRoutesCaseSensitive, isTestingMode, isWriteToDiskDynamicStaticResource
Methods inherited from class org.spincast.plugins.config.ConfigFinder
clearPrefixes, configure, expandMap, getAppJarDirectory, getAppRootDirectoryNoJar, getBigDecimal, getBigDecimal, getBigDecimalFromElement, getBigDecimalList, getBigDecimalList, getBoolean, getBoolean, getBooleanFromElement, getBooleanList, getBooleanList, getClasspathFilePath, getConfig, getConfig, getConfigFromMap, getConfigFromMap, getConfigList, getConfigList, getConfigs, getDate, getDate, getDateFromElement, getDateList, getDateList, getEnvironmentVariables, getEnvironmentVariablesConfigs, getEnvironmentVariablesPrefixes, getExternalFilePath, getInteger, getInteger, getIntegerFromElement, getIntegerList, getIntegerList, getLong, getLong, getLongFromElement, getLongList, getLongList, getMap, getMap, getMapList, getMapList, getRawConfig, getRawConfigs, getString, getString, getStringList, getStringList, getSystemPropertiesConfigs, getSystemPropertiesPrefixes, isEnvironmentVariablesStripPrefix, isExternalFileConfigsOverrideEnvironmentVariables, isSystemPropertiesStripPrefix, isThrowExceptionIfSpecifiedClasspathConfigFileIsNotFound, isThrowExceptionIfSpecifiedExternalConfigFileIsNotFound, loadYamlFileConfigs, mergeMaps
-
Constructor Details
-
SpincastConfigTestingDefault
@Inject protected SpincastConfigTestingDefault(SpincastConfigPluginConfig spincastConfigPluginConfig, boolean testingMode) Constructor
-
-
Method Details
-
isDevelopmentMode
public boolean isDevelopmentMode()We do not run in "debug" mode.- Specified by:
isDevelopmentMode
in interfaceSpincastConfig
- Overrides:
isDevelopmentMode
in classSpincastConfigDefault
- Returns:
true
if debug mode is enabled.
-
getServerHost
Description copied from interface:SpincastConfig
The host/IP on which the server will listen to. The default value is0.0.0.0
.- Specified by:
getServerHost
in interfaceSpincastConfig
- Overrides:
getServerHost
in classSpincastConfigDefault
- Returns:
- the host/IP
-
getHttpServerPort
public int getHttpServerPort()Description copied from interface:SpincastConfig
The HTTP (unsecure) port on which the server will listen on. If <= 0, it won't be used. The default value is44419
so HTTP is enabled by default.- Specified by:
getHttpServerPort
in interfaceSpincastConfig
- Overrides:
getHttpServerPort
in classSpincastConfigDefault
- Returns:
- the HTTP port
-
getHttpsServerPort
public int getHttpsServerPort()Description copied from interface:SpincastConfig
The HTTPS (secure) port on which the server will listen on. If <= 0, it won't be used. The default value is-1
so HTTPS is not enabled by default.- Specified by:
getHttpsServerPort
in interfaceSpincastConfig
- Overrides:
getHttpsServerPort
in classSpincastConfigDefault
- Returns:
- the HTTPS port
-
getPublicUrlBase
Description copied from class:SpincastConfigDefault
You should override this config!!!!- Specified by:
getPublicUrlBase
in interfaceSpincastConfig
- Overrides:
getPublicUrlBase
in classSpincastConfigDefault
-
getHttpsKeyStorePath
Description copied from interface:SpincastConfig
The path to theKeyStore
, for SSL. Can be a classpath path or and absolute path. The classpath will be checked first. Only used ifgetHttpsServerPort()
returns a port > 0. The default value isnull
.- Specified by:
getHttpsKeyStorePath
in interfaceSpincastConfig
- Overrides:
getHttpsKeyStorePath
in classSpincastConfigDefault
- Returns:
- the path to the
KeyStore
-
getHttpsKeyStoreType
Description copied from interface:SpincastConfig
The type of theKeyStore
, for SSL. For example: "JKS". Only used ifgetHttpsServerPort()
returns a port > 0. The default value isnull
.- Specified by:
getHttpsKeyStoreType
in interfaceSpincastConfig
- Overrides:
getHttpsKeyStoreType
in classSpincastConfigDefault
- Returns:
- the type of the
KeyStore
-
getHttpsKeyStoreStorePass
Description copied from interface:SpincastConfig
The "storepass" of theKeyStore
, for SSL. Only used ifgetHttpsServerPort()
returns a port > 0. The default value isnull
.- Specified by:
getHttpsKeyStoreStorePass
in interfaceSpincastConfig
- Overrides:
getHttpsKeyStoreStorePass
in classSpincastConfigDefault
- Returns:
- the "storepass" of the
KeyStore
-
getHttpsKeyStoreKeyPass
Description copied from interface:SpincastConfig
The "keypass" of theKeyStore
, for SSL. Only used ifgetHttpsServerPort()
returns a port > 0. The default value isnull
.- Specified by:
getHttpsKeyStoreKeyPass
in interfaceSpincastConfig
- Overrides:
getHttpsKeyStoreKeyPass
in classSpincastConfigDefault
- Returns:
- the "keypass" of the
KeyStore
-
isValidateLocalhostHost
public boolean isValidateLocalhostHost()Description copied from interface:SpincastConfig
By default, ifSpincastConfig.getPublicServerHost()
returns"localhost"
,SpincastConfig.getEnvironmentName()
is not"local"
andSpincastConfig.isDevelopmentMode()
is false, an exception is thrown when the application starts.This validation is to make sure the developers didn't forget to override the
SpincastConfig.getPublicUrlBase()
method when they release to a non local environment.You can disable this validation if you want.
- Specified by:
isValidateLocalhostHost
in interfaceSpincastConfig
- Overrides:
isValidateLocalhostHost
in classSpincastConfigDefault
-
isEnableCookiesValidator
public boolean isEnableCookiesValidator()Description copied from interface:SpincastConfig
Iftrue
, Spincast will always try to set a cookie to validate if cookies are enabled on the client.This is enabled by default
- Specified by:
isEnableCookiesValidator
in interfaceSpincastConfig
- Overrides:
isEnableCookiesValidator
in classSpincastConfigDefault
-
getDictionaryEntryNotFoundBehavior
Description copied from interface:SpincastConfig
If a dictionary key is not found, how must Spincast react?Note that if the key is not found for the current Locale, Spincast will first check if it exists for the fallback Locale (the empty Locale).
By default, in debug mode an exception is thrown. Otherwise, an empty string is returned but an error is logged.
- Specified by:
getDictionaryEntryNotFoundBehavior
in interfaceSpincastConfig
- Overrides:
getDictionaryEntryNotFoundBehavior
in classSpincastConfigDefault
-