mirror of
https://github.com/bisq-network/bisq.git
synced 2024-11-19 18:03:12 +01:00
bitcoinj 0.15: PeerAddress: BtcNodeConverterTest fixes.
This commit is contained in:
parent
3717323444
commit
7b172c1280
@ -45,29 +45,16 @@ public class BtcNodeConverterTest {
|
|||||||
BtcNode node = mock(BtcNode.class);
|
BtcNode node = mock(BtcNode.class);
|
||||||
when(node.getOnionAddress()).thenReturn("aaa.onion");
|
when(node.getOnionAddress()).thenReturn("aaa.onion");
|
||||||
|
|
||||||
InetAddress inetAddress = mock(InetAddress.class);
|
//InetAddress inetAddress = mock(InetAddress.class);
|
||||||
|
|
||||||
Facade facade = mock(Facade.class);
|
Facade facade = mock(Facade.class);
|
||||||
when(facade.onionHostToInetAddress(any())).thenReturn(inetAddress);
|
//when(facade.onionHostToInetAddress(any())).thenReturn(inetAddress);
|
||||||
|
|
||||||
PeerAddress peerAddress = new BtcNodeConverter(facade).convertOnionHost(node);
|
PeerAddress peerAddress = new BtcNodeConverter(facade).convertOnionHost(node);
|
||||||
// noinspection ConstantConditions
|
// noinspection ConstantConditions
|
||||||
assertEquals(inetAddress, peerAddress.getAddr());
|
assertEquals(node.getOnionAddress(), peerAddress.getHostname());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
|
||||||
public void testConvertOnionHostOnFailure() throws UnknownHostException {
|
|
||||||
BtcNode node = mock(BtcNode.class);
|
|
||||||
when(node.getOnionAddress()).thenReturn("aaa.onion");
|
|
||||||
|
|
||||||
Facade facade = mock(Facade.class);
|
|
||||||
when(facade.onionHostToInetAddress(any())).thenThrow(UnknownHostException.class);
|
|
||||||
|
|
||||||
PeerAddress peerAddress = new BtcNodeConverter(facade).convertOnionHost(node);
|
|
||||||
assertNull(peerAddress);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Ignore
|
|
||||||
@Test
|
@Test
|
||||||
public void testConvertClearNode() {
|
public void testConvertClearNode() {
|
||||||
final String ip = "192.168.0.1";
|
final String ip = "192.168.0.1";
|
||||||
|
Loading…
Reference in New Issue
Block a user