diff --git a/modules/systemd/src/test/java/org/elasticsearch/systemd/SystemdPluginTests.java b/modules/systemd/src/test/java/org/elasticsearch/systemd/SystemdPluginTests.java index 85f1446e4b0..28e1f0514e6 100644 --- a/modules/systemd/src/test/java/org/elasticsearch/systemd/SystemdPluginTests.java +++ b/modules/systemd/src/test/java/org/elasticsearch/systemd/SystemdPluginTests.java @@ -38,8 +38,8 @@ import static org.hamcrest.Matchers.instanceOf; public class SystemdPluginTests extends ESTestCase { - private Build.Type randomPackageBuildType = randomFrom(Build.Type.DEB, Build.Type.RPM); - private Build.Type randomNonPackageBuildType = + private final Build.Type randomPackageBuildType = randomFrom(Build.Type.DEB, Build.Type.RPM); + private final Build.Type randomNonPackageBuildType = randomValueOtherThanMany(t -> t == Build.Type.DEB || t == Build.Type.RPM, () -> randomFrom(Build.Type.values())); public void testIsEnabled() {