[ 
https://issues.apache.org/jira/browse/CAMEL-18980?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17683645#comment-17683645
 ] 

hisao furuichi commented on CAMEL-18980:
----------------------------------------

Hmm.. I double checked the extra line you 
[mentioned|https://github.com/apache/camel/pull/9276/files#diff-ab8dac15f4541b82865994814a811bf193ab93178e18c159b6a642d97bd14c88R43],
 but still no luck yet.
{code:java}
[hfuruich@hfuruich camel-snmp]$ oo17
openjdk version "17.0.2" 2022-01-18
OpenJDK Runtime Environment (build 17.0.2+8-86)
OpenJDK 64-Bit Server VM (build 17.0.2+8-86, mixed mode, sharing)
[hfuruich@hfuruich camel-snmp]$ cat 
./src/test/java/org/apache/camel/component/snmp/Snmpv1TrapTest.java | grep 
"trap.setEnterprise"
        trap.setEnterprise(oid);
[hfuruich@hfuruich camel-snmp]$ mvn test 
-Dtest=org.apache.camel.component.snmp.Snmpv1TrapTest
[INFO] Scanning for projects...
~~skip~~
[INFO] -------------------------------------------------------
[INFO]  T E S T S
[INFO] -------------------------------------------------------
[INFO] Running org.apache.camel.component.snmp.Snmpv1TrapTest
[ERROR] Tests run: 1, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 11.7 s 
<<< FAILURE! - in org.apache.camel.component.snmp.Snmpv1TrapTest
[ERROR] org.apache.camel.component.snmp.Snmpv1TrapTest.testSendReceiveTraps  
Time elapsed: 11.364 s  <<< FAILURE!
java.lang.AssertionError: mock://result Received message count. Expected: <1> 
but was: <0>
    at org.apache.camel.component.mock.MockEndpoint.fail(MockEndpoint.java:1860)
    at 
org.apache.camel.component.mock.MockEndpoint.assertEquals(MockEndpoint.java:1817)
    at 
org.apache.camel.component.mock.MockEndpoint.doAssertIsSatisfied(MockEndpoint.java:449)
    at 
org.apache.camel.component.mock.MockEndpoint.assertIsSatisfied(MockEndpoint.java:427)
    at 
org.apache.camel.component.mock.MockEndpoint.assertIsSatisfied(MockEndpoint.java:417)
    at 
org.apache.camel.component.snmp.AbstractTrapTest.testSendReceiveTraps(AbstractTrapTest.java:59)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native 
Method)
    at 
java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
    at 
java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:568)
    at 
org.junit.platform.commons.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:727)
 ~~skip~~
{code}
Probably I don't understand correctly about your last comment. So due to the 
difference of toString methods, we need to modify the test code again to pass? 
Or the current test code works on your end now?

> camel snmp - SNMP Ver1 trap does not work
> -----------------------------------------
>
>                 Key: CAMEL-18980
>                 URL: https://issues.apache.org/jira/browse/CAMEL-18980
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-snmp
>    Affects Versions: 3.20.1
>            Reporter: hisao furuichi
>            Assignee: Federico Mariani
>            Priority: Minor
>         Attachments: Snmpv1TrapTest.java
>
>
> Although camel-snmp supports SNMP v1, v2, and v3 trap, v1 trap does not work 
> as expected.
> By checking the test code for camel-snmp, v2 trap is only tested.
> https://github.com/apache/camel/blob/camel-3.x/components/camel-snmp/src/test/java/org/apache/camel/component/snmp/TrapTest.java
> Based on the TrapTest.java, I implemented a TrapTestSnmpv1.java. Please use 
> the test code for this issue.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to