Class TestDescuentoParametrizedJUnit4

java.lang.Object
giis.demo.descuento.ut.TestDescuentoParametrizedJUnit4

@DataJpaTest @TestPropertySource(locations="classpath:application-test.properties") public class TestDescuentoParametrizedJUnit4 extends Object
Ilustra las principales al usar JUnit 4 en vez de JUnit 5/6. Para ello usa el mismo test que TestDescuentoParametrized. Como los test parametrizados nativos no tienen mucha flexibilidad, utiliza otro componente JUnitParams
  • Field Details

    • log

      private static final org.slf4j.Logger log
    • entityManager

      @Autowired private org.springframework.boot.jpa.test.autoconfigure.TestEntityManager entityManager
    • cliente

      @Autowired private ClienteRepository cliente
    • SPRING_CLASS_RULE

      public static final org.springframework.test.context.junit4.rules.SpringClassRule SPRING_CLASS_RULE
    • springMethodRule

      public final org.springframework.test.context.junit4.rules.SpringMethodRule springMethodRule
    • name

      public org.junit.rules.TestName name
  • Constructor Details

    • TestDescuentoParametrizedJUnit4

      public TestDescuentoParametrizedJUnit4()
  • Method Details

    • setUp

      public void setUp()
    • loadCleanDatabase

      public void loadCleanDatabase()
    • testParametrizado

      public void testParametrizado(Integer edad, String expected)
      El test parametrizado ejecuta el proceso de obtencion de los descuentos para dos edades que causan diferentes resultados