Class PojoTest

java.lang.Object
com.github.tadukoo.junit.PojoTest
All Implemented Interfaces:
DefaultTestValues

public class PojoTest extends Object implements DefaultTestValues
Pojo Test is used to test regular POJOs.
Version:
Alpha v.0.1
Author:
Logan Ferree (Tadukoo)
  • Constructor Details

    • PojoTest

      private PojoTest()
      Not allowed to create a PojoTest instance
  • Method Details

    • assertValueGetSet

      public static <V, T extends Throwable, T2 extends Throwable> void assertValueGetSet(com.github.tadukoo.util.functional.supplier.ThrowingSupplier<V,T> getter, com.github.tadukoo.util.functional.consumer.ThrowingConsumer<V,T2> setter, V value, V value2) throws T, T2
      Method to test a getter and setter for a Pojo, that a value can be set and retrieved. It is set and retrieved twice in a row to check for adding/appending or just always returning the expected value.
      Type Parameters:
      V - The value type being set and retrieved
      T - A Throwable that the getter can throw
      T2 - A Throwable that the setter can throw
      Parameters:
      getter - The getter to be tested
      setter - The setter to be tested
      value - The first value to be used for testing
      value2 - The second value to be used for testing
      Throws:
      T - If the getter throws it
      T2 - If the setter throws it
      org.opentest4j.AssertionFailedError - If an assertion fails
    • assertStringGetSet

      public static <T extends Throwable, T2 extends Throwable> void assertStringGetSet(com.github.tadukoo.util.functional.supplier.ThrowingSupplier<String,T> getter, com.github.tadukoo.util.functional.consumer.ThrowingConsumer<String,T2> setter) throws T, T2
      Method to test a String getter and setter for a Pojo, that a value can be set and retrieved. It is set and retrieved twice in a row to check for adding/appending or just always returning the expected value.
      Type Parameters:
      T - A Throwable that the getter can throw
      T2 - A Throwable that the setter can throw
      Parameters:
      getter - The String getter to be tested
      setter - The String setter to be tested
      Throws:
      T - If the getter throws it
      T2 - If the setter throws it
      org.opentest4j.AssertionFailedError - If an assertion fails
    • assertDoubleGetSet

      public static <T extends Throwable, T2 extends Throwable> void assertDoubleGetSet(com.github.tadukoo.util.functional.supplier.ThrowingSupplier<Double,T> getter, com.github.tadukoo.util.functional.consumer.ThrowingConsumer<Double,T2> setter) throws T, T2
      Method to test a double getter and setter for a Pojo, that a value can be set and retrieved. It is set and retrieved twice in a row to check for adding/appending or just always returning the expected value.
      Type Parameters:
      T - A Throwable that the getter can throw
      T2 - A Throwable that the setter can throw
      Parameters:
      getter - The double getter to be tested
      setter - The double setter to be tested
      Throws:
      T - If the getter throws it
      T2 - If the setter throws it
      org.opentest4j.AssertionFailedError - If an assertion fails