Interface UniAsserter

  • All Known Subinterfaces:
    UnwrappableUniAsserter
    All Known Implementing Classes:
    DefaultUniAsserter, UniAsserterInterceptor

    public interface UniAsserter
    Used in conjunction with RunOnVertxContext (or similar annotations) in order to test assertions on APIs that return Uni and whose execution needs to occur on a Vert.x Event Loop Thread (such as Hibernate Reactive for example). The following example shows how this class is meant to be used:
     @QuarkusTest
     public class SomeTestClass {
    
         @RunOnVertxContext
         @Test
         public void someTest(UniAsserter asserter) {
             asserter
                     .assertNotNull(() -> MyAPI.someObject())
                     .assertEquals(() -> MyAPI.count(), 0L);
         }
     }
     
    As can be seen in example, UniAsserter is used as parameter of a test method for a class annotated with QuarkusTest.

    As far as the API is concerned, each assertion in the pipeline is executed when the result of the corresponding Uni becomes available.