use of com.quorum.tessera.discovery.DiscoveryHelper in project tessera by ConsenSys.
the class DiscoveryHelperProviderTest method provider.
@Test
public void provider() {
try (var mockedEnclave = mockStatic(Enclave.class);
var mockedNetworkStore = mockStatic(NetworkStore.class)) {
NetworkStore networkStore = mock(NetworkStore.class);
mockedNetworkStore.when(NetworkStore::getInstance).thenReturn(networkStore);
Enclave enclave = mock(Enclave.class);
mockedEnclave.when(Enclave::create).thenReturn(enclave);
DiscoveryHelper helper = DiscoveryHelperProvider.provider();
assertThat(helper).isNotNull().isExactlyInstanceOf(DiscoveryHelperImpl.class);
mockedEnclave.verify(Enclave::create);
mockedEnclave.verifyNoMoreInteractions();
mockedNetworkStore.verify(NetworkStore::getInstance);
mockedNetworkStore.verifyNoMoreInteractions();
verifyNoInteractions(networkStore);
verifyNoInteractions(enclave);
}
}
Aggregations