vertx/src/test/java/eu/internetofus/common/vertx/ModelResourcesTest.java
/**
   * Check not found element if any element has the id.
   */
Check not found element if any element has the id.
Check not found element if any element has the id .
@Test
  public void shoulNotFoundElementWithIdForUndefinedId() {
    final var models = new ArrayList<DummyComplexModel>();
    models.add(new DummyComplexModelTest().createModelExample(1));
    models.add(new DummyComplexModelTest().createModelExample(2));
    final BiPredicate<DummyComplexModel, String> idComparator = (dummy, id) -> id != null && id.equals(dummy.id);
    assertThat(ModelResources.searchElementById(idComparator).apply(models, "undefinedId")).isEqualTo(-1);
  }
@ Test public void shoulNotFoundElementWithIdForUndefinedId ( ) { final var models = new ArrayList < DummyComplexModel > ( ) ; models . add ( new DummyComplexModelTest ( ) . createModelExample ( 1 ) ) ; models . add ( new DummyComplexModelTest ( ) . createModelExample ( 2 ) ) ; final BiPredicate < DummyComplexModel , String > idComparator = ( dummy , id ) -> id != null && id . equals ( dummy . id ) ; assertThat ( ModelResources . searchElementById ( idComparator ) . apply ( models , "undefinedId" ) ) . isEqualTo ( - 1 ) ; }
Check not found element if any element has the id.
Check not found element if any element has the id .