Search in sources :

Example 1 with AgentBuilder

use of org.hyperledger.besu.ethereum.p2p.discovery.PeerDiscoveryTestHelper.AgentBuilder in project besu by hyperledger.

the class PeerDiscoveryAgentTest method shouldBeActiveWhenConfigIsTrue.

@Test
public void shouldBeActiveWhenConfigIsTrue() {
    final AgentBuilder agentBuilder = helper.agentBuilder().active(true);
    final MockPeerDiscoveryAgent agent = helper.startDiscoveryAgent(agentBuilder);
    assertThat(agent.isActive()).isTrue();
}
Also used : AgentBuilder(org.hyperledger.besu.ethereum.p2p.discovery.PeerDiscoveryTestHelper.AgentBuilder) MockPeerDiscoveryAgent(org.hyperledger.besu.ethereum.p2p.discovery.internal.MockPeerDiscoveryAgent) Test(org.junit.Test)

Example 2 with AgentBuilder

use of org.hyperledger.besu.ethereum.p2p.discovery.PeerDiscoveryTestHelper.AgentBuilder in project besu by hyperledger.

the class PeerDiscoveryAgentTest method shouldNotBeActiveWhenConfigIsFalse.

@Test
public void shouldNotBeActiveWhenConfigIsFalse() {
    final AgentBuilder agentBuilder = helper.agentBuilder().active(false);
    final MockPeerDiscoveryAgent agent = helper.startDiscoveryAgent(agentBuilder);
    assertThat(agent.isActive()).isFalse();
}
Also used : AgentBuilder(org.hyperledger.besu.ethereum.p2p.discovery.PeerDiscoveryTestHelper.AgentBuilder) MockPeerDiscoveryAgent(org.hyperledger.besu.ethereum.p2p.discovery.internal.MockPeerDiscoveryAgent) Test(org.junit.Test)

Aggregations

AgentBuilder (org.hyperledger.besu.ethereum.p2p.discovery.PeerDiscoveryTestHelper.AgentBuilder)2 MockPeerDiscoveryAgent (org.hyperledger.besu.ethereum.p2p.discovery.internal.MockPeerDiscoveryAgent)2 Test (org.junit.Test)2