@@ -53,8 +53,9 @@ public class YdbTopicsIntegrationTest {
53
53
@ ClassRule
54
54
public final static GrpcTransportRule ydbTransport = new GrpcTransportRule ();
55
55
56
- private final static String TEST_TOPIC1 = "integration_test_topic" ;
57
- private final static String TEST_TOPIC2 = "integration_test_other_topic" ;
56
+ private final static String TEST_TOPIC = "integration_test_topic" ;
57
+ private final static String TEST_OTHER_TOPIC = "integration_test_other_topic" ;
58
+
58
59
private final static String TEST_CONSUMER1 = "consumer" ;
59
60
private final static String TEST_CONSUMER2 = "other_consumer" ;
60
61
@@ -70,10 +71,10 @@ public class YdbTopicsIntegrationTest {
70
71
71
72
@ BeforeClass
72
73
public static void initTopic () {
73
- logger .info ("Create test topic {} ..." , TEST_TOPIC1 );
74
+ logger .info ("Create test topic {} ..." , TEST_TOPIC );
74
75
75
76
client = TopicClient .newClient (ydbTransport ).build ();
76
- client .createTopic (TEST_TOPIC1 , CreateTopicSettings .newBuilder ()
77
+ client .createTopic (TEST_TOPIC , CreateTopicSettings .newBuilder ()
77
78
.addConsumer (Consumer .newBuilder ().setName (TEST_CONSUMER1 ).build ())
78
79
.addConsumer (Consumer .newBuilder ().setName (TEST_CONSUMER2 ).build ())
79
80
.build ()
@@ -82,16 +83,16 @@ public static void initTopic() {
82
83
83
84
@ AfterClass
84
85
public static void dropTopic () {
85
- logger .info ("Drop test topic {} ..." , TEST_TOPIC1 );
86
- Status dropStatus = client .dropTopic (TEST_TOPIC1 ).join ();
86
+ logger .info ("Drop test topic {} ..." , TEST_TOPIC );
87
+ Status dropStatus = client .dropTopic (TEST_TOPIC ).join ();
87
88
client .close ();
88
89
dropStatus .expectSuccess ("can't drop test topic" );
89
90
}
90
91
91
92
@ Test
92
93
public void step01_writeWithoutDeduplication () throws InterruptedException , ExecutionException , TimeoutException {
93
94
WriterSettings settings = WriterSettings .newBuilder ()
94
- .setTopicPath (TEST_TOPIC1 )
95
+ .setTopicPath (TEST_TOPIC )
95
96
.build ();
96
97
SyncWriter writer = client .createSyncWriter (settings );
97
98
writer .init ();
@@ -111,7 +112,7 @@ public void step01_writeWithoutDeduplication() throws InterruptedException, Exec
111
112
@ Test
112
113
public void step02_readHalfWithoutCommit () throws InterruptedException {
113
114
ReaderSettings settings = ReaderSettings .newBuilder ()
114
- .addTopic (TopicReadSettings .newBuilder ().setPath (TEST_TOPIC1 ).build ())
115
+ .addTopic (TopicReadSettings .newBuilder ().setPath (TEST_TOPIC ).build ())
115
116
.setConsumerName (TEST_CONSUMER1 )
116
117
.build ();
117
118
@@ -129,7 +130,7 @@ public void step02_readHalfWithoutCommit() throws InterruptedException {
129
130
@ Test
130
131
public void step03_readHalfWithCommit () throws InterruptedException {
131
132
ReaderSettings settings = ReaderSettings .newBuilder ()
132
- .addTopic (TopicReadSettings .newBuilder ().setPath (TEST_TOPIC1 ).build ())
133
+ .addTopic (TopicReadSettings .newBuilder ().setPath (TEST_TOPIC ).build ())
133
134
.setConsumerName (TEST_CONSUMER1 )
134
135
.build ();
135
136
@@ -148,7 +149,7 @@ public void step03_readHalfWithCommit() throws InterruptedException {
148
149
@ Test
149
150
public void step03_readNextHalfWithoutCommit () throws InterruptedException {
150
151
ReaderSettings settings = ReaderSettings .newBuilder ()
151
- .addTopic (TopicReadSettings .newBuilder ().setPath (TEST_TOPIC1 ).build ())
152
+ .addTopic (TopicReadSettings .newBuilder ().setPath (TEST_TOPIC ).build ())
152
153
.setConsumerName (TEST_CONSUMER1 )
153
154
.build ();
154
155
@@ -170,7 +171,7 @@ public void step03_readNextHalfWithoutCommit() throws InterruptedException {
170
171
@ Test
171
172
public void step04_readNextHalfWithCommit () throws InterruptedException {
172
173
ReaderSettings settings = ReaderSettings .newBuilder ()
173
- .addTopic (TopicReadSettings .newBuilder ().setPath (TEST_TOPIC1 ).build ())
174
+ .addTopic (TopicReadSettings .newBuilder ().setPath (TEST_TOPIC ).build ())
174
175
.setConsumerName (TEST_CONSUMER1 )
175
176
.build ();
176
177
@@ -194,7 +195,7 @@ public void step04_readNextHalfWithCommit() throws InterruptedException {
194
195
195
196
@ Test
196
197
public void step05_describeTopic () {
197
- TopicDescription description = client .describeTopic (TEST_TOPIC1 ).join ().getValue ();
198
+ TopicDescription description = client .describeTopic (TEST_TOPIC ).join ().getValue ();
198
199
199
200
Assert .assertNull (description .getTopicStats ());
200
201
List <Consumer > consumers = description .getConsumers ();
@@ -207,7 +208,7 @@ public void step05_describeTopic() {
207
208
@ Test
208
209
public void step06_readAllByAsyncReader () throws InterruptedException {
209
210
ReaderSettings settings = ReaderSettings .newBuilder ()
210
- .addTopic (TopicReadSettings .newBuilder ().setPath (TEST_TOPIC1 ).build ())
211
+ .addTopic (TopicReadSettings .newBuilder ().setPath (TEST_TOPIC ).build ())
211
212
.setConsumerName (TEST_CONSUMER2 )
212
213
.build ();
213
214
@@ -246,7 +247,7 @@ public void onMessages(DataReceivedEvent dre) {
246
247
247
248
@ Test
248
249
public void step07_alterTopicWithAutoPartitioning () {
249
- client .alterTopic (TEST_TOPIC1 , AlterTopicSettings .newBuilder ()
250
+ client .alterTopic (TEST_TOPIC , AlterTopicSettings .newBuilder ()
250
251
.setAlterPartitioningSettings (AlterPartitioningSettings .newBuilder ()
251
252
.setAutoPartitioningStrategy (AutoPartitioningStrategy .SCALE_UP )
252
253
.setMaxActivePartitions (10 )
@@ -258,7 +259,7 @@ public void step07_alterTopicWithAutoPartitioning() {
258
259
.build ())
259
260
.build ()).join ().expectSuccess ("can't alter the topic" );
260
261
261
- TopicDescription description = client .describeTopic (TEST_TOPIC1 ).join ().getValue ();
262
+ TopicDescription description = client .describeTopic (TEST_TOPIC ).join ().getValue ();
262
263
263
264
PartitioningSettings actualPartitioningSettings = description .getPartitioningSettings ();
264
265
PartitioningSettings expectedPartitioningSettings = PartitioningSettings .newBuilder ()
@@ -288,13 +289,13 @@ public void step08_createTopicWithAutoPartitioning() {
288
289
.build ())
289
290
.build ();
290
291
291
- CompletableFuture <Status > secondaryTopicCreated = client .createTopic (TEST_TOPIC2 , CreateTopicSettings .newBuilder ()
292
+ CompletableFuture <Status > secondaryTopicCreated = client .createTopic (TEST_OTHER_TOPIC , CreateTopicSettings .newBuilder ()
292
293
.setPartitioningSettings (expectedPartitioningSettings )
293
294
.build ());
294
295
295
296
secondaryTopicCreated .join ().expectSuccess ("can't create the topic" );
296
297
297
- TopicDescription description = client .describeTopic (TEST_TOPIC2 ).join ().getValue ();
298
+ TopicDescription description = client .describeTopic (TEST_OTHER_TOPIC ).join ().getValue ();
298
299
299
300
Assert .assertEquals (expectedPartitioningSettings , description .getPartitioningSettings ());
300
301
}
0 commit comments