vertx/src/test/java/eu/internetofus/common/vertx/ModelResourcesTest.java
/**
   * Check found element by id.
   */
Check found element by id.
Check found element by id .
@Test
  public void shouldFoundElementWithId() {
    final var models = new ArrayList<DummyComplexModel>();
    final BiPredicate<DummyComplexModel, String> idComparator = (dummy, id) -> id != null && id.equals(dummy.id);
    for (var i = 0; i < 10; i++) {
      models.add(new DummyComplexModelTest().createModelExample(i));
      assertThat(ModelResources.searchElementById(idComparator).apply(models, models.get(i).id)).isEqualTo(i);
    }
  }
@ Test public void shouldFoundElementWithId ( ) { final var models = new ArrayList < DummyComplexModel > ( ) ; final BiPredicate < DummyComplexModel , String > idComparator = ( dummy , id ) -> id != null && id . equals ( dummy . id ) ; for ( var i = 0 ; i < 10 ; i ++ ) { models . add ( new DummyComplexModelTest ( ) . createModelExample ( i ) ) ; assertThat ( ModelResources . searchElementById ( idComparator ) . apply ( models , models . get ( i ) . id ) ) . isEqualTo ( i ) ; } }
Check found element by id.
Check found element by id .