Package org.spincast.testing.defaults
Class NoAppStartHttpServerCustomContextTypesTestingBase<R extends RequestContext<?>,W extends WebsocketContext<?>>
java.lang.Object
org.spincast.testing.core.SpincastTestBase
org.spincast.testing.core.AppBasedTestingBase<R,W>
org.spincast.testing.defaults.NoAppStartHttpServerCustomContextTypesTestingBase<R,W>
- All Implemented Interfaces:
BeforeAfterClassMethodsProvider
,CanBeDisabled
,RepeatedClassAfterMethodProvider
,TestFailureListener
- Direct Known Subclasses:
NoAppStartHttpServerTestingBase
public abstract class NoAppStartHttpServerCustomContextTypesTestingBase<R extends RequestContext<?>,W extends WebsocketContext<?>>
extends AppBasedTestingBase<R,W>
Base class for testing without an App but when an HTTP
server is required.
Note that, by default, all routes are cleared
before each test! Even routes added by plugins...
To change this behavior, override the
clearRoutes()
method.
-
Field Summary
Fields inherited from class org.spincast.testing.core.SpincastTestBase
logger, spincastConfig
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Don't forget to first callsuper.beforeClass()
protected void
Allows some initialization to be run once the Guice context is created, but before the Server is started.void
Ran before every test.protected final void
Starts the application.protected void
protected SpincastBootstrapper
protected final AppTestingConfigs
We force test classes to provide information about the required testing configurations.protected String[]
protected abstract Class<? extends RequestContext<?>>
protected Class<? extends SpincastConfig>
protected abstract Class<? extends WebsocketContext<?>>
protected boolean
Should the default Spincast Routes be removed too? Or only the custom ones?protected void
Methods inherited from class org.spincast.testing.core.AppBasedTestingBase
afterClass, clearPreviousResponseCookies, CONNECT, CONNECT, CONNECT, createInjector, createTestUrl, createTestUrl, createTestUrl, createTestUrl, DELETE, DELETE, DELETE, formatDate, GET, GET, GET, getCookieFactory, getExtraExactBindingsToRemoveBeforePlugins, getExtraOverridingModule, getExtraPlugins, getGuiceTweakerExtraOverridingModule, getGuiceTweakerExtraPlugins, getHttpClient, getPreviousResponseCookie, getPreviousResponseCookies, getRouter, getServer, getTestingConfigImplementationClass, HEAD, HEAD, HEAD, isDisableBindCurrentClass, isDisableSllCetificateErrors, isIgnoreMethodsAnnotatedWithInjectDuringConfigurationsTweaking, isSetSecureFalseOnCookiesFromBag, OPTIONS, OPTIONS, OPTIONS, parseDate, PATCH, PATCH, PATCH, POST, POST, POST, PUT, PUT, PUT, saveResponseCookies, stopServer, TRACE, TRACE, TRACE, tweakConfigurations, validateCreatedInjector, websocket, websocket, websocket
Methods inherited from class org.spincast.testing.core.SpincastTestBase
addExtraSystemProperties, afterClassLoops, afterTest, beforeClassException, createGuiceTweaker, createTestingDir, createTestingFilePath, createTestingFilePath, deleteTestingWritableTempDir, getExtraSystemProperties, getGuiceTweakerFromThreadLocal, getGuiceTweakerPluginsToDisable, getInjector, getSpincastConfig, getTestingWritableTempDir, isTestClassDisabledPostBeforeClass, isTestClassDisabledPreBeforeClass, resetSystemProperties, testFailure
-
Constructor Details
-
NoAppStartHttpServerCustomContextTypesTestingBase
public NoAppStartHttpServerCustomContextTypesTestingBase()
-
-
Method Details
-
getAppTestingConfigs
Description copied from class:AppBasedTestingBase
We force test classes to provide information about the required testing configurations.The bindings for those components will be automatically created.
- Specified by:
getAppTestingConfigs
in classAppBasedTestingBase<R extends RequestContext<?>,
W extends WebsocketContext<?>> - Returns:
- the testing configs informations or
null
to disable this process (you will then have to add the required config bindings by yourself).
-
getTestingConfigImplementationClass2
-
callAppMainMethod
protected final void callAppMainMethod()Description copied from class:AppBasedTestingBase
Starts the application.In this method, you should call your application
main()
method.There is no need to start the
Server
here, since the target application is supposed to do it by itself, in general in an "@Inject init()" method!- Specified by:
callAppMainMethod
in classAppBasedTestingBase<R extends RequestContext<?>,
W extends WebsocketContext<?>>
-
createBootstrapper
-
getMainArgs
-
beforeClass
public void beforeClass()Don't forget to first callsuper.beforeClass()
- Specified by:
beforeClass
in interfaceBeforeAfterClassMethodsProvider
- Overrides:
beforeClass
in classAppBasedTestingBase<R extends RequestContext<?>,
W extends WebsocketContext<?>>
-
startServer
protected void startServer() -
beforeStartServer
protected void beforeStartServer()Allows some initialization to be run once the Guice context is created, but before the Server is started. -
beforeTest
public void beforeTest()Ran before every test.- Overrides:
beforeTest
in classSpincastTestBase
-
clearRoutes
protected void clearRoutes() -
removeSpincastRoutesToo
protected boolean removeSpincastRoutesToo()Should the default Spincast Routes be removed too? Or only the custom ones? -
getRequestContextImplementationClass
-
getWebsocketContextImplementationClass
-