Skip to content

Commit

Permalink
Refactored test environment factory methods (#1074)
Browse files Browse the repository at this point in the history
Signed-off-by: dhoard <[email protected]>
  • Loading branch information
dhoard authored Nov 30, 2024
1 parent df2b728 commit 46502fc
Show file tree
Hide file tree
Showing 44 changed files with 93 additions and 172 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@

import io.prometheus.jmx.test.support.ExporterPath;
import io.prometheus.jmx.test.support.ExporterTestEnvironment;
import io.prometheus.jmx.test.support.ExporterTestEnvironmentFactory;
import io.prometheus.jmx.test.support.JmxExporterMode;
import io.prometheus.jmx.test.support.MetricsType;
import io.prometheus.jmx.test.support.TestSupport;
Expand Down Expand Up @@ -52,7 +51,7 @@ public class AutoIncrementingMBeanTest {

@Verifyica.ArgumentSupplier(parallelism = Integer.MAX_VALUE)
public static Stream<ExporterTestEnvironment> arguments() {
return ExporterTestEnvironmentFactory.createExporterTestEnvironments();
return ExporterTestEnvironment.createExporterTestEnvironments();
}

@Verifyica.Prepare
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@

import io.prometheus.jmx.test.support.ExporterPath;
import io.prometheus.jmx.test.support.ExporterTestEnvironment;
import io.prometheus.jmx.test.support.ExporterTestEnvironmentFactory;
import io.prometheus.jmx.test.support.JmxExporterMode;
import io.prometheus.jmx.test.support.MetricsType;
import io.prometheus.jmx.test.support.TestSupport;
Expand Down Expand Up @@ -51,7 +50,7 @@ public class BasicTest {

@Verifyica.ArgumentSupplier(parallelism = Integer.MAX_VALUE)
public static Stream<ExporterTestEnvironment> arguments() {
return ExporterTestEnvironmentFactory.createExporterTestEnvironments();
return ExporterTestEnvironment.createExporterTestEnvironments();
}

@Verifyica.Prepare
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@

import io.prometheus.jmx.test.support.ExporterPath;
import io.prometheus.jmx.test.support.ExporterTestEnvironment;
import io.prometheus.jmx.test.support.ExporterTestEnvironmentFactory;
import io.prometheus.jmx.test.support.MetricsType;
import io.prometheus.jmx.test.support.TestSupport;
import io.prometheus.jmx.test.support.http.HttpClient;
Expand All @@ -46,7 +45,7 @@ public class BlacklistObjectNamesTest {

@Verifyica.ArgumentSupplier(parallelism = Integer.MAX_VALUE)
public static Stream<ExporterTestEnvironment> arguments() {
return ExporterTestEnvironmentFactory.createExporterTestEnvironments();
return ExporterTestEnvironment.createExporterTestEnvironments();
}

@Verifyica.Prepare
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@

import io.prometheus.jmx.test.support.ExporterPath;
import io.prometheus.jmx.test.support.ExporterTestEnvironment;
import io.prometheus.jmx.test.support.ExporterTestEnvironmentFactory;
import io.prometheus.jmx.test.support.MetricsType;
import io.prometheus.jmx.test.support.TestSupport;
import io.prometheus.jmx.test.support.http.HttpClient;
Expand All @@ -45,7 +44,7 @@ public class CompositeKeyDataTest {

@Verifyica.ArgumentSupplier(parallelism = Integer.MAX_VALUE)
public static Stream<ExporterTestEnvironment> arguments() {
return ExporterTestEnvironmentFactory.createExporterTestEnvironments();
return ExporterTestEnvironment.createExporterTestEnvironments();
}

@Verifyica.Prepare
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@

import io.prometheus.jmx.test.support.ExporterPath;
import io.prometheus.jmx.test.support.ExporterTestEnvironment;
import io.prometheus.jmx.test.support.ExporterTestEnvironmentFactory;
import io.prometheus.jmx.test.support.MetricsType;
import io.prometheus.jmx.test.support.TestSupport;
import io.prometheus.jmx.test.support.http.HttpClient;
Expand All @@ -47,7 +46,7 @@ public class DisableAutoExcludeObjectNameAttributesTest {

@Verifyica.ArgumentSupplier(parallelism = Integer.MAX_VALUE)
public static Stream<ExporterTestEnvironment> arguments() {
return ExporterTestEnvironmentFactory.createExporterTestEnvironments();
return ExporterTestEnvironment.createExporterTestEnvironments();
}

@Verifyica.Prepare
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@

import io.prometheus.jmx.test.support.ExporterPath;
import io.prometheus.jmx.test.support.ExporterTestEnvironment;
import io.prometheus.jmx.test.support.ExporterTestEnvironmentFactory;
import io.prometheus.jmx.test.support.MetricsType;
import io.prometheus.jmx.test.support.TestSupport;
import io.prometheus.jmx.test.support.http.HttpClient;
Expand All @@ -47,7 +46,7 @@ public class ExcludeObjectNameAttributesTest {

@Verifyica.ArgumentSupplier(parallelism = Integer.MAX_VALUE)
public static Stream<ExporterTestEnvironment> arguments() {
return ExporterTestEnvironmentFactory.createExporterTestEnvironments();
return ExporterTestEnvironment.createExporterTestEnvironments();
}

@Verifyica.Prepare
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@

import io.prometheus.jmx.test.support.ExporterPath;
import io.prometheus.jmx.test.support.ExporterTestEnvironment;
import io.prometheus.jmx.test.support.ExporterTestEnvironmentFactory;
import io.prometheus.jmx.test.support.MetricsType;
import io.prometheus.jmx.test.support.TestSupport;
import io.prometheus.jmx.test.support.http.HttpClient;
Expand All @@ -46,7 +45,7 @@ public class ExcludeObjectNamesTest {

@Verifyica.ArgumentSupplier(parallelism = Integer.MAX_VALUE)
public static Stream<ExporterTestEnvironment> arguments() {
return ExporterTestEnvironmentFactory.createExporterTestEnvironments();
return ExporterTestEnvironment.createExporterTestEnvironments();
}

@Verifyica.Prepare
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@

import io.prometheus.jmx.test.support.ExporterPath;
import io.prometheus.jmx.test.support.ExporterTestEnvironment;
import io.prometheus.jmx.test.support.ExporterTestEnvironmentFactory;
import io.prometheus.jmx.test.support.MetricsType;
import io.prometheus.jmx.test.support.TestSupport;
import io.prometheus.jmx.test.support.http.HttpClient;
Expand All @@ -46,7 +45,7 @@ public class IncludeAndExcludeObjectNamesTest {

@Verifyica.ArgumentSupplier(parallelism = Integer.MAX_VALUE)
public static Stream<ExporterTestEnvironment> arguments() {
return ExporterTestEnvironmentFactory.createExporterTestEnvironments();
return ExporterTestEnvironment.createExporterTestEnvironments();
}

@Verifyica.Prepare
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@

import io.prometheus.jmx.test.support.ExporterPath;
import io.prometheus.jmx.test.support.ExporterTestEnvironment;
import io.prometheus.jmx.test.support.ExporterTestEnvironmentFactory;
import io.prometheus.jmx.test.support.MetricsType;
import io.prometheus.jmx.test.support.TestSupport;
import io.prometheus.jmx.test.support.http.HttpClient;
Expand All @@ -49,7 +48,7 @@ public class IncludeObjectNameAttributesTest {

@Verifyica.ArgumentSupplier(parallelism = Integer.MAX_VALUE)
public static Stream<ExporterTestEnvironment> arguments() {
return ExporterTestEnvironmentFactory.createExporterTestEnvironments();
return ExporterTestEnvironment.createExporterTestEnvironments();
}

@Verifyica.Prepare
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@

import io.prometheus.jmx.test.support.ExporterPath;
import io.prometheus.jmx.test.support.ExporterTestEnvironment;
import io.prometheus.jmx.test.support.ExporterTestEnvironmentFactory;
import io.prometheus.jmx.test.support.MetricsType;
import io.prometheus.jmx.test.support.TestSupport;
import io.prometheus.jmx.test.support.http.HttpClient;
Expand All @@ -46,7 +45,7 @@ public class IncludeObjectNamesTest {

@Verifyica.ArgumentSupplier(parallelism = Integer.MAX_VALUE)
public static Stream<ExporterTestEnvironment> arguments() {
return ExporterTestEnvironmentFactory.createExporterTestEnvironments();
return ExporterTestEnvironment.createExporterTestEnvironments();
}

@Verifyica.Prepare
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@

import io.prometheus.jmx.test.support.ExporterPath;
import io.prometheus.jmx.test.support.ExporterTestEnvironment;
import io.prometheus.jmx.test.support.ExporterTestEnvironmentFactory;
import io.prometheus.jmx.test.support.MetricsType;
import io.prometheus.jmx.test.support.TestSupport;
import io.prometheus.jmx.test.support.http.HttpClient;
Expand All @@ -46,7 +45,7 @@ public class LowerCaseOutputAndLabelNamesTest {

@Verifyica.ArgumentSupplier(parallelism = Integer.MAX_VALUE)
public static Stream<ExporterTestEnvironment> arguments() {
return ExporterTestEnvironmentFactory.createExporterTestEnvironments();
return ExporterTestEnvironment.createExporterTestEnvironments();
}

@Verifyica.Prepare
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@

import io.prometheus.jmx.test.support.ExporterPath;
import io.prometheus.jmx.test.support.ExporterTestEnvironment;
import io.prometheus.jmx.test.support.ExporterTestEnvironmentFactory;
import io.prometheus.jmx.test.support.MetricsType;
import io.prometheus.jmx.test.support.TestSupport;
import io.prometheus.jmx.test.support.http.HttpClient;
Expand All @@ -46,7 +45,7 @@ public class LowerCaseOutputLabelNamesTest {

@Verifyica.ArgumentSupplier(parallelism = Integer.MAX_VALUE)
public static Stream<ExporterTestEnvironment> arguments() {
return ExporterTestEnvironmentFactory.createExporterTestEnvironments();
return ExporterTestEnvironment.createExporterTestEnvironments();
}

@Verifyica.Prepare
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@

import io.prometheus.jmx.test.support.ExporterPath;
import io.prometheus.jmx.test.support.ExporterTestEnvironment;
import io.prometheus.jmx.test.support.ExporterTestEnvironmentFactory;
import io.prometheus.jmx.test.support.MetricsType;
import io.prometheus.jmx.test.support.TestSupport;
import io.prometheus.jmx.test.support.http.HttpClient;
Expand All @@ -46,7 +45,7 @@ public class LowerCaseOutputNamesTest {

@Verifyica.ArgumentSupplier(parallelism = Integer.MAX_VALUE)
public static Stream<ExporterTestEnvironment> arguments() {
return ExporterTestEnvironmentFactory.createExporterTestEnvironments();
return ExporterTestEnvironment.createExporterTestEnvironments();
}

@Verifyica.Prepare
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@

import io.prometheus.jmx.test.support.ExporterPath;
import io.prometheus.jmx.test.support.ExporterTestEnvironment;
import io.prometheus.jmx.test.support.ExporterTestEnvironmentFactory;
import io.prometheus.jmx.test.support.JmxExporterMode;
import io.prometheus.jmx.test.support.MetricsType;
import io.prometheus.jmx.test.support.TestSupport;
Expand All @@ -47,7 +46,7 @@ public class OptionalValueMBeanTest {

@Verifyica.ArgumentSupplier(parallelism = Integer.MAX_VALUE)
public static Stream<ExporterTestEnvironment> arguments() {
return ExporterTestEnvironmentFactory.createExporterTestEnvironments();
return ExporterTestEnvironment.createExporterTestEnvironments();
}

@Verifyica.Prepare
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@

import io.prometheus.jmx.test.support.ExporterPath;
import io.prometheus.jmx.test.support.ExporterTestEnvironment;
import io.prometheus.jmx.test.support.ExporterTestEnvironmentFactory;
import io.prometheus.jmx.test.support.MetricsType;
import io.prometheus.jmx.test.support.TestSupport;
import io.prometheus.jmx.test.support.http.HttpClient;
Expand All @@ -46,7 +45,7 @@ public class WhitelistAndBlacklistObjectNamesTest {

@Verifyica.ArgumentSupplier(parallelism = Integer.MAX_VALUE)
public static Stream<ExporterTestEnvironment> arguments() {
return ExporterTestEnvironmentFactory.createExporterTestEnvironments();
return ExporterTestEnvironment.createExporterTestEnvironments();
}

@Verifyica.Prepare
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@

import io.prometheus.jmx.test.support.ExporterPath;
import io.prometheus.jmx.test.support.ExporterTestEnvironment;
import io.prometheus.jmx.test.support.ExporterTestEnvironmentFactory;
import io.prometheus.jmx.test.support.MetricsType;
import io.prometheus.jmx.test.support.TestSupport;
import io.prometheus.jmx.test.support.http.HttpClient;
Expand All @@ -46,7 +45,7 @@ public class WhitelistObjectNamesTest {

@Verifyica.ArgumentSupplier(parallelism = Integer.MAX_VALUE)
public static Stream<ExporterTestEnvironment> arguments() {
return ExporterTestEnvironmentFactory.createExporterTestEnvironments();
return ExporterTestEnvironment.createExporterTestEnvironments();
}

@Verifyica.Prepare
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@

import io.prometheus.jmx.test.support.ExporterPath;
import io.prometheus.jmx.test.support.ExporterTestEnvironment;
import io.prometheus.jmx.test.support.ExporterTestEnvironmentFactory;
import io.prometheus.jmx.test.support.JmxExporterMode;
import io.prometheus.jmx.test.support.MetricsType;
import io.prometheus.jmx.test.support.TestSupport;
Expand Down Expand Up @@ -63,7 +62,7 @@ public static Stream<ExporterTestEnvironment> arguments() {
// Filter eclipse-temurin:8 based Alpine images due to missing TLS cipher suites
// https://github.com/adoptium/temurin-build/issues/3002
// https://bugs.openjdk.org/browse/JDK-8306037
return ExporterTestEnvironmentFactory.createExporterTestEnvironments()
return ExporterTestEnvironment.createExporterTestEnvironments()
.filter(
exporterTestEnvironment ->
!exporterTestEnvironment
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@

import io.prometheus.jmx.test.support.ExporterPath;
import io.prometheus.jmx.test.support.ExporterTestEnvironment;
import io.prometheus.jmx.test.support.ExporterTestEnvironmentFactory;
import io.prometheus.jmx.test.support.JmxExporterMode;
import io.prometheus.jmx.test.support.MetricsType;
import io.prometheus.jmx.test.support.TestSupport;
Expand Down Expand Up @@ -58,7 +57,7 @@ public class AuthenticatorPluginTest {

@Verifyica.ArgumentSupplier(parallelism = Integer.MAX_VALUE)
public static Stream<ExporterTestEnvironment> arguments() {
return ExporterTestEnvironmentFactory.createExporterTestEnvironments()
return ExporterTestEnvironment.createExporterTestEnvironments()
.filter(
exporterTestEnvironment ->
exporterTestEnvironment.getJmxExporterMode()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@

import io.prometheus.jmx.test.support.ExporterPath;
import io.prometheus.jmx.test.support.ExporterTestEnvironment;
import io.prometheus.jmx.test.support.ExporterTestEnvironmentFactory;
import io.prometheus.jmx.test.support.JmxExporterMode;
import io.prometheus.jmx.test.support.MetricsType;
import io.prometheus.jmx.test.support.PBKDF2WithHmacExporterTestEnvironmentFilter;
Expand Down Expand Up @@ -59,7 +58,7 @@ public class BasicAuthenticationPBKDF2WithHmacSHA1Test {

@Verifyica.ArgumentSupplier(parallelism = Integer.MAX_VALUE)
public static Stream<ExporterTestEnvironment> arguments() {
return ExporterTestEnvironmentFactory.createExporterTestEnvironments()
return ExporterTestEnvironment.createExporterTestEnvironments()
.filter(new PBKDF2WithHmacExporterTestEnvironmentFilter());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@

import io.prometheus.jmx.test.support.ExporterPath;
import io.prometheus.jmx.test.support.ExporterTestEnvironment;
import io.prometheus.jmx.test.support.ExporterTestEnvironmentFactory;
import io.prometheus.jmx.test.support.JmxExporterMode;
import io.prometheus.jmx.test.support.MetricsType;
import io.prometheus.jmx.test.support.PBKDF2WithHmacExporterTestEnvironmentFilter;
Expand Down Expand Up @@ -59,7 +58,7 @@ public class BasicAuthenticationPBKDF2WithHmacSHA256Test {

@Verifyica.ArgumentSupplier(parallelism = Integer.MAX_VALUE)
public static Stream<ExporterTestEnvironment> arguments() {
return ExporterTestEnvironmentFactory.createExporterTestEnvironments()
return ExporterTestEnvironment.createExporterTestEnvironments()
.filter(new PBKDF2WithHmacExporterTestEnvironmentFilter());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@

import io.prometheus.jmx.test.support.ExporterPath;
import io.prometheus.jmx.test.support.ExporterTestEnvironment;
import io.prometheus.jmx.test.support.ExporterTestEnvironmentFactory;
import io.prometheus.jmx.test.support.JmxExporterMode;
import io.prometheus.jmx.test.support.MetricsType;
import io.prometheus.jmx.test.support.PBKDF2WithHmacExporterTestEnvironmentFilter;
Expand Down Expand Up @@ -59,7 +58,7 @@ public class BasicAuthenticationPBKDF2WithHmacSHA512Test {

@Verifyica.ArgumentSupplier(parallelism = Integer.MAX_VALUE)
public static Stream<ExporterTestEnvironment> arguments() {
return ExporterTestEnvironmentFactory.createExporterTestEnvironments()
return ExporterTestEnvironment.createExporterTestEnvironments()
.filter(new PBKDF2WithHmacExporterTestEnvironmentFilter());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@

import io.prometheus.jmx.test.support.ExporterPath;
import io.prometheus.jmx.test.support.ExporterTestEnvironment;
import io.prometheus.jmx.test.support.ExporterTestEnvironmentFactory;
import io.prometheus.jmx.test.support.JmxExporterMode;
import io.prometheus.jmx.test.support.MetricsType;
import io.prometheus.jmx.test.support.TestSupport;
Expand Down Expand Up @@ -58,7 +57,7 @@ public class BasicAuthenticationPlaintextTest {

@Verifyica.ArgumentSupplier(parallelism = Integer.MAX_VALUE)
public static Stream<ExporterTestEnvironment> arguments() {
return ExporterTestEnvironmentFactory.createExporterTestEnvironments();
return ExporterTestEnvironment.createExporterTestEnvironments();
}

@Verifyica.Prepare
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@

import io.prometheus.jmx.test.support.ExporterPath;
import io.prometheus.jmx.test.support.ExporterTestEnvironment;
import io.prometheus.jmx.test.support.ExporterTestEnvironmentFactory;
import io.prometheus.jmx.test.support.JmxExporterMode;
import io.prometheus.jmx.test.support.MetricsType;
import io.prometheus.jmx.test.support.TestSupport;
Expand Down Expand Up @@ -58,7 +57,7 @@ public class BasicAuthenticationSHA1Test {

@Verifyica.ArgumentSupplier(parallelism = Integer.MAX_VALUE)
public static Stream<ExporterTestEnvironment> arguments() {
return ExporterTestEnvironmentFactory.createExporterTestEnvironments();
return ExporterTestEnvironment.createExporterTestEnvironments();
}

@Verifyica.Prepare
Expand Down
Loading

0 comments on commit 46502fc

Please sign in to comment.