Class AbstractBeanTest<T>

  • Type Parameters:
    T - identifying the type to be tested is usually but not necessarily at least Serializable.
    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 testing Named beans. The test runs implicitly VerifyBeanProperty, therefore the annotation is optional, but it can be used for further configuration.

    As default all ObjectTestContracts a run, see shouldImplementObjectContracts()

    Documentation on how to setup the generator can be found at AbstractPropertyAwareFacesTest

    Documentation on the setup of the JSF-related test-infrastructure can be found at EnableJsfEnvironment

    It acts as an ConfigurationCallBackHandler, saying after initialization and prior to testing the method ConfigurationCallBackHandler.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
    • Method Detail

      • shouldImplementObjectContracts

        @Test
        public void shouldImplementObjectContracts()
        Specified by:
        shouldImplementObjectContracts in interface de.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