Skip to content

Commit

Permalink
Fix snmp unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
Schwartz-Matthew-bah committed Nov 30, 2018
1 parent 19c874e commit bdd9c3f
Showing 1 changed file with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@

import mockit.Expectations;
import mockit.Injectable;
import mockit.Mocked;
import us.dot.its.jpo.ode.heartbeat.RsuSnmp;

public class RsuSnmpTest {
Expand Down Expand Up @@ -131,25 +130,26 @@ public void shouldReturnEmptyResponse(@Injectable Snmp mockSnmp, @Injectable Res

@Test
public void shouldReturnVariableBindings(@Injectable Snmp mockSnmp, @Injectable ResponseEvent mockResponseEvent,
@Injectable PDU mockPDU, @Mocked Vector<?> mockVector) {
@Injectable PDU mockPDU) {

String inputMessage = "test_rsu_message_1";
String expectedMessage = "test_rsu_message_1";
String expectedMessage = "[test_rsu_message_1]";

Vector<String> fakeVector = new Vector<>();
fakeVector.add(inputMessage);

try {
new Expectations() {
{
mockSnmp.send((PDU) any, (Target) any);
result = mockResponseEvent;
// result = new IOException("testException123");

mockSnmp.close();

mockResponseEvent.getResponse();
result = mockPDU;
mockPDU.getVariableBindings();
result = mockVector;
mockVector.toString();
result = inputMessage;
result = fakeVector;
}
};
} catch (IOException e) {
Expand Down

0 comments on commit bdd9c3f

Please sign in to comment.