components/src/test/java/eu/internetofus/common/components/profile_manager/WeNetProfileManagerITCase.java
/**
   * Should retrieve communities that has specific keywords.
   *
   * @param vertx       that contains the event bus to use.
   * @param testContext context over the tests.
   */
Should retrieve communities that has specific keywords.
@param vertx       that contains the event bus to use.
@param testContext context over the tests.
Should retrieve communities that has specific keywords . @param vertx that contains the event bus to use . @param testContext context over the tests .
@Test
  public void shouldRetrieveCommunityProfilesPageByKeywords(final Vertx vertx, final VertxTestContext testContext) {
    StoreServices.storeCommunityExample(1, vertx, testContext).onSuccess(community -> {
      final var newCommunity = Model.fromJsonObject(community.toJsonObject(), CommunityProfile.class);
      newCommunity.id = null;
      final var keyword = UUID.randomUUID().toString();
      newCommunity.keywords.add(keyword);
      StoreServices.storeCommunity(newCommunity, vertx, testContext).onSuccess(community2 -> {
        StoreServices.storeCommunity(newCommunity, vertx, testContext).onSuccess(community3 -> {
          StoreServices.storeCommunity(newCommunity, vertx, testContext).onSuccess(community4 -> {
            testContext.assertComplete(WeNetProfileManager.createProxy(vertx).retrieveCommunityProfilesPage(null, null, null, keyword, null, null, 1, 2).onSuccess(page -> testContext.verify(() -> {
              assertThat(page).isNotNull();
              assertThat(page.offset).isEqualTo(1);
              assertThat(page.total).isEqualTo(3);
              assertThat(page.communities).isNotEmpty().hasSize(2).contains(community3, community4);
              testContext.completeNow();
            })));
          });
        });
      });
    });
  }
@ Test public void shouldRetrieveCommunityProfilesPageByKeywords ( final Vertx vertx , final VertxTestContext testContext ) { StoreServices . storeCommunityExample ( 1 , vertx , testContext ) . onSuccess ( community -> { final var newCommunity = Model . fromJsonObject ( community . toJsonObject ( ) , CommunityProfile . class ) ; newCommunity . id = null ; final var keyword = UUID . randomUUID ( ) . toString ( ) ; newCommunity . keywords . add ( keyword ) ; StoreServices . storeCommunity ( newCommunity , vertx , testContext ) . onSuccess ( community2 -> { StoreServices . storeCommunity ( newCommunity , vertx , testContext ) . onSuccess ( community3 -> { StoreServices . storeCommunity ( newCommunity , vertx , testContext ) . onSuccess ( community4 -> { testContext . assertComplete ( WeNetProfileManager . createProxy ( vertx ) . retrieveCommunityProfilesPage ( null , null , null , keyword , null , null , 1 , 2 ) . onSuccess ( page -> testContext . verify ( ( ) -> { assertThat ( page ) . isNotNull ( ) ; assertThat ( page . offset ) . isEqualTo ( 1 ) ; assertThat ( page . total ) . isEqualTo ( 3 ) ; assertThat ( page . communities ) . isNotEmpty ( ) . hasSize ( 2 ) . contains ( community3 , community4 ) ; testContext . completeNow ( ) ; } ) ) ) ; } ) ; } ) ; } ) ; } ) ; }
Should retrieve communities that has specific keywords.
Should retrieve communities that has specific keywords .