NetworkManagerImpl implements NetworkManager { @Override public String getP2pVersion( final Host host ) throws NetworkManagerException { Preconditions.checkNotNull( host, "Invalid host" ); CommandResult result = execute( host, commands.getGetP2pVersionCommand() ); String p2pVersion = result.getStdOut(); if ( p2pVersion != null ) { p2pVersion = p2pVersion.replace( "p2p version", "" ).trim(); } return p2pVersion; } NetworkManagerImpl( final PeerManager peerManager ); @Override void joinP2PSwarm( final Host host, final String interfaceName, final String localIp, final String p2pHash,
                              final String secretKey, final long secretKeyTtlSec ); @Override void joinP2PSwarmDHCP( final Host host, final String interfaceName, final String p2pHash,
                                  final String secretKey, final long secretKeyTtlSec ); @Override void removeP2PSwarm( final Host host, String p2pHash ); @Override void removeP2PIface( Host host, String interfaceName ); @Override void resetSwarmSecretKey( final Host host, final String p2pHash, final String newSecretKey,
                                     final long ttlSeconds ); @Override P2PConnections getP2PConnections( final Host host ); @Override String getP2pVersion( final Host host ); @Override String getP2pStatusByP2PHash( Host host, String p2pHash ); Set<String> getUsedP2pIfaceNames( final Host host ); @Override void createTunnel( final Host host, final String tunnelName, final String tunnelIp, final int vlan,
                              final long vni ); @Override void deleteTunnel( final Host host, final String tunnelName ); @Override Tunnels getTunnels( final Host host ); @Override SshTunnel setupContainerSshTunnel( final String containerIp, final int sshIdleTimeout ); @Override ReservedPorts getReservedPorts( final Host host ); ReservedPorts getContainerPortMappings( final Host host, final Protocol protocol ); @Override boolean isPortMappingReserved( final Host host, final Protocol protocol, final int externalPort,
                                          final String ipAddress, final int internalPort, final String domain ); @Override void mapContainerPort( final Host host, final Protocol protocol, final String containerIp,
                                  final int containerPort, final int rhPort ); @Override void removeContainerPortMapping( final Host host, final Protocol protocol, final String containerIp,
                                            final int containerPort, final int rhPort ); @Override void mapContainerPortToDomain( final Host host, final Protocol protocol, final String containerIp,
                                          final int containerPort, final int rhPort, final String domain,
                                          final String sslCertPath, final LoadBalancing loadBalancing,
                                          final boolean sslBackend, final boolean redirect, final boolean http2 ); @Override void removeContainerPortDomainMapping( final Host host, final Protocol protocol, final String containerIp,
                                                  final int containerPort, final int rhPort, final String domain ); @Override String getResourceHostIp( final Host host );  }
@Test public void testGetP2pVersion() throws Exception { networkManager.getP2pVersion( resourceHost ); verify( commandResult ).getStdOut(); }