Skip to content

Commit 0527f2d

Browse files
committed
switch to get_topic
1 parent 8c1969e commit 0527f2d

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

src/integration-tests/src/pubsub.rs

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,17 +32,16 @@ pub async fn basic_topic() -> Result<()> {
3232
tracing::subscriber::set_default(subscriber)
3333
};
3434

35-
let project = crate::project_id()?;
3635
let (client, topic) = create_test_topic().await?;
3736

38-
tracing::info!("testing list_topics()");
39-
let topics = client
40-
.list_topics()
41-
.set_project(format!("projects/{project}"))
37+
tracing::info!("testing get_topic()");
38+
let get_topic = client
39+
.get_topic()
40+
.set_topic(topic.name.clone())
4241
.send()
4342
.await?;
44-
tracing::info!("success with list_topics={topics:?}");
45-
assert!(topics.topics.iter().any(|x| x.name == topic.name));
43+
tracing::info!("success with get_topic={get_topic:?}");
44+
assert_eq!(get_topic.name, topic.name);
4645

4746
cleanup_test_topic(client, topic.name).await?;
4847

@@ -51,7 +50,7 @@ pub async fn basic_topic() -> Result<()> {
5150

5251
pub const TOPIC_ID_LENGTH: usize = 255;
5352

54-
fn random_topic_id(project: String) -> String {
53+
fn random_topic_name(project: String) -> String {
5554
let prefix = "topic-";
5655
let topic_id: String = rand::rng()
5756
.sample_iter(&Alphanumeric)
@@ -67,7 +66,7 @@ pub async fn create_test_topic() -> Result<(TopicAdmin, Topic)> {
6766
.with_tracing()
6867
.build()
6968
.await?;
70-
let topic_id = random_topic_id(project);
69+
let topic_id = random_topic_name(project);
7170

7271
tracing::info!("testing create_topic()");
7372
let topic = client

0 commit comments

Comments
 (0)