@@ -32,17 +32,16 @@ pub async fn basic_topic() -> Result<()> {
32
32
tracing:: subscriber:: set_default ( subscriber)
33
33
} ;
34
34
35
- let project = crate :: project_id ( ) ?;
36
35
let ( client, topic) = create_test_topic ( ) . await ?;
37
36
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 ( ) )
42
41
. send ( )
43
42
. 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) ;
46
45
47
46
cleanup_test_topic ( client, topic. name ) . await ?;
48
47
@@ -51,7 +50,7 @@ pub async fn basic_topic() -> Result<()> {
51
50
52
51
pub const TOPIC_ID_LENGTH : usize = 255 ;
53
52
54
- fn random_topic_id ( project : String ) -> String {
53
+ fn random_topic_name ( project : String ) -> String {
55
54
let prefix = "topic-" ;
56
55
let topic_id: String = rand:: rng ( )
57
56
. sample_iter ( & Alphanumeric )
@@ -67,7 +66,7 @@ pub async fn create_test_topic() -> Result<(TopicAdmin, Topic)> {
67
66
. with_tracing ( )
68
67
. build ( )
69
68
. await ?;
70
- let topic_id = random_topic_id ( project) ;
69
+ let topic_id = random_topic_name ( project) ;
71
70
72
71
tracing:: info!( "testing create_topic()" ) ;
73
72
let topic = client
0 commit comments