- fixed by removing redundant condition
Change-Id: I3d0e43c6abebab776b21a9c12c91a5a570d0e55c
Signed-off-by: Tomas Cechvala <tcechval@cisco.com>
@Override
public void sync(NodeId nodeId, OfWriter ofWriter) throws Exception {
- if (ctx.getSwitchManager().getExternalPorts(nodeId).isEmpty()) {
- LOG.trace("No external ports found for node: {}", nodeId);
- return;
- }
// Default drop all
ofWriter.writeFlow(nodeId, TABLE_ID, dropFlow(Integer.valueOf(1), null, TABLE_ID));
@Test
public void syncTestNoExternalPorts() throws Exception {
+ // we still need ExternalMapper flows (default output and default drop) to be generated
mapper.sync(nodeId, ofWriter);
- verify(ofWriter, never()).writeFlow(any(NodeId.class), any(Short.class), any(Flow.class));
+ verify(ofWriter, times(2)).writeFlow(any(NodeId.class), any(Short.class), any(Flow.class));
}
}