vertx/src/test/java/eu/internetofus/common/vertx/ModelResourcesTest.java
/**
   * Check not found element if they are not defined.
   */
Check not found element if they are not defined.
Check not found element if they are not defined .
@Test
  public void shoulNotFoundElementWithIndexForUndefinedIndex() {
    final var models = new ArrayList<>();
    models.add(new DummyComplexModelTest().createModelExample(1));
    models.add(new DummyComplexModelTest().createModelExample(2));
    assertThat(ModelResources.searchElementByIndex().apply(models, null)).isEqualTo(-1);
    assertThat(ModelResources.searchElementByIndex().apply(models, -2)).isEqualTo(-1);
    assertThat(ModelResources.searchElementByIndex().apply(models, models.size())).isEqualTo(-1);
  }
@ Test public void shoulNotFoundElementWithIndexForUndefinedIndex ( ) { final var models = new ArrayList < > ( ) ; models . add ( new DummyComplexModelTest ( ) . createModelExample ( 1 ) ) ; models . add ( new DummyComplexModelTest ( ) . createModelExample ( 2 ) ) ; assertThat ( ModelResources . searchElementByIndex ( ) . apply ( models , null ) ) . isEqualTo ( - 1 ) ; assertThat ( ModelResources . searchElementByIndex ( ) . apply ( models , - 2 ) ) . isEqualTo ( - 1 ) ; assertThat ( ModelResources . searchElementByIndex ( ) . apply ( models , models . size ( ) ) ) . isEqualTo ( - 1 ) ; }
Check not found element if they are not defined.
Check not found element if they are not defined .