public CompletableFuture<Void> subscriptionCreated(
      byte[] user, String subscriptionId, Instant subscriptionCreatedAt, long level) {
    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_created_at = :subscription_created_at, "
            + "#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_created_at", KEY_SUBSCRIPTION_CREATED_AT,
            "#subscription_level", KEY_SUBSCRIPTION_LEVEL,
            "#subscription_level_changed_at", KEY_SUBSCRIPTION_LEVEL_CHANGED_AT))
        .expressionAttributeValues(Map.of(
            ":accessed_at", n(subscriptionCreatedAt.getEpochSecond()),
            ":subscription_id", s(subscriptionId),
            ":subscription_created_at", n(subscriptionCreatedAt.getEpochSecond()),
            ":subscription_level", n(level),
            ":subscription_level_changed_at", n(subscriptionCreatedAt.getEpochSecond())))
        .build();
    return client.updateItem(request).thenApply(updateItemResponse -> null);
  }
@Test
  void testSubscriptionCreated() {
    String subscriptionId = Base64.getEncoder().encodeToString(TestRandomUtil.nextBytes(16));
    Instant subscriptionCreated = Instant.ofEpochSecond(NOW_EPOCH_SECONDS + 1);
    long level = 42;
    assertThat(subscriptions.create(user, password, created)).succeedsWithin(DEFAULT_TIMEOUT);
    assertThat(subscriptions.subscriptionCreated(user, subscriptionId, subscriptionCreated, level)).
        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(subscriptionCreated);
        assertThat(record.subscriptionId).isEqualTo(subscriptionId);
        assertThat(record.subscriptionCreatedAt).isEqualTo(subscriptionCreated);
        assertThat(record.subscriptionLevel).isEqualTo(level);
        assertThat(record.subscriptionLevelChangedAt).isEqualTo(subscriptionCreated);
      });
    });
  }