Skip to content

Commit

Permalink
stop using "test" prefix in test method names
Browse files Browse the repository at this point in the history
  • Loading branch information
andrus committed Nov 23, 2023
1 parent d57b755 commit 437cd84
Show file tree
Hide file tree
Showing 103 changed files with 296 additions and 296 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
public class JerseyBeanValidationModuleProviderTest {

@Test
public void testAutoLoadable() {
public void autoLoadable() {
BQModuleProviderChecker.testAutoLoadable(JerseyBeanValidationModuleProvider.class);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ private static Consumer<String> assertTrimmed(String expected) {
}

@Test
public void testParamValidation_NotNull() {
public void paramValidation_NotNull() {
Response ok = jetty.getTarget().path("notNull").queryParam("q", "A").request(MediaType.TEXT_PLAIN).get();
JettyTester.assertOk(ok).assertContent("_A_");

Expand All @@ -74,7 +74,7 @@ public void testParamValidation_NotNull() {
}

@Test
public void testParamValidation_Range() {
public void paramValidation_Range() {
Response ok = jetty.getTarget().path("range").queryParam("q", "3").request(MediaType.TEXT_PLAIN).get();
JettyTester.assertOk(ok).assertContent("_3_");

Expand All @@ -87,7 +87,7 @@ public void testParamValidation_Range() {
}

@Test
public void testParamValidation_ListSize() {
public void paramValidation_ListSize() {
Response ok = jetty.getTarget().path("size")
.queryParam("q", "3")
.queryParam("q", "1")
Expand All @@ -107,7 +107,7 @@ public void testParamValidation_ListSize() {
}

@Test
public void testParamValidation_Valid() {
public void paramValidation_Valid() {
Response ok = jetty.getTarget().path("valid").queryParam("q", "a1").request(MediaType.TEXT_PLAIN).get();
JettyTester.assertOk(ok).assertContent("_{a1}_");

Expand All @@ -120,7 +120,7 @@ public void testParamValidation_Valid() {
}

@Test
public void testParamValidation_Custom() {
public void paramValidation_Custom() {
Response ok = jetty.getTarget().path("custom").queryParam("q", "a1").request(MediaType.TEXT_PLAIN).get();
JettyTester.assertOk(ok).assertContent("_a1_");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ private static Consumer<String> assertTrimmed(String expected) {
}

@Test
public void testParamValidation_NotNull() {
public void paramValidation_NotNull() {
Response ok = jetty.getTarget().path("notNull").queryParam("q", "A").request(MediaType.TEXT_PLAIN).get();
JettyTester.assertOk(ok).assertContent("_A_");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public void resetClient() {
}

@Test
public void testMetrics() {
public void metrics() {
// fault filter to init metrics
client.getInstance(RequestTimer.class);
MetricRegistry metricRegistry = client.getInstance(MetricRegistry.class);
Expand All @@ -92,7 +92,7 @@ public void testMetrics() {
}

@Test
public void testTimerInvoked() {
public void timerInvoked() {

HttpClientFactory factory = client.getInstance(HttpClientFactory.class);
MetricRegistry metrics = client.getInstance(MetricRegistry.class);
Expand All @@ -110,7 +110,7 @@ public void testTimerInvoked() {
}

@Test
public void testTimer_ConnectionError() {
public void timer_ConnectionError() {

Client jaxrsClient = client.getInstance(HttpClientFactory.class).newClient();
MetricRegistry metrics = client.getInstance(MetricRegistry.class);
Expand All @@ -131,7 +131,7 @@ public void testTimer_ConnectionError() {
}

@Test
public void testTimer_ServerErrors() {
public void timer_ServerErrors() {

Client jaxrsClient = client.getInstance(HttpClientFactory.class).newClient();
MetricRegistry metrics = client.getInstance(MetricRegistry.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ void clearMDC() {
}

@Test
public void testNoMDCRx() {
public void noMDCRx() {

HttpClientFactory factory = clientApp.getInstance(HttpClientFactory.class);

Expand All @@ -94,7 +94,7 @@ public void testNoMDCRx() {
}

@Test
public void testMDCRx() {
public void mDCRx() {

HttpClientFactory factory = clientApp.getInstance(HttpClientFactory.class);

Expand All @@ -115,7 +115,7 @@ public void testMDCRx() {
}

@Test
public void testMDCRxNestedAsync() {
public void mDCRxNestedAsync() {

HttpClientFactory factory = clientApp.getInstance(HttpClientFactory.class);

Expand All @@ -135,7 +135,7 @@ public void testMDCRxNestedAsync() {
}

@Test
public void testMDCRxNestedSync() {
public void mDCRxNestedSync() {

HttpClientFactory factory = clientApp.getInstance(HttpClientFactory.class);

Expand All @@ -155,7 +155,7 @@ public void testMDCRxNestedSync() {
}

@Test
public void testMDCRxParallel() throws ExecutionException, InterruptedException, TimeoutException {
public void mDCRxParallel() throws ExecutionException, InterruptedException, TimeoutException {

HttpClientFactory factory = clientApp.getInstance(HttpClientFactory.class);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ private HealthCheckOutcome tickAndRunCheck(BQRuntime client, String checkName) t
}

@Test
public void testRequestsPerMin() throws InterruptedException {
public void requestsPerMin() throws InterruptedException {

BQRuntime client = createClient();
WebTarget target = createTarget(client);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public class InstrumentedHttpClientFactoryFactoryTest {
private final Injector mockInjector = mock(Injector.class);

@Test
public void testCreateClientFactory_AsyncThreadPool() {
public void createClientFactory_AsyncThreadPool() {

Client client = new InstrumentedHttpClientFactoryFactory().createClientFactory(mockInjector, Set.of()).newClient();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ public class JerseyClientInstrumentedModuleProviderTest {
final BQTestFactory testFactory = new BQTestFactory();

@Test
public void testAutoLoadable() {
public void autoLoadable() {
BQModuleProviderChecker.testAutoLoadable(JerseyClientInstrumentedModuleProvider.class);
}

@Test
public void testModuleDeclaresDependencies() {
public void moduleDeclaresDependencies() {
final BQRuntime bqRuntime = testFactory.app().moduleProvider(new JerseyClientInstrumentedModuleProvider()).createRuntime();
BQRuntimeChecker.testModulesLoaded(bqRuntime,
JerseyClientModule.class,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ private WebTarget target(String path) {
}

@Test
public void testSafeCheck_NoConnection() {
public void safeCheck_NoConnection() {
// access a port that is not in use
int openPort = PortFinder.findAvailablePort("127.0.0.1");
WebTarget target = ClientBuilder.newClient().target("http://127.0.0.1:" + openPort);
Expand All @@ -75,15 +75,15 @@ public void testSafeCheck_NoConnection() {
}

@Test
public void testSafeCheck_ViaGet_TempRedirect() {
public void safeCheck_ViaGet_TempRedirect() {
WebTarget target = target("moved");
HealthCheckOutcome outcome = HttpHealthCheck.viaGET(target).safeCheck();
assertEquals(HealthCheckStatus.OK, outcome.getStatus(), outcome.toString());
assertNull(outcome.getMessage(), outcome.toString());
}

@Test
public void testSafeCheck_ViaGet_TempRedirect_Overwritten() {
public void safeCheck_ViaGet_TempRedirect_Overwritten() {

// testing that while the initial target is setup to not follow redirects, health check still does.

Expand All @@ -96,30 +96,30 @@ public void testSafeCheck_ViaGet_TempRedirect_Overwritten() {
}

@Test
public void testSafeCheck_ViaHead_NotFound() {
public void safeCheck_ViaHead_NotFound() {
WebTarget target = target("no_such_thing");
HealthCheckOutcome outcome = HttpHealthCheck.viaHEAD(target).safeCheck();
assertEquals(HealthCheckStatus.WARNING, outcome.getStatus());
assertEquals("Health check is possibly misconfigured. Response status: 404", outcome.getMessage());
}

@Test
public void testSafeCheck_ViaGet_ServerError() {
public void safeCheck_ViaGet_ServerError() {
WebTarget target = target("get500");
HealthCheckOutcome outcome = HttpHealthCheck.viaHEAD(target).safeCheck();
assertEquals(HealthCheckStatus.CRITICAL, outcome.getStatus());
assertEquals("Remote API response status: 500", outcome.getMessage());
}

@Test
public void testSafeCheck_ViaGet() {
public void safeCheck_ViaGet() {
WebTarget target = target("get");
HealthCheckOutcome outcome = HttpHealthCheck.viaGET(target).safeCheck();
assertEquals(HealthCheckStatus.OK, outcome.getStatus(), outcome.toString());
}

@Test
public void testSafeCheck_ViaHead() {
public void safeCheck_ViaHead() {
// note that we don't need an explicit OPTIONS endpoint ...
// Jersey server must provide an implicit behavior for a valid resource

Expand All @@ -129,7 +129,7 @@ public void testSafeCheck_ViaHead() {
}

@Test
public void testSafeCheck_ViaOptions() {
public void safeCheck_ViaOptions() {
// note that we don't need an explicit HEAD endpoint ...
// Jersey server must provide an implicit behavior for a valid resource
WebTarget target = target("get");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public void before() {
}

@Test
public void testRange_1() {
public void range_1() {
Timer timer = registry.timer(RequestTimer.TIMER_NAME);

Mockito.when(timer.getOneMinuteRate()).thenReturn(0.009);
Expand All @@ -49,7 +49,7 @@ public void testRange_1() {


@Test
public void testRange_2() {
public void range_2() {
Timer timer = registry.timer(RequestTimer.TIMER_NAME);

Mockito.when(timer.getOneMinuteRate()).thenReturn(0.03);
Expand All @@ -59,7 +59,7 @@ public void testRange_2() {
}

@Test
public void testRange_3() {
public void range_3() {
Timer timer = registry.timer(RequestTimer.TIMER_NAME);

Mockito.when(timer.getOneMinuteRate()).thenReturn(0.06);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public class DefaultHttpClientFactoryTest {
private ClientRequestFilter mockAuth2 = mock(ClientRequestFilter.class);

@Test
public void testNewClient() {
public void newClient() {

config.property("x", "y");

Expand All @@ -50,7 +50,7 @@ public void testNewClient() {
}

@Test
public void testNewClient_NewInstanceEveryTime() {
public void newClient_NewInstanceEveryTime() {

DefaultHttpClientFactory factory = new DefaultHttpClientFactory(
config,
Expand All @@ -63,7 +63,7 @@ public void testNewClient_NewInstanceEveryTime() {
}

@Test
public void testNewClientBuilder_Auth() {
public void newClientBuilder_Auth() {

config.property("a", "b");

Expand All @@ -81,7 +81,7 @@ public void testNewClientBuilder_Auth() {
}

@Test
public void testNewClient_Auth_BadAuth() {
public void newClient_Auth_BadAuth() {

config.property("a", "b");

Expand Down
Loading

0 comments on commit 437cd84

Please sign in to comment.