@Test
public void testDispatch_incorrectSnmpVersion() throws Exception {

  SNMPDispatcher dispatcher = spy(new SNMPDispatcher(DEFAULT_SNMP_PORT));
  Notification notification = mock(Notification.class);
  notification.Callback = mock(DispatchCallback.class);
  notification.CallbackIds = new ArrayList<>();
  Map<String, String> properties = new HashMap<String, String>();
  properties.put(SNMPDispatcher.SUBJECT_OID_PROPERTY, "1");
  properties.put(SNMPDispatcher.BODY_OID_PROPERTY, "2");
  properties.put(SNMPDispatcher.PORT_PROPERTY, "3");
  properties.put(SNMPDispatcher.COMMUNITY_PROPERTY, "4");
  properties.put(SNMPDispatcher.SNMP_VERSION_PROPERTY, "SNMPv11");
  properties.put(SNMPDispatcher.TRAP_OID_PROPERTY, "1.3.6.1.6.3.1.1.5.4");
  notification.DispatchProperties = properties;
  notification.Body = "body";
  notification.Subject = "subject";
  notification.Recipients = Arrays.asList(new Recipient());
  dispatcher.dispatch(notification);
  verify(notification.Callback).onFailure(notification.CallbackIds);
  verify(notification.Callback, never()).onSuccess(notification.CallbackIds);
}