Package de.cuioss.test.jsf.junit5
Class AbstractBeanTest<T>
- java.lang.Object
-
- de.cuioss.test.jsf.junit5.JsfEnabledTestEnvironment
-
- de.cuioss.test.jsf.junit5.AbstractPropertyAwareFacesTest<T>
-
- de.cuioss.test.jsf.junit5.AbstractBeanTest<T>
-
- Type Parameters:
T- identifying the type to be tested is usually but not necessarily at leastSerializable.
- All Implemented Interfaces:
JsfEnvironmentConsumer,de.cuioss.test.valueobjects.api.ObjectContractTestSupport,de.cuioss.test.valueobjects.objects.ConfigurationCallBackHandler<T>,de.cuioss.test.valueobjects.util.GeneratorRegistry
public abstract class AbstractBeanTest<T> extends AbstractPropertyAwareFacesTest<T> implements de.cuioss.test.valueobjects.api.ObjectContractTestSupport
Base class for testingNamedbeans. The test runs implicitlyVerifyBeanProperty, therefore the annotation is optional, but it can be used for further configuration.As default all
ObjectTestContractsa run, seeshouldImplementObjectContracts()Documentation on how to setup the generator can be found at
AbstractPropertyAwareFacesTestDocumentation on the setup of the JSF-related test-infrastructure can be found at
EnableJsfEnvironmentIt acts as an
ConfigurationCallBackHandler, saying after initialization and prior to testing the methodConfigurationCallBackHandler.configure(Object)will be called allowing the concrete test-class to do some specific configuration e.g. calling init-methods and such.You can easily access pre-configured instance by calling
anyBean().- Author:
- Oliver Wolff
-
-
Constructor Summary
Constructors Constructor Description AbstractBeanTest()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description TanyBean()protected de.cuioss.test.valueobjects.objects.ParameterizedInstantiator<T>getInstantiator()NeededParameterizedInstantiatorfor creating test Objects orshouldImplementObjectContracts()voidshouldImplementObjectContracts()-
Methods inherited from class de.cuioss.test.jsf.junit5.AbstractPropertyAwareFacesTest
getPropertyMetadata, getTargetBeanClass, initializeAbstractPropertyAwareFacesTest, resolvePropertyMetadata
-
Methods inherited from class de.cuioss.test.jsf.junit5.JsfEnabledTestEnvironment
getEnvironmentHolder, setEnvironmentHolder
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface de.cuioss.test.valueobjects.objects.ConfigurationCallBackHandler
configure
-
Methods inherited from interface de.cuioss.test.valueobjects.util.GeneratorRegistry
registerAdditionalGenerators
-
Methods inherited from interface de.cuioss.test.jsf.util.JsfEnvironmentConsumer
assertNavigatedWithOutcome, assertRedirect, getApplication, getApplicationConfigDecorator, getBeanConfigDecorator, getComponentConfigDecorator, getExternalContext, getFacesContext, getRequestConfigDecorator, getResponse
-
-
-
-
Constructor Detail
-
AbstractBeanTest
public AbstractBeanTest()
-
-
Method Detail
-
shouldImplementObjectContracts
@Test public void shouldImplementObjectContracts()
- Specified by:
shouldImplementObjectContractsin interfacede.cuioss.test.valueobjects.api.ObjectContractTestSupport
-
anyBean
public T anyBean()
- Returns:
- a fully configured instance of the bean with
ConfigurationCallBackHandler.configure(Object)being already called. 'Fully configured' is defined as all attributes that can be generated by corresponding generators are set
-
getInstantiator
protected de.cuioss.test.valueobjects.objects.ParameterizedInstantiator<T> getInstantiator()
NeededParameterizedInstantiatorfor creating test Objects orshouldImplementObjectContracts()
-
-