public CompletableFuture<Void> subscriptionLevelChanged(
      byte[] user, Instant subscriptionLevelChangedAt, long level, String subscriptionId) {
    checkUserLength(user);

    UpdateItemRequest request = UpdateItemRequest.builder()
        .tableName(table)
        .key(Map.of(KEY_USER, b(user)))
        .returnValues(ReturnValue.NONE)
        .updateExpression("SET "
            + "#accessed_at = :accessed_at, "
            + "#subscription_id = :subscription_id, "
            + "#subscription_level = :subscription_level, "
            + "#subscription_level_changed_at = :subscription_level_changed_at")
        .expressionAttributeNames(Map.of(
            "#accessed_at", KEY_ACCESSED_AT,
            "#subscription_id", KEY_SUBSCRIPTION_ID,
            "#subscription_level", KEY_SUBSCRIPTION_LEVEL,
            "#subscription_level_changed_at", KEY_SUBSCRIPTION_LEVEL_CHANGED_AT))
        .expressionAttributeValues(Map.of(
            ":accessed_at", n(subscriptionLevelChangedAt.getEpochSecond()),
            ":subscription_id", s(subscriptionId),
            ":subscription_level", n(level),
            ":subscription_level_changed_at", n(subscriptionLevelChangedAt.getEpochSecond())))
        .build();
    return client.updateItem(request).thenApply(updateItemResponse -> null);
  }
@Test
  void testSubscriptionLevelChanged() {
    Instant at = Instant.ofEpochSecond(NOW_EPOCH_SECONDS + 500);
    long level = 1776;
    String updatedSubscriptionId = "new";
    assertThat(subscriptions.create(user, password, created)).succeedsWithin(DEFAULT_TIMEOUT);
    assertThat(subscriptions.subscriptionCreated(user, "original", created, level - 1)).succeedsWithin(
        DEFAULT_TIMEOUT);
    assertThat(subscriptions.subscriptionLevelChanged(user, at, level, updatedSubscriptionId)).succeedsWithin(
        DEFAULT_TIMEOUT);
    assertThat(subscriptions.get(user, password)).succeedsWithin(DEFAULT_TIMEOUT).satisfies(getResult -> {
      assertThat(getResult).isNotNull();
      assertThat(getResult.type).isEqualTo(FOUND);
      assertThat(getResult.record).isNotNull().satisfies(record -> {
        assertThat(record.accessedAt).isEqualTo(at);
        assertThat(record.subscriptionLevelChangedAt).isEqualTo(at);
        assertThat(record.subscriptionLevel).isEqualTo(level);
        assertThat(record.subscriptionId).isEqualTo(updatedSubscriptionId);
      });
    });
  }