Skip to content

Commit

Permalink
chore: refactor method scope and order in ITQueryWrite.java
Browse files Browse the repository at this point in the history
  • Loading branch information
karel-rehor committed Dec 9, 2024
1 parent 29527f1 commit 979ca46
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions src/test/java/com/influxdb/v3/client/ITQueryWrite.java
Original file line number Diff line number Diff line change
Expand Up @@ -230,21 +230,6 @@ void pointValues() {
Motivated by EAR 5718, useful exception INVALID_ARGUMENT was being masked by
INTERNAL: http2 exception - Header size exceeded max allowed size (10240).
*/
public String makeLengthyTag(final int length, final int maxPartLength, final byte separator) {
final String legalVals = "0123456789abcdefghijklmnopqrstuvwxyz";
byte[] bytes = new byte[length];
int nextPartAddress = 0;
for (int i = 0; i < length; i++) {
if (i == nextPartAddress) {
bytes[i] = separator;
nextPartAddress = i + (int) (Math.random() * (maxPartLength - 3));
} else {
bytes[i] = legalVals.getBytes()[(int) (Math.random() * legalVals.length())];
}
}
return new String(bytes);
}

@EnabledIfEnvironmentVariable(named = "TESTING_INFLUXDB_URL", matches = ".*")
@EnabledIfEnvironmentVariable(named = "TESTING_INFLUXDB_TOKEN", matches = ".*")
@EnabledIfEnvironmentVariable(named = "TESTING_INFLUXDB_DATABASE", matches = ".*")
Expand Down Expand Up @@ -318,4 +303,19 @@ private static InfluxDBClient getInstance() {
System.getenv("TESTING_INFLUXDB_TOKEN").toCharArray(),
System.getenv("TESTING_INFLUXDB_DATABASE"));
}

private String makeLengthyTag(final int length, final int maxPartLength, final byte separator) {
final String legalVals = "0123456789abcdefghijklmnopqrstuvwxyz";
byte[] bytes = new byte[length];
int nextPartAddress = 0;
for (int i = 0; i < length; i++) {
if (i == nextPartAddress) {
bytes[i] = separator;
nextPartAddress = i + (int) (Math.random() * (maxPartLength - 3));
} else {
bytes[i] = legalVals.getBytes()[(int) (Math.random() * legalVals.length())];
}
}
return new String(bytes);
}
}

0 comments on commit 979ca46

Please sign in to comment.