♻️ Use notNullValue() instead of not(nullValue()) next
authorDavid ‘Bombe’ Roden <bombe@freenetproject.org>
Wed, 8 Jan 2025 20:34:26 +0000 (21:34 +0100)
committerDavid ‘Bombe’ Roden <bombe@freenetproject.org>
Wed, 8 Jan 2025 20:34:26 +0000 (21:34 +0100)
src/test/java/net/pterodactylus/fcp/plugin/WebOfTrustPluginTest.java

index f63c6cf..ab03b27 100644 (file)
@@ -38,7 +38,7 @@ import static org.hamcrest.Matchers.allOf;
 import static org.hamcrest.Matchers.containsInAnyOrder;
 import static org.hamcrest.Matchers.equalTo;
 import static org.hamcrest.Matchers.hasEntry;
-import static org.hamcrest.Matchers.not;
+import static org.hamcrest.Matchers.notNullValue;
 import static org.hamcrest.Matchers.nullValue;
 import static org.junit.Assert.assertThrows;
 
@@ -54,7 +54,7 @@ public class WebOfTrustPluginTest {
                        webOfTrustPlugin.createIdentity("Test Nickname", "test-context", true);
                        assertThat(fcpConnection.sentMessages.get(0), allOf(
                                        isNamed(equalTo("FCPPluginMessage")),
-                                       hasField("Identifier", not(nullValue())),
+                                       hasField("Identifier", notNullValue()),
                                        hasField("PluginName", equalTo("plugins.WebOfTrust.WebOfTrust")),
                                        hasField("Param.Message", equalTo("CreateIdentity")),
                                        hasField("Param.Nickname", equalTo("Test Nickname")),
@@ -79,7 +79,7 @@ public class WebOfTrustPluginTest {
                        webOfTrustPlugin.createIdentity("Test Nickname", "test-context", true, "insert-uri");
                        assertThat(fcpConnection.sentMessages.get(0), allOf(
                                        isNamed(equalTo("FCPPluginMessage")),
-                                       hasField("Identifier", not(nullValue())),
+                                       hasField("Identifier", notNullValue()),
                                        hasField("PluginName", equalTo("plugins.WebOfTrust.WebOfTrust")),
                                        hasField("Param.Message", equalTo("CreateIdentity")),
                                        hasField("Param.Nickname", equalTo("Test Nickname")),
@@ -104,7 +104,7 @@ public class WebOfTrustPluginTest {
                        webOfTrustPlugin.createIdentity("Test Nickname", "test-context", true, "some-request-uri", "insert-uri");
                        assertThat(fcpConnection.sentMessages.get(0), allOf(
                                        isNamed(equalTo("FCPPluginMessage")),
-                                       hasField("Identifier", not(nullValue())),
+                                       hasField("Identifier", notNullValue()),
                                        hasField("PluginName", equalTo("plugins.WebOfTrust.WebOfTrust")),
                                        hasField("Param.Message", equalTo("CreateIdentity")),
                                        hasField("Param.Nickname", equalTo("Test Nickname")),
@@ -161,7 +161,7 @@ public class WebOfTrustPluginTest {
                        webOfTrustPlugin.getOwnIdentities();
                        assertThat(fcpConnection.sentMessages.get(0), allOf(
                                        isNamed(equalTo("FCPPluginMessage")),
-                                       hasField("Identifier", not(nullValue())),
+                                       hasField("Identifier", notNullValue()),
                                        hasField("PluginName", equalTo("plugins.WebOfTrust.WebOfTrust")),
                                        hasField("Param.Message", equalTo("GetOwnIdentities"))
                        ));
@@ -189,7 +189,7 @@ public class WebOfTrustPluginTest {
                        webOfTrustPlugin.getOwnIdentites();
                        assertThat(fcpConnection.sentMessages.get(0), allOf(
                                        isNamed(equalTo("FCPPluginMessage")),
-                                       hasField("Identifier", not(nullValue())),
+                                       hasField("Identifier", notNullValue()),
                                        hasField("PluginName", equalTo("plugins.WebOfTrust.WebOfTrust")),
                                        hasField("Param.Message", equalTo("GetOwnIdentities"))
                        ));
@@ -245,7 +245,7 @@ public class WebOfTrustPluginTest {
                        webOfTrustPlugin.getIdentityTrust(ownIdentity, "other-id");
                        assertThat(fcpConnection.sentMessages.get(0), allOf(
                                        isNamed(equalTo("FCPPluginMessage")),
-                                       hasField("Identifier", not(nullValue())),
+                                       hasField("Identifier", notNullValue()),
                                        hasField("PluginName", equalTo("plugins.WebOfTrust.WebOfTrust")),
                                        hasField("Param.Message", equalTo("GetIdentity")),
                                        hasField("Param.Truster", equalTo("own-id")),
@@ -335,7 +335,7 @@ public class WebOfTrustPluginTest {
                        webOfTrustPlugin.addIdentity("USK@foo,bar/baz/123");
                        assertThat(fcpConnection.sentMessages.get(0), allOf(
                                        isNamed(equalTo("FCPPluginMessage")),
-                                       hasField("Identifier", not(nullValue())),
+                                       hasField("Identifier", notNullValue()),
                                        hasField("PluginName", equalTo("plugins.WebOfTrust.WebOfTrust")),
                                        hasField("Param.RequestURI", equalTo("USK@foo,bar/baz/123"))
                        ));