components/src/test/java/eu/internetofus/common/components/service/AppTest.java
/**
   * Check that should create a community for an application without members.
   *
   * @param vertx       event bus to use.
   * @param testContext test context to use.
   *
   * @see App#getOrCreateDefaultCommunityFor(String, Vertx)
   */
Check that should create a community for an application without members.
@param vertx       event bus to use.
@param testContext test context to use.


Check that should create a community for an application without members . @param vertx event bus to use . @param testContext test context to use .
@Test
  public void shouldCreateCommunityWithoutMembers(final Vertx vertx, final VertxTestContext testContext) {
    testContext.assertComplete(StoreServices.storeApp(new App(), vertx, testContext))
        .onSuccess(app -> testContext.assertComplete(App.getOrCreateDefaultCommunityFor(app.appId, vertx))
            .onSuccess(createdCommunity -> testContext.verify(() -> {
              assertThat(createdCommunity.members).isNull();
              assertThat(createdCommunity.name).contains(app.appId);
              assertThat(createdCommunity.appId).isEqualTo(app.appId);
              testContext.assertComplete(App.getOrCreateDefaultCommunityFor(app.appId, vertx))
                  .onSuccess(getCommunity -> testContext.verify(() -> {
                    assertThat(createdCommunity).isEqualTo(getCommunity);
                    testContext.completeNow();
                  }));
            })));
  }
@ Test public void shouldCreateCommunityWithoutMembers ( final Vertx vertx , final VertxTestContext testContext ) { testContext . assertComplete ( StoreServices . storeApp ( new App ( ) , vertx , testContext ) ) . onSuccess ( app -> testContext . assertComplete ( App . getOrCreateDefaultCommunityFor ( app . appId , vertx ) ) . onSuccess ( createdCommunity -> testContext . verify ( ( ) -> { assertThat ( createdCommunity . members ) . isNull ( ) ; assertThat ( createdCommunity . name ) . contains ( app . appId ) ; assertThat ( createdCommunity . appId ) . isEqualTo ( app . appId ) ; testContext . assertComplete ( App . getOrCreateDefaultCommunityFor ( app . appId , vertx ) ) . onSuccess ( getCommunity -> testContext . verify ( ( ) -> { assertThat ( createdCommunity ) . isEqualTo ( getCommunity ) ; testContext . completeNow ( ) ; } ) ) ; } ) ) ) ; }
Check that should create a community for an application without members.
Check that should create a community for an application without members .