model/src/test/java/eu/internetofus/common/model/ModelTest.java
/**
   * Check that convert a list to models to array and vice verse.
   */
Check that convert a list to models to array and vice verse.
Check that convert a list to models to array and vice verse .
@Test
  public void shoulConvertFromToArrayBeEquals() {
    final List<DummyModel> models = new ArrayList<>();
    for (var i = 0; i < 10; i++) {
      final var model = new DummyModelTest().createModelExample(i);
      models.add(model);
    }
    final var array = Model.toJsonArray(models);
    assertThat(array).isNotNull();
    final var result = Model.fromJsonArray(array, DummyModel.class);
    assertThat(result).isNotNull().isEqualTo(models);
  }
@ Test public void shoulConvertFromToArrayBeEquals ( ) { final List < DummyModel > models = new ArrayList < > ( ) ; for ( var i = 0 ; i < 10 ; i ++ ) { final var model = new DummyModelTest ( ) . createModelExample ( i ) ; models . add ( model ) ; } final var array = Model . toJsonArray ( models ) ; assertThat ( array ) . isNotNull ( ) ; final var result = Model . fromJsonArray ( array , DummyModel . class ) ; assertThat ( result ) . isNotNull ( ) . isEqualTo ( models ) ; }
Check that convert a list to models to array and vice verse.
Check that convert a list to models to array and vice verse .