vertx/src/test/java/eu/internetofus/common/vertx/ModelResourcesTest.java
/**
   * Should validate a model.
   *
   * @param resultHandler handler to manage the HTTP result.
   * @param success       function to call when the validation success.
   *
   * @see ModelResources#validate( ModelContext, ServiceContext, Runnable)
   */
Should validate a model.
@param resultHandler handler to manage the HTTP result.
@param success       function to call when the validation success.


Should validate a model . @param resultHandler handler to manage the HTTP result . @param success function to call when the validation success .
@Test
  public void shouldValidateModel(@Mock final Handler<AsyncResult<ServiceResponse>> resultHandler,
      @Mock final Runnable success) {
    final var model = this.createModelContext();
    final var expected = new DummyComplexModelTest().createModelExample(2);
    model.source = expected;
    final var context = this.createServiceContext(resultHandler);
    ModelResources.validate(model, context, success);
    verify(success, timeout(30000).times(1)).run();
    assertThat(model.value).isEqualTo(expected);
  }
@ Test public void shouldValidateModel ( @ Mock final Handler < AsyncResult < ServiceResponse > > resultHandler , @ Mock final Runnable success ) { final var model = this . createModelContext ( ) ; final var expected = new DummyComplexModelTest ( ) . createModelExample ( 2 ) ; model . source = expected ; final var context = this . createServiceContext ( resultHandler ) ; ModelResources . validate ( model , context , success ) ; verify ( success , timeout ( 30000 ) . times ( 1 ) ) . run ( ) ; assertThat ( model . value ) . isEqualTo ( expected ) ; }
Should validate a model.
Should validate a model .