Skip to content

Commit de16561

Browse files
committed
default test case
1 parent e33ccad commit de16561

File tree

2 files changed

+19
-3
lines changed

2 files changed

+19
-3
lines changed

server/src/test/integration/org/apache/cassandra/sidecar/routes/cassandra/GetPreemptiveOpenIntervalHandlerIntegrationTest.java

+18-2
Original file line numberDiff line numberDiff line change
@@ -41,22 +41,38 @@ public class GetPreemptiveOpenIntervalHandlerIntegrationTest extends Integration
4141
{
4242
private static final String testRoute = "/api/v1/cassandra/sstable/preemptive-open-interval";
4343

44+
@CassandraIntegrationTest
45+
void testDefaultValue(CassandraTestContext context, VertxTestContext testContext)
46+
{
47+
client.get(server.actualPort(), "127.0.0.1", testRoute)
48+
.expect(ResponsePredicate.SC_OK)
49+
.send(testContext.succeeding(response -> verifyResponse(context, testContext, response, 50)));
50+
}
51+
4452
@CassandraIntegrationTest(yamlProps = "sstable_preemptive_open_interval_in_mb=60")
45-
void testRetrieveConfigValue60(CassandraTestContext context, VertxTestContext testContext)
53+
void testPreemptiveOpenInterval60(CassandraTestContext context, VertxTestContext testContext)
4654
{
4755
client.get(server.actualPort(), "127.0.0.1", testRoute)
4856
.expect(ResponsePredicate.SC_OK)
4957
.send(testContext.succeeding(response -> verifyResponse(context, testContext, response, 60)));
5058
}
5159

5260
@CassandraIntegrationTest(yamlProps = "sstable_preemptive_open_interval_in_mb=70")
53-
void testRetrieveConfigValue70(CassandraTestContext context, VertxTestContext testContext)
61+
void testPreemptiveOpenInterval70(CassandraTestContext context, VertxTestContext testContext)
5462
{
5563
client.get(server.actualPort(), "127.0.0.1", testRoute)
5664
.expect(ResponsePredicate.SC_OK)
5765
.send(testContext.succeeding(response -> verifyResponse(context, testContext, response, 70)));
5866
}
5967

68+
@CassandraIntegrationTest(yamlProps = "sstable_preemptive_open_interval_in_mb=-1")
69+
void testPreemptiveOpenIntervalNegative(CassandraTestContext context, VertxTestContext testContext)
70+
{
71+
client.get(server.actualPort(), "127.0.0.1", testRoute)
72+
.expect(ResponsePredicate.SC_OK)
73+
.send(testContext.succeeding(response -> verifyResponse(context, testContext, response, -1)));
74+
}
75+
6076
void verifyResponse(CassandraTestContext context, VertxTestContext testContext, HttpResponse<Buffer> response, int expectedValue)
6177
{
6278
testContext.verify(() -> {

server/src/test/integration/org/apache/cassandra/testing/CassandraTestTemplate.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ private Map<String, String> customYamlProps(CassandraIntegrationTest annotation)
258258
while (tokenizer.hasMoreTokens())
259259
{
260260
String[] entry = tokenizer.nextToken().split("=");
261-
parsedYamlProps.put(entry[0], entry[1]);
261+
parsedYamlProps.put(entry[0].trim(), entry[1].trim());
262262
}
263263

264264
return parsedYamlProps;

0 commit comments

Comments
 (0)