components/src/test/java/eu/internetofus/common/components/social_context_builder/WeNetSocialContextBuilderSimulatorTest.java
/**
   * Should set and get the social explanation.
   *
   * @param vertx       that contains the event bus to use.
   * @param testContext context over the tests.
   */
Should set and get the social explanation.
@param vertx       that contains the event bus to use.
@param testContext context over the tests.
Should set and get the social explanation . @param vertx that contains the event bus to use . @param testContext context over the tests .
@Test
  public void shouldSetGetSocialExplanation(final Vertx vertx, final VertxTestContext testContext) {
    final var userId = UUID.randomUUID().toString();
    final var taskId = UUID.randomUUID().toString();
    testContext
        .assertComplete(WeNetSocialContextBuilderSimulator.createProxy(vertx).retrieveSocialExplanation(userId, taskId))
        .onSuccess(retrieveExplanation -> testContext.verify(() -> {
          assertThat(retrieveExplanation).isEqualTo(new SocialExplanation());
          final var explanation = new SocialExplanationTest().createModelExample(1);
          testContext.assertComplete(
              WeNetSocialContextBuilderSimulator.createProxy(vertx).setSocialExplanation(userId, taskId, explanation))
              .onSuccess(storedExplanation -> testContext.verify(() -> {
                assertThat(storedExplanation).isEqualTo(explanation);
                testContext
                    .assertComplete(
                        WeNetSocialContextBuilderSimulator.createProxy(vertx).retrieveSocialExplanation(userId, taskId))
                    .onSuccess(retrieveExplanation2 -> testContext.verify(() -> {
                      assertThat(retrieveExplanation2).isEqualTo(explanation);
                      testContext.completeNow();
                    }));
              }));
        }));
  }
@ Test public void shouldSetGetSocialExplanation ( final Vertx vertx , final VertxTestContext testContext ) { final var userId = UUID . randomUUID ( ) . toString ( ) ; final var taskId = UUID . randomUUID ( ) . toString ( ) ; testContext . assertComplete ( WeNetSocialContextBuilderSimulator . createProxy ( vertx ) . retrieveSocialExplanation ( userId , taskId ) ) . onSuccess ( retrieveExplanation -> testContext . verify ( ( ) -> { assertThat ( retrieveExplanation ) . isEqualTo ( new SocialExplanation ( ) ) ; final var explanation = new SocialExplanationTest ( ) . createModelExample ( 1 ) ; testContext . assertComplete ( WeNetSocialContextBuilderSimulator . createProxy ( vertx ) . setSocialExplanation ( userId , taskId , explanation ) ) . onSuccess ( storedExplanation -> testContext . verify ( ( ) -> { assertThat ( storedExplanation ) . isEqualTo ( explanation ) ; testContext . assertComplete ( WeNetSocialContextBuilderSimulator . createProxy ( vertx ) . retrieveSocialExplanation ( userId , taskId ) ) . onSuccess ( retrieveExplanation2 -> testContext . verify ( ( ) -> { assertThat ( retrieveExplanation2 ) . isEqualTo ( explanation ) ; testContext . completeNow ( ) ; } ) ) ; } ) ) ; } ) ) ; }
Should set and get the social explanation.
Should set and get the social explanation .