This is an automated email from the ASF dual-hosted git repository.
jackie pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pinot.git
The following commit(s) were added to refs/heads/master by this push:
new 038ef06e5f verify Plugin equals method (#12575)
038ef06e5f is described below
commit 038ef06e5f1f3d6936fd8313129fa6b5618fbf46
Author: sullis <[email protected]>
AuthorDate: Wed Mar 6 09:43:08 2024 -0800
verify Plugin equals method (#12575)
---
pinot-spi/pom.xml | 5 ++++
.../java/org/apache/pinot/spi/plugin/Plugin.java | 4 +--
.../org/apache/pinot/spi/plugin/PluginTest.java} | 34 ++++------------------
3 files changed, 13 insertions(+), 30 deletions(-)
diff --git a/pinot-spi/pom.xml b/pinot-spi/pom.xml
index feb51bceea..06b616bace 100644
--- a/pinot-spi/pom.xml
+++ b/pinot-spi/pom.xml
@@ -139,6 +139,11 @@
<artifactId>testng</artifactId>
<scope>test</scope>
</dependency>
+ <dependency>
+ <groupId>nl.jqno.equalsverifier</groupId>
+ <artifactId>equalsverifier</artifactId>
+ <scope>test</scope>
+ </dependency>
<dependency>
<groupId>org.reflections</groupId>
<artifactId>reflections</artifactId>
diff --git a/pinot-spi/src/main/java/org/apache/pinot/spi/plugin/Plugin.java
b/pinot-spi/src/main/java/org/apache/pinot/spi/plugin/Plugin.java
index 6bfc2f574c..c8e4fbe0ed 100644
--- a/pinot-spi/src/main/java/org/apache/pinot/spi/plugin/Plugin.java
+++ b/pinot-spi/src/main/java/org/apache/pinot/spi/plugin/Plugin.java
@@ -21,9 +21,9 @@ package org.apache.pinot.spi.plugin;
import java.util.Objects;
-public class Plugin {
+public final class Plugin {
- String _name;
+ final String _name;
public Plugin(String name) {
_name = name;
diff --git a/pinot-spi/src/main/java/org/apache/pinot/spi/plugin/Plugin.java
b/pinot-spi/src/test/java/org/apache/pinot/spi/plugin/PluginTest.java
similarity index 62%
copy from pinot-spi/src/main/java/org/apache/pinot/spi/plugin/Plugin.java
copy to pinot-spi/src/test/java/org/apache/pinot/spi/plugin/PluginTest.java
index 6bfc2f574c..5f589ce6e1 100644
--- a/pinot-spi/src/main/java/org/apache/pinot/spi/plugin/Plugin.java
+++ b/pinot-spi/src/test/java/org/apache/pinot/spi/plugin/PluginTest.java
@@ -18,36 +18,14 @@
*/
package org.apache.pinot.spi.plugin;
-import java.util.Objects;
+import nl.jqno.equalsverifier.EqualsVerifier;
+import org.testng.annotations.Test;
-public class Plugin {
+public class PluginTest {
- String _name;
-
- public Plugin(String name) {
- _name = name;
- }
-
- @Override
- public boolean equals(Object o) {
- if (this == o) {
- return true;
- }
- if (o == null || getClass() != o.getClass()) {
- return false;
- }
- Plugin plugin = (Plugin) o;
- return Objects.equals(_name, plugin._name);
- }
-
- @Override
- public int hashCode() {
- return Objects.hash(_name);
- }
-
- @Override
- public String toString() {
- return _name;
+ @Test
+ public void equalsVerifier() {
+ EqualsVerifier.forClass(Plugin.class).verify();
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]