Lehel44 commented on a change in pull request #5088:
URL: https://github.com/apache/nifi/pull/5088#discussion_r668302301



##########
File path: 
nifi-nar-bundles/nifi-snmp-bundle/nifi-snmp-processors/src/test/java/org/apache/nifi/snmp/helper/SNMPTestUtils.java
##########
@@ -16,53 +16,33 @@
  */
 package org.apache.nifi.snmp.helper;
 
-import org.snmp4j.CommunityTarget;
-import org.snmp4j.Snmp;
-import org.snmp4j.UserTarget;
-import org.snmp4j.security.UsmUser;
-import org.snmp4j.smi.OID;
-import org.snmp4j.smi.OctetString;
-import org.snmp4j.smi.UdpAddress;
-import org.snmp4j.transport.DefaultUdpTransportMapping;
+import org.apache.nifi.snmp.exception.InvalidSnmpVersionException;
+import org.apache.nifi.util.MockFlowFile;
+import org.snmp4j.mp.SnmpConstants;
 
-import java.io.IOException;
+import java.util.HashMap;
+import java.util.Map;
 
-public class SNMPTestUtils {
-
-    public static Snmp createSnmpClient() throws IOException {
-        final DefaultUdpTransportMapping transportMapping = new 
DefaultUdpTransportMapping();
-        transportMapping.listen();
-        return new Snmp(transportMapping);
-    }
+import static org.apache.nifi.snmp.utils.SNMPUtils.SNMP_PROP_PREFIX;
 
-    public static CommunityTarget createCommTarget(final String community, 
final String address, final int version) {
-        final CommunityTarget target = new CommunityTarget();
-        target.setVersion(version);
-        target.setCommunity(new OctetString(community));
-        target.setAddress(new UdpAddress(address));
-        target.setRetries(0);
-        target.setTimeout(500);
-        return target;
-    }
+public class SNMPTestUtils {
 
-    public static UserTarget createUserTarget(final String address, final int 
securityLevel, final String securityName, final int version) {
-        final UserTarget target = new UserTarget();
-        target.setVersion(version);
-        target.setSecurityLevel(securityLevel);
-        target.setSecurityName(new OctetString(securityName));
-        target.setAddress(new UdpAddress(address));
-        target.setRetries(0);
-        target.setTimeout(500);
-        return target;
+    public static String getVersionByInt(int version) {
+        if (SnmpConstants.version1 == version) {

Review comment:
       No, I haven't found one.




-- 
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: issues-unsubscr...@nifi.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to