Mark fields in SystemdPluginTests as final
These fields can be final, since they are set at construction, and changing them after that could lead to some confusing test cases. This commit allows the compiler to enforce that we never modify these values during tests.
This commit is contained in:
parent
26da573e94
commit
c329b454d9
|
@ -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() {
|
||||
|
|
Loading…
Reference in New Issue