Wednesday, October 27, 2021

Annotation Driven Design

 

 

Annotations are useful to tell:

-Constraints or usage of an element: e.g. @Deprecated, @Override, or @NotNull

- The "nature" of an element, e.g. @Entity, @TestCase, @WebService

-The behavior of an element: @Statefull, @Transaction

-How to process the element: @Column, @XmlElement

Some of the examples where annotations are used in test classes are:

  • @Before/BeforeEach :  Run before each test
  • @BeforeClass/BeforeAll : execute it only once before running all tests using @BeforeClass.
  • @AfterClass : Tear down
  • @AfterEach: Run after each method

No comments:

Post a Comment