Annotation Interface BctConfig


Annotation for configuring BCT settings in JUnit 5 tests.

This annotation can be applied to test classes or test methods to automatically configure BCT settings before tests run and clear them after tests complete.

Example:

@BctConfig(sortMaps=TriState.TRUE) class MyTest { @Test @BctConfig(sortCollections=TriState.TRUE) void testFoo() { // sortMaps and sortCollections are both enabled } }

Method-level annotations override class-level annotations.

  • Element Details

    • sortMaps

      Enable sorting of maps in BCT assertions.
      Returns:
      TriState.TRUE to enable map sorting, TriState.FALSE to disable, or TriState.UNSET to inherit from class-level annotation.
      Default:
      UNSET
    • sortCollections

      Enable sorting of collections in BCT assertions.
      Returns:
      TriState.TRUE to enable collection sorting, TriState.FALSE to disable, or TriState.UNSET to inherit from class-level annotation.
      Default:
      UNSET
    • beanConverter

      Custom bean converter class to use for BCT assertions.

      If specified (not the default BeanConverter), the class will be instantiated using its no-arg constructor and set as the converter for the current thread.

      Example:

      @BctConfiguration(beanConverter=MyCustomConverter.class) class MyTest { @Test void testFoo() { // Uses MyCustomConverter for all assertions } }

      Returns:
      The bean converter class to instantiate and use, or BeanConverter to use the default.
      Default:
      org.apache.juneau.junit.bct.BeanConverter.class