components/src/test/java/eu/internetofus/common/components/interaction_protocol_engine/WeNetInteractionProtocolEngineTestCase.java
/**
   * Should retrieve community user state.
   *
   * @param vertx       that contains the event bus to use.
   * @param testContext context over the tests.
   */
Should retrieve community user state.
@param vertx       that contains the event bus to use.
@param testContext context over the tests.
Should retrieve community user state . @param vertx that contains the event bus to use . @param testContext context over the tests .
@Test
  public void shouldRetrieveCommunityUserState(final Vertx vertx, final VertxTestContext testContext) {
    StoreServices.storeCommunityExample(1, vertx, testContext).onSuccess(community -> {
      final var userId = community.members.get(0).userId;
      testContext.assertComplete(this.createComponentProxy(vertx).retrieveCommunityUserState(community.id, userId))
          .onSuccess(done -> testContext.verify(() -> {
            final var state = new State();
            state.communityId = community.id;
            state.userId = userId;
            state._creationTs = done._creationTs;
            state._lastUpdateTs = done._lastUpdateTs;
            assertThat(done).isEqualTo(state);
            assertThat(done._creationTs).isEqualTo(done._lastUpdateTs);
            testContext.completeNow();
          }));
    });
  }
@ Test public void shouldRetrieveCommunityUserState ( final Vertx vertx , final VertxTestContext testContext ) { StoreServices . storeCommunityExample ( 1 , vertx , testContext ) . onSuccess ( community -> { final var userId = community . members . get ( 0 ) . userId ; testContext . assertComplete ( this . createComponentProxy ( vertx ) . retrieveCommunityUserState ( community . id , userId ) ) . onSuccess ( done -> testContext . verify ( ( ) -> { final var state = new State ( ) ; state . communityId = community . id ; state . userId = userId ; state . _creationTs = done . _creationTs ; state . _lastUpdateTs = done . _lastUpdateTs ; assertThat ( done ) . isEqualTo ( state ) ; assertThat ( done . _creationTs ) . isEqualTo ( done . _lastUpdateTs ) ; testContext . completeNow ( ) ; } ) ) ; } ) ; }
Should retrieve community user state.
Should retrieve community user state .