use of com.hedera.hashgraph.sdk.TopicInfoQuery in project hedera-sdk-java by hashgraph.
the class TopicUpdateIntegrationTest method canUpdateTopic.
@Test
@DisplayName("Can update topic")
void canUpdateTopic() throws Exception {
var testEnv = new IntegrationTestEnv(1);
var response = new TopicCreateTransaction().setAdminKey(testEnv.operatorKey).setAutoRenewAccountId(testEnv.operatorId).setTopicMemo("[e2e::TopicCreateTransaction]").execute(testEnv.client);
var topicId = Objects.requireNonNull(response.getReceipt(testEnv.client).topicId);
new TopicUpdateTransaction().clearAutoRenewAccountId().setTopicMemo("hello").setTopicId(topicId).execute(testEnv.client).getReceipt(testEnv.client);
var topicInfo = new TopicInfoQuery().setTopicId(topicId).execute(testEnv.client);
assertThat(topicInfo.topicMemo).isEqualTo("hello");
assertThat(topicInfo.autoRenewAccountId).isNull();
new TopicDeleteTransaction().setTopicId(topicId).execute(testEnv.client).getReceipt(testEnv.client);
testEnv.close();
}
Aggregations