Skip to content

Commit 483eaf3

Browse files
committed
make RNG static and not new Random()...
Signed-off-by: see-quick <[email protected]>
1 parent 505fb90 commit 483eaf3

File tree

2 files changed

+4
-11
lines changed

2 files changed

+4
-11
lines changed

src/test/java/io/strimzi/kafka/bridge/http/SeekIT.java

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -434,15 +434,6 @@ void seekToBeginningMultipleTopicsWithNotSubscribedTopic(VertxTestContext contex
434434
.createConsumer(context, groupId, jsonConsumer)
435435
.subscribeConsumer(context, groupId, name, topics);
436436

437-
CompletableFuture<Boolean> consume = new CompletableFuture<>();
438-
439-
// poll to subscribe
440-
consumerService()
441-
.consumeRecordsRequest(groupId, name, BridgeContentType.KAFKA_JSON_JSON)
442-
.as(BodyCodec.jsonObject())
443-
.send()
444-
.onComplete(ar -> consume.complete(true));
445-
446437
waitUntilPartitionAssigned(consumerService(), groupId, name, 5, 200);
447438

448439
// seek

src/test/java/io/strimzi/kafka/bridge/http/base/HttpBridgeITAbstract.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,8 @@ public abstract class HttpBridgeITAbstract implements TestSeparator {
102102
protected static HttpBridge httpBridge;
103103
protected static BridgeConfig bridgeConfig;
104104

105+
private final static Random RNG = new Random();
106+
105107
@BeforeAll
106108
void beforeAll(VertxTestContext context) {
107109
LOGGER.info("Environment variable EXTERNAL_BRIDGE:" + BRIDGE_EXTERNAL_ENV);
@@ -130,7 +132,7 @@ static void afterAll(VertxTestContext context) {
130132

131133
@BeforeEach
132134
void setUpEach() {
133-
topic = "my-topic-" + new Random().nextInt(Integer.MAX_VALUE);
135+
topic = "my-topic-" + RNG.nextInt(Integer.MAX_VALUE);
134136
}
135137

136138
@AfterEach
@@ -157,7 +159,7 @@ void cleanUp() throws InterruptedException, ExecutionException {
157159
}
158160

159161
protected String generateRandomConsumerGroupName() {
160-
int salt = new Random().nextInt(Integer.MAX_VALUE);
162+
int salt = RNG.nextInt(Integer.MAX_VALUE);
161163
return "my-group-" + salt;
162164
}
163165

0 commit comments

Comments
 (0)