Package com.avanza.astrix.test
Interface TestApi.TestContext
-
- Enclosing interface:
- TestApi
public static interface TestApi.TestContext
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description <T> TgetBean(java.lang.Class<T> beanType)Each TestContext has an AstrixContext (which is managed by the associated AstrixRule).<T> TgetBean(java.lang.Class<T> beanType, java.lang.String qualifier)seegetBean(Class)<T extends TestApi>
TgetTestApi(java.lang.Class<T> testApi)Returns a TestApi instance from the given TestContext.<T> voidregisterService(java.lang.Class<T> serviceBean, java.lang.String qualifier, T serviceImpl)<T> voidregisterService(java.lang.Class<T> serviceBean, T serviceImpl)Registers a given Service in the associated TestContext.
-
-
-
Method Detail
-
registerService
<T> void registerService(java.lang.Class<T> serviceBean, T serviceImpl)Registers a given Service in the associated TestContext. The service will be registered in the service registry associated with the given TestContext.- Parameters:
serviceBean-serviceImpl-
-
registerService
<T> void registerService(java.lang.Class<T> serviceBean, java.lang.String qualifier, T serviceImpl)- Parameters:
serviceBean-qualifier-serviceImpl-
-
getBean
<T> T getBean(java.lang.Class<T> beanType)
Each TestContext has an AstrixContext (which is managed by the associated AstrixRule). The AstrixContext is shared between all TestApi instances. Beans might be pulled from the AstrixContext using this method.
-
getBean
<T> T getBean(java.lang.Class<T> beanType, java.lang.String qualifier)seegetBean(Class)
-
getTestApi
<T extends TestApi> T getTestApi(java.lang.Class<T> testApi)
Returns a TestApi instance from the given TestContext.- Parameters:
testApi-- Returns:
-
-