exceptionfactory commented on a change in pull request #5870:
URL: https://github.com/apache/nifi/pull/5870#discussion_r828494756



##########
File path: 
nifi-commons/nifi-site-to-site-client/src/test/java/org/apache/nifi/remote/client/socket/TestSiteToSiteClient.java
##########
@@ -16,89 +16,18 @@
  */
 package org.apache.nifi.remote.client.socket;
 
-import com.esotericsoftware.kryo.Kryo;
-import com.esotericsoftware.kryo.io.Input;
-import com.esotericsoftware.kryo.io.Output;
-import org.apache.nifi.components.state.StateManager;
 import org.apache.nifi.remote.client.SiteToSiteClient;
 import org.apache.nifi.remote.client.SiteToSiteClientConfig;
 import org.junit.jupiter.api.Test;
-import org.mockito.Mockito;
 
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
 import java.util.LinkedHashSet;
 import java.util.Set;
 
 import static org.junit.jupiter.api.Assertions.assertEquals;
-import static org.junit.jupiter.api.Assertions.assertNotNull;
-import static org.junit.jupiter.api.Assertions.assertNull;
 
 public class TestSiteToSiteClient {
 
-    @Test
-    public void testSerialization() {
-        final SiteToSiteClientConfig clientConfig = new 
SiteToSiteClient.Builder()
-                .url("http://localhost:8080/nifi";)
-                .portName("input")
-                .buildConfig();
-
-        final Kryo kryo = new Kryo();
-
-        final ByteArrayOutputStream out = new ByteArrayOutputStream();
-        final Output output = new Output(out);
-
-        try {
-            kryo.writeObject(output, clientConfig);
-        } finally {
-            output.close();
-        }
-
-        final ByteArrayInputStream in = new 
ByteArrayInputStream(out.toByteArray());
-        final Input input = new Input(in);
-
-        try {
-            SiteToSiteClientConfig clientConfig2 = kryo.readObject(input, 
SiteToSiteClient.StandardSiteToSiteClientConfig.class);
-            assertEquals(clientConfig.getUrls(), clientConfig2.getUrls());
-        } finally {
-            input.close();
-        }
-    }
-
-    @Test
-    public void testSerializationWithStateManager() {
-        final StateManager stateManager = Mockito.mock(StateManager.class);
-        final SiteToSiteClientConfig clientConfig = new 
SiteToSiteClient.Builder()
-            .url("http://localhost:8080/nifi";)
-            .portName("input")
-            .stateManager(stateManager)
-            .buildConfig();
-
-        final Kryo kryo = new Kryo();
-
-        final ByteArrayOutputStream out = new ByteArrayOutputStream();
-        final Output output = new Output(out);
-
-        try {
-            kryo.writeObject(output, clientConfig);
-        } finally {
-            output.close();
-        }
-
-        final ByteArrayInputStream in = new 
ByteArrayInputStream(out.toByteArray());
-        final Input input = new Input(in);
-
-        try {
-            SiteToSiteClientConfig clientConfig2 = kryo.readObject(input, 
SiteToSiteClient.StandardSiteToSiteClientConfig.class);
-            assertEquals(clientConfig.getUrls(), clientConfig2.getUrls());
-            // Serialization works, but the state manager is not serialized.
-            assertNotNull(clientConfig.getStateManager());
-            assertNull(clientConfig2.getStateManager());
-        } finally {
-            input.close();
-        }
-    }
-
+    @SuppressWarnings("deprecation")

Review comment:
       The `kryo` dependency did not have any direct runtime references, as 
indicated by the test scope, so other than rewriting the tests using standard 
Java Obejct serialization, I'm not sure what would be considered a comparable 
approach.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to