components/src/test/java/eu/internetofus/common/components/social_context_builder/WeNetSocialContextBuilderSimulatorTest.java
/**
   * Should manage the social notification profile update.
   *
   * @param vertx       that contains the event bus to use.
   * @param testContext context over the tests.
   */
Should manage the social notification profile update.
@param vertx       that contains the event bus to use.
@param testContext context over the tests.
Should manage the social notification profile update . @param vertx that contains the event bus to use . @param testContext context over the tests .
@Test
  public void shouldSetGetDeleteSocialNotificationProfileUpdate(final Vertx vertx, final VertxTestContext testContext) {
    final var userId = UUID.randomUUID().toString();
    final var notification = new ProfileUpdateNotification();
    notification.updatedFieldNames = new HashSet<String>();
    notification.updatedFieldNames.add("name");
    notification.updatedFieldNames.add("occupation");
    notification.updatedFieldNames.add("nationality");
    WeNetSocialContextBuilderSimulator.createProxy(vertx).socialNotificationProfileUpdate(userId, notification)
        .compose(
            any -> WeNetSocialContextBuilderSimulator.createProxy(vertx).getSocialNotificationProfileUpdate(userId))
        .onComplete(
            testContext.succeeding(getted -> testContext.verify(() -> {
              assertThat(getted).isNotNull().isEqualTo(notification);
              WeNetSocialContextBuilderSimulator.createProxy(vertx).deleteSocialNotificationProfileUpdate(userId)
                  .compose(any -> WeNetSocialContextBuilderSimulator.createProxy(vertx)
                      .getSocialNotificationProfileUpdate(userId))
                  .onComplete(
                      testContext.succeeding(empty -> testContext.verify(() -> {
                        assertThat(empty).isEqualTo(new ProfileUpdateNotification());
                        testContext.completeNow();
                      })));
            })));
  }
@ Test public void shouldSetGetDeleteSocialNotificationProfileUpdate ( final Vertx vertx , final VertxTestContext testContext ) { final var userId = UUID . randomUUID ( ) . toString ( ) ; final var notification = new ProfileUpdateNotification ( ) ; notification . updatedFieldNames = new HashSet < String > ( ) ; notification . updatedFieldNames . add ( "name" ) ; notification . updatedFieldNames . add ( "occupation" ) ; notification . updatedFieldNames . add ( "nationality" ) ; WeNetSocialContextBuilderSimulator . createProxy ( vertx ) . socialNotificationProfileUpdate ( userId , notification ) . compose ( any -> WeNetSocialContextBuilderSimulator . createProxy ( vertx ) . getSocialNotificationProfileUpdate ( userId ) ) . onComplete ( testContext . succeeding ( getted -> testContext . verify ( ( ) -> { assertThat ( getted ) . isNotNull ( ) . isEqualTo ( notification ) ; WeNetSocialContextBuilderSimulator . createProxy ( vertx ) . deleteSocialNotificationProfileUpdate ( userId ) . compose ( any -> WeNetSocialContextBuilderSimulator . createProxy ( vertx ) . getSocialNotificationProfileUpdate ( userId ) ) . onComplete ( testContext . succeeding ( empty -> testContext . verify ( ( ) -> { assertThat ( empty ) . isEqualTo ( new ProfileUpdateNotification ( ) ) ; testContext . completeNow ( ) ; } ) ) ) ; } ) ) ) ; }
Should manage the social notification profile update.
Should manage the social notification profile update .