Skip to content

Commit c7b0ddd

Browse files
Use loadtest4j 0.18.0 (#44)
1 parent b06b7a8 commit c7b0ddd

17 files changed

+57
-56
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
<dependency>
4242
<groupId>org.loadtest4j</groupId>
4343
<artifactId>loadtest4j</artifactId>
44-
<version>0.17.0</version>
44+
<version>0.18.0</version>
4545
</dependency>
4646
<dependency>
4747
<groupId>com.fasterxml.jackson.core</groupId>
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
org.loadtest4j.drivers.wrk.WrkFactory

src/test/java/org/loadtest4j/drivers/wrk/WrkFactoryTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ private DriverFactory sut() {
2525
}
2626

2727
@Test
28-
public void testGetMandatoryProperties() {
28+
public void shouldHaveMandatoryProperties() {
2929
final DriverFactory sut = sut();
3030

3131
final Set<String> mandatoryProperties = sut.getMandatoryProperties();
@@ -34,14 +34,14 @@ public void testGetMandatoryProperties() {
3434
}
3535

3636
@Test(expected = UnsupportedOperationException.class)
37-
public void testGetMandatoryPropertiesIsImmutable() {
37+
public void shouldHaveImmutableMandatoryProperties() {
3838
final DriverFactory sut = sut();
3939

4040
sut.getMandatoryProperties().add("foobarbaz123");
4141
}
4242

4343
@Test
44-
public void testCreate() {
44+
public void shouldCreateDriver() {
4545
final DriverFactory sut = sut();
4646

4747
final Map<String, String> properties = new HashMap<>();

src/test/java/org/loadtest4j/drivers/wrk/WrkParserTest.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,36 +29,36 @@ private static DriverResult driverResult(String name) {
2929
}
3030

3131
@Test
32-
public void testValidReport() {
32+
public void shouldParseValidReport() {
3333
assertThat(driverResult("report.json"))
3434
.hasKo(0)
3535
.hasOk(1143)
3636
.hasResponseTimePercentile(73, Duration.ofMillis(1));
3737
}
3838

3939
@Test
40-
public void testReportWithStatusErrors() {
40+
public void shouldParseReportWithStatusErrors() {
4141
assertThat(driverResult("status_errors.json"))
4242
.hasKo(5)
4343
.hasOk(3);
4444
}
4545

4646
@Test
47-
public void testReportWithSocketErrors() {
47+
public void shouldParseReportWithSocketErrors() {
4848
assertThat(driverResult("socket_errors.json"))
4949
.hasKo(4)
5050
.hasOk(8);
5151
}
5252

5353
@Test
54-
public void testReportWithSocketAndStatusErrors() {
54+
public void shouldParseReportWithSocketAndStatusErrors() {
5555
assertThat(driverResult("socket_and_status_errors.json"))
5656
.hasKo(5)
5757
.hasOk(7);
5858
}
5959

6060
@Test(expected = RuntimeException.class)
61-
public void testInvalidReport() {
61+
public void shouldThrowExceptionForInvalidReport() {
6262
driverResult("invalid.json");
6363
}
6464
}

src/test/java/org/loadtest4j/drivers/wrk/WrkResponseTimeTest.java

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,35 +16,35 @@
1616
public class WrkResponseTimeTest {
1717

1818
@Test
19-
public void testGetPercentile() {
19+
public void shouldGetPercentile() {
2020
final DriverResponseTime responseTime = new WrkResponseTime(mapOf(bd("50"), 1000L));
2121

2222
assertThat(responseTime.getPercentile(50)).isEqualTo(Duration.ofMillis(1));
2323
}
2424

2525
@Test
26-
public void testGetDecimalPercentile() {
26+
public void shouldGetDecimalPercentile() {
2727
final WrkResponseTime responseTime = new WrkResponseTime(mapOf(bd("50.5"), 1000L));
2828

2929
assertThat(responseTime.getPercentile(50.5)).isEqualTo(Duration.ofMillis(1));
3030
}
3131

3232
@Test
33-
public void testGetDecimalPercentileAt3DecimalPlaces() {
33+
public void shouldGetDecimalPercentileAt3DecimalPlaces() {
3434
final WrkResponseTime responseTime = new WrkResponseTime(mapOf(bd("50.501"), 1000L));
3535

3636
assertThat(responseTime.getPercentile(50.501)).isEqualTo(Duration.ofMillis(1));
3737
}
3838

3939
@Test
40-
public void testGetDecimalPercentileWithTrailingZeroes() {
40+
public void shouldGetDecimalPercentileWithTrailingZeroes() {
4141
final WrkResponseTime responseTime = new WrkResponseTime(mapOf(bd("50.5"), 1000L, bd("50.501"), 3000L));
4242

4343
assertThat(responseTime.getPercentile(50.500)).isEqualTo(Duration.ofMillis(1));
4444
}
4545

4646
@Test
47-
public void testGetDecimalPercentileBeyond3DecimalPlacesFails() {
47+
public void shouldNotGetDecimalPercentileBeyond3DecimalPlaces() {
4848
final WrkResponseTime responseTime = new WrkResponseTime(mapOf(bd("50.000"), 1000L, bd("50.001"), 3000L));
4949

5050
assertThatIllegalArgumentException()
@@ -53,7 +53,7 @@ public void testGetDecimalPercentileBeyond3DecimalPlacesFails() {
5353
}
5454

5555
@Test
56-
public void testGetMissingDecimalPercentileFails() {
56+
public void shouldNotGetMissingDecimalPercentile() {
5757
final WrkResponseTime responseTime = new WrkResponseTime(mapOf(bd("50.4"), 1000L, bd("50.6"), 3000L));
5858

5959
assertThatIllegalArgumentException()
@@ -62,21 +62,21 @@ public void testGetMissingDecimalPercentileFails() {
6262
}
6363

6464
@Test
65-
public void testGetMaxPercentile() {
65+
public void shouldGetMaxPercentile() {
6666
final DriverResponseTime responseTime = new WrkResponseTime(mapOf(bd("100"), 1000L));
6767

6868
assertThat(responseTime.getPercentile(100)).isEqualTo(Duration.ofMillis(1));
6969
}
7070

7171
@Test
72-
public void testGetMinPercentile() {
72+
public void shouldGetMinPercentile() {
7373
final DriverResponseTime responseTime = new WrkResponseTime(mapOf(bd("0"), 1000L));
7474

7575
assertThat(responseTime.getPercentile(0)).isEqualTo(Duration.ofMillis(1));
7676
}
7777

7878
@Test
79-
public void testGetTooLowPercentileFails() {
79+
public void shouldNotGetTooLowPercentile() {
8080
final DriverResponseTime responseTime = new WrkResponseTime(mapOf(bd("-1"), 1000L));
8181

8282
assertThatIllegalArgumentException()
@@ -85,7 +85,7 @@ public void testGetTooLowPercentileFails() {
8585
}
8686

8787
@Test
88-
public void testGetTooHighPercentileFails() {
88+
public void shouldNotGetTooHighPercentile() {
8989
final DriverResponseTime responseTime = new WrkResponseTime(mapOf(bd("101"), 1000L));
9090

9191
assertThatIllegalArgumentException()
@@ -94,7 +94,7 @@ public void testGetTooHighPercentileFails() {
9494
}
9595

9696
@Test
97-
public void testGetMissingPercentileFails() {
97+
public void shouldNotGetMissingPercentile() {
9898
final DriverResponseTime responseTime = new WrkResponseTime(emptyMap());
9999

100100
assertThatIllegalArgumentException()

src/test/java/org/loadtest4j/drivers/wrk/WrkTest.java

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ private Driver sut() {
8585
}
8686

8787
@Test
88-
public void testRun() {
88+
public void shouldRun() {
8989
// Given
9090
final Driver driver = sut();
9191
// And
@@ -104,7 +104,7 @@ public void testRun() {
104104
}
105105

106106
@Test
107-
public void testRunWithMultipleRequests() {
107+
public void shouldRunWithMultipleRequests() {
108108
// Given
109109
final Driver driver = sut();
110110
// And
@@ -123,7 +123,7 @@ public void testRunWithMultipleRequests() {
123123
}
124124

125125
@Test
126-
public void testRunWithJsonPost() {
126+
public void shouldRunWithJsonPost() {
127127
// Given
128128
final Driver driver = sut();
129129
// And
@@ -144,7 +144,7 @@ public void testRunWithJsonPost() {
144144
}
145145

146146
@Test
147-
public void testRunWithPostBodyContainingEscapedDoubleQuotes() {
147+
public void shouldRunWithPostBodyContainingEscapedDoubleQuotes() {
148148
// Given
149149
final Driver driver = sut();
150150
// And
@@ -163,7 +163,7 @@ public void testRunWithPostBodyContainingEscapedDoubleQuotes() {
163163
}
164164

165165
@Test
166-
public void testRunWithEdgeCaseRequest() {
166+
public void shouldRunWithEdgeCaseRequest() {
167167
// Given
168168
final Driver driver = sut();
169169
// And
@@ -187,7 +187,7 @@ public void testRunWithEdgeCaseRequest() {
187187
}
188188

189189
@Test
190-
public void testRunWithErrors() {
190+
public void shouldRunAndReportKoRequests() {
191191
// Given
192192
final Driver driver = sut();
193193
// And
@@ -206,7 +206,7 @@ public void testRunWithErrors() {
206206
}
207207

208208
@Test
209-
public void testRunWithInvalidHost() {
209+
public void shouldNotRunWithInvalidHost() {
210210
// Given
211211
final Driver driver = new Wrk(1, EXPECTED_DURATION, "wrk", 1, "http://localhost:1");
212212

@@ -221,7 +221,7 @@ public void testRunWithInvalidHost() {
221221

222222

223223
@Test
224-
public void testRunWithNoRequests() {
224+
public void shouldNotRunWithNoRequests() {
225225
// Given
226226
final Driver driver = sut();
227227

@@ -234,7 +234,7 @@ public void testRunWithNoRequests() {
234234
}
235235

236236
@Test
237-
public void testRunWithMultiPartFileUpload() {
237+
public void shouldRunWithMultiPartFileUpload() {
238238
// Given
239239
final Driver driver = sut();
240240
// And
@@ -269,7 +269,7 @@ public void testRunWithMultiPartFileUpload() {
269269
}
270270

271271
@Test
272-
public void testRunWithMultiPartStringUpload() {
272+
public void shouldRunWithMultiPartStringUpload() {
273273
// Given
274274
final Driver driver = sut();
275275
// And

src/test/java/org/loadtest4j/drivers/wrk/script/BodyMatcherTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44

55
public abstract class BodyMatcherTest {
66
@Test
7-
public abstract void testString();
7+
public abstract void shouldMatchOnString();
88

99
@Test
10-
public abstract void testStringPart();
10+
public abstract void shouldMatchOnStringPart();
1111

1212
@Test
13-
public abstract void testFilePart();
13+
public abstract void shouldMatchOnFilePart();
1414
}

src/test/java/org/loadtest4j/drivers/wrk/script/WrkBodyMatcherTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
@Category(UnitTest.class)
1313
public class WrkBodyMatcherTest extends BodyMatcherTest {
1414
@Override
15-
public void testString() {
15+
public void shouldMatchOnString() {
1616
final WrkBodyMatcher matcher = new WrkBodyMatcher();
1717

1818
final String body = Body.string("foo").match(matcher);
@@ -21,7 +21,7 @@ public void testString() {
2121
}
2222

2323
@Override
24-
public void testStringPart() {
24+
public void shouldMatchOnStringPart() {
2525
final WrkBodyMatcher matcher = new WrkBodyMatcher();
2626

2727
final String body = Body.multipart(BodyPart.string("foo", "bar")).match(matcher);
@@ -38,7 +38,7 @@ public void testStringPart() {
3838
}
3939

4040
@Override
41-
public void testFilePart() {
41+
public void shouldMatchOnFilePart() {
4242
final WrkBodyMatcher matcher = new WrkBodyMatcher();
4343

4444
final String body = Body.multipart(BodyPart.file(Paths.get("src/test/resources/fixtures/multipart/test.txt"))).match(matcher);

src/test/java/org/loadtest4j/drivers/wrk/script/WrkHeadersMatcherTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
@Category(UnitTest.class)
1515
public class WrkHeadersMatcherTest extends BodyMatcherTest {
1616
@Override
17-
public void testString() {
17+
public void shouldMatchOnString() {
1818
final WrkHeadersMatcher matcher = new WrkHeadersMatcher(Collections.emptyMap());
1919

2020
final Map<String, String> headers = Body.string("foo").match(matcher);
@@ -23,7 +23,7 @@ public void testString() {
2323
}
2424

2525
@Override
26-
public void testStringPart() {
26+
public void shouldMatchOnStringPart() {
2727
final WrkHeadersMatcher matcher = new WrkHeadersMatcher(Collections.emptyMap());
2828

2929
final Map<String, String> headers = Body.multipart(BodyPart.string("foo", "bar")).match(matcher);
@@ -32,7 +32,7 @@ public void testStringPart() {
3232
}
3333

3434
@Override
35-
public void testFilePart() {
35+
public void shouldMatchOnFilePart() {
3636
final WrkHeadersMatcher matcher = new WrkHeadersMatcher(Collections.emptyMap());
3737

3838
final Map<String, String> headers = Body.multipart(BodyPart.file(Paths.get("/tmp/foo.txt"))).match(matcher);

src/test/java/org/loadtest4j/drivers/wrk/utils/ArgumentBuilderTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
@Category(UnitTest.class)
1212
public class ArgumentBuilderTest {
1313
@Test
14-
public void testAddArgument() {
14+
public void shouldAddArgument() {
1515
final ArgumentBuilder sut = new ArgumentBuilder();
1616

1717
final List<String> args = sut.addArgument("foo").build();
@@ -20,7 +20,7 @@ public void testAddArgument() {
2020
}
2121

2222
@Test
23-
public void testAddNamedArgument() {
23+
public void shouldAddNamedArgument() {
2424
final ArgumentBuilder sut = new ArgumentBuilder();
2525

2626
final List<String> args = sut.addNamedArgument("--foo", "bar").build();

0 commit comments

Comments
 (0)