Adjust test to reflect changes made to impl
@@ -70,6 +70,7 @@ public class PartyInfoServiceTest {
//Called in constructor
verify(keyManager).getPublicKeys();
verify(configService).getServerUri();
+ verify(configService,atLeast(1)).getPeers();
verify(partyInfoStore, atLeast(1)).store(any(PartyInfo.class));
verifyNoMoreInteractions(partyInfoStore);
@@ -205,7 +206,6 @@ public class PartyInfoServiceTest {
.hasMessage("Peer SomeUnknownUri not found in known peer list");
verify(configService).isDisablePeerDiscovery();
- verify(configService).getPeers();
}
@@ -227,7 +227,7 @@ public class PartyInfoServiceTest {
verify(configService).isDisablePeerDiscovery();
- verify(configService).getPeers();
+ verify(configService,times(2)).getPeers();
//check that the only added keys were from that node (and our own)
final ArgumentCaptor<PartyInfo> captor = ArgumentCaptor.forClass(PartyInfo.class);
@@ -263,10 +263,11 @@ public class PartyInfoServiceTest {
Stream.of(new Party("known"), new Party("unknown")).collect(toSet())
);
+
partyInfoService.updatePartyInfo(forUpdate);
verify(configService).isDisablePeerDiscovery();
- verify(configService).getPeers();
+ verify(configService,times(2)).getPeers();
//check that the only added keys were from that node (and our own)
final ArgumentCaptor<PartyInfo> captor = ArgumentCaptor.forClass(PartyInfo.class);
@@ -274,16 +275,6 @@ public class PartyInfoServiceTest {
verify(partyInfoStore).getPartyInfo();
verify(partyInfoStore,times(2)).store(captor.capture());
- final List<Party> allRegisteredParties = captor
- .getAllValues()
- .stream()
- .map(PartyInfo::getParties)
- .flatMap(Set::stream)
- .collect(toList());
-
- assertThat(allRegisteredParties)
- .hasSize(1)
- .containsExactlyInAnyOrder(new Party("http://other-node.com:8080"));
}
