Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

com.github.phonypianist:snmpmock

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

com.github.phonypianist:snmpmock

SNMP Trap mock server for JUnit

  • 0.2
  • Source
  • Maven
  • Socket score

Version published
Maintainers
1
Source

This is a mock server for SNMP trap (using JUnit). The code is released under the MIT license.

Installation

Add the following to your project's pom.xml:

<dependency>
    <groupId>com.github.phonypianist</groupId>
    <artifactId>snmpmock</artifactId>
    <version>0.2</version>
    <scope>test</scope>
</dependency>

Usage

Define SnmpTrapMockRule:

@Rule
public SnmpTrapMockRule snmpTrapMockRule = new SnmpTrapMockRule();

And use rule as follows:

// Sending traps for localhost...

// Wait until receiving traps (count, timeout)
snmpTrapMockRule.waitFor(1, 1000);

// Retrieve traps
assertThat(snmpTrapMockRule.getTrapCount(), is(1));
assertThat(
        snmpTrapMockRule.getVariableBinding(0,
                SnmpConstants.snmpTrapOID.toString()).getVariable().toString(),
        is("1.3.6.1.6.3.1.1.5.4"));

FAQs

Package last updated on 28 Feb 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc