model/src/test/java/eu/internetofus/common/model/ValidateContextTest.java
/**
   * Should create a fail future for a field.
   *
   * @param testContext test context to use.
   *
   * @see ValidateContext#failFieldElement(String,int, String)
   */
Should create a fail future for a field.
@param testContext test context to use.


Should create a fail future for a field . @param testContext test context to use .
@Test
  public void shouldFailFieldElementWithMessage(final VertxTestContext testContext) {
    doReturn("codePrefix3").when(this.context).errorCode();
    final var future = this.context.failFieldElement("field", 4, "message3");
    testContext.assertFailure(future).onFailure(error -> {
      testContext.verify(() -> {
        assertThat(error).isInstanceOf(ValidationErrorException.class);
        final var cause = (ValidationErrorException) error;
        assertThat(cause.getCode()).isEqualTo("codePrefix3.field[4]");
        assertThat(cause.getMessage()).isEqualTo("message3");
      });
      testContext.completeNow();
    });
  }
@ Test public void shouldFailFieldElementWithMessage ( final VertxTestContext testContext ) { doReturn ( "codePrefix3" ) . when ( this . context ) . errorCode ( ) ; final var future = this . context . failFieldElement ( "field" , 4 , "message3" ) ; testContext . assertFailure ( future ) . onFailure ( error -> { testContext . verify ( ( ) -> { assertThat ( error ) . isInstanceOf ( ValidationErrorException . class ) ; final var cause = ( ValidationErrorException ) error ; assertThat ( cause . getCode ( ) ) . isEqualTo ( "codePrefix3.field[4]" ) ; assertThat ( cause . getMessage ( ) ) . isEqualTo ( "message3" ) ; } ) ; testContext . completeNow ( ) ; } ) ; }
Should create a fail future for a field.
Should create a fail future for a field .