Class BeanInstanceMapFixture

Object
BeanInstanceMapFixture

public class BeanInstanceMapFixture extends Object
Creates a BeanInstanceMap with useful entries for testing, and associates it with bean creation.
Author:
Owen Feehan
  • Method Details

    • ensureStackReader

      public static StackReader ensureStackReader()
      Ensure a StackReader instance exists in the underlying BeanInstanceMap.
      Returns:
      the instance, as already exists, or if newly created.
    • ensureStackWriter

      public static StackWriter ensureStackWriter(boolean tiff)
      Ensure a StackWriter instance exists in the underlying BeanInstanceMap.

      This leaves a global side-affect after being used, which may affect subsequent tests run in the same maven unit.

      Parameters:
      tiff - if true, TIFFs are created, otherwise PNGs.
      Returns:
      the instance, as already exists, or if newly created.
    • removeStackWriter

      public static void removeStackWriter()
      Removes any StackWriter that may exist in the underlying BeanInstanceMap.
    • ensureImageMetadataReader

      public static ImageMetadataReader ensureImageMetadataReader()
      Ensure a ImageMetadataReader instance exists in the underlying BeanInstanceMap.
      Returns:
      the instance, as already exists, or if newly created.
    • ensureInterpolator

      public static Interpolator ensureInterpolator()
      Ensure a default Interpolator instance exists in the underlying BeanInstanceMap.
      Returns:
      the instance, as already exists, or if newly created.
    • ensureInterpolator

      public static Interpolator ensureInterpolator(Interpolator interpolator)
      Ensure a specific Interpolator instance exists in the underlying BeanInstanceMap.
      Parameters:
      interpolator - the interpolator to add, if necessary.
      Returns:
      the instance, as already exists, or if newly created.
    • ensureStackDisplayer

      public static StackDisplayer ensureStackDisplayer()
      Ensure a StackDisplayer instance exists in the underlying BeanInstanceMap.
      Returns:
      the instance, as already exists, or if newly created.
    • check

      public static <T extends AnchorBean<?>> T check(T bean)
      Checks if a bean has all necessary items, throwing a run-time exception if it does not.
      Type Parameters:
      T - bean-type
      Parameters:
      bean - bean to check.
      Returns:
      the checked bean
      Throws:
      AnchorFriendlyRuntimeException - if the bean is misconfigured