components/src/test/java/eu/internetofus/common/components/models/WeNetUserProfileTest.java
/**
   * Check that the birth date is not on the future.
   *
   * @param vertx       event bus to use.
   * @param testContext context to test.
   *
   * @see WeNetUserProfile#merge(WeNetUserProfile, WeNetValidateContext)
   */
Check that the birth date is not on the future.
@param vertx       event bus to use.
@param testContext context to test.


Check that the birth date is not on the future . @param vertx event bus to use . @param testContext context to test .
@Test
  public void shouldNotMergeWithABirthDateOnTheFuture(final Vertx vertx, final VertxTestContext testContext) {
    final var source = new WeNetUserProfile();
    source.dateOfBirth = new AliveBirthDate();
    final var tomorrow = LocalDate.now().plusDays(1);
    source.dateOfBirth.year = tomorrow.getYear();
    source.dateOfBirth.month = (byte) tomorrow.getMonthValue();
    source.dateOfBirth.day = (byte) tomorrow.getDayOfMonth();
    assertCannotMerge(new WeNetUserProfile(), source, "dateOfBirth", new WeNetValidateContext("codePrefix", vertx),
        testContext);
  }
@ Test public void shouldNotMergeWithABirthDateOnTheFuture ( final Vertx vertx , final VertxTestContext testContext ) { final var source = new WeNetUserProfile ( ) ; source . dateOfBirth = new AliveBirthDate ( ) ; final var tomorrow = LocalDate . now ( ) . plusDays ( 1 ) ; source . dateOfBirth . year = tomorrow . getYear ( ) ; source . dateOfBirth . month = ( byte ) tomorrow . getMonthValue ( ) ; source . dateOfBirth . day = ( byte ) tomorrow . getDayOfMonth ( ) ; assertCannotMerge ( new WeNetUserProfile ( ) , source , "dateOfBirth" , new WeNetValidateContext ( "codePrefix" , vertx ) , testContext ) ; }
Check that the birth date is not on the future.
Check that the birth date is not on the future .