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:
Jason Tedor 2019-07-24 17:15:11 +09:00
parent 26da573e94
commit c329b454d9
No known key found for this signature in database
GPG Key ID: FA89F05560F16BC5
1 changed files with 2 additions and 2 deletions

View File

@ -38,8 +38,8 @@ import static org.hamcrest.Matchers.instanceOf;
public class SystemdPluginTests extends ESTestCase { public class SystemdPluginTests extends ESTestCase {
private Build.Type randomPackageBuildType = randomFrom(Build.Type.DEB, Build.Type.RPM); private final Build.Type randomPackageBuildType = randomFrom(Build.Type.DEB, Build.Type.RPM);
private Build.Type randomNonPackageBuildType = private final Build.Type randomNonPackageBuildType =
randomValueOtherThanMany(t -> t == Build.Type.DEB || t == Build.Type.RPM, () -> randomFrom(Build.Type.values())); randomValueOtherThanMany(t -> t == Build.Type.DEB || t == Build.Type.RPM, () -> randomFrom(Build.Type.values()));
public void testIsEnabled() { public void testIsEnabled() {