cover mimial args constructor
@@ -6,7 +6,6 @@ import com.quorum.tessera.partyinfo.model.PartyInfo;
import com.quorum.tessera.partyinfo.node.NodeInfo;
import org.junit.After;
import org.junit.Before;
-import org.junit.Ignore;
import org.junit.Test;
import org.mockito.invocation.InvocationOnMock;
@@ -125,10 +124,27 @@ public class PartyInfoBroadcasterTest {
verify(partyInfoParser).to(any(PartyInfo.class));
}
- @Ignore
+
@Test
public void constructWithMinimalArgs() {
- assertThat(new PartyInfoBroadcaster(p2pClient)).isNotNull();
+
+ try(var discoveryMockedStatic = mockStatic(Discovery.class);
+ var partyInfoParserMockedStatic = mockStatic(PartyInfoParser.class);
+ var partyStoreMockedStatic = mockStatic(PartyStore.class)
+ ) {
+ discoveryMockedStatic.when(Discovery::create).thenReturn(discovery);
+ partyInfoParserMockedStatic.when(PartyInfoParser::create).thenReturn(partyInfoParser);
+ partyStoreMockedStatic.when(PartyStore::getInstance).thenReturn(partyStore);
+
+ PartyInfoBroadcaster partyInfoBroadcaster = new PartyInfoBroadcaster(mock(P2pClient.class));
+ assertThat(partyInfoBroadcaster).isNotNull();
+
+ discoveryMockedStatic.verify(Discovery::create);
+ partyInfoParserMockedStatic.verify(PartyInfoParser::create);
+ partyStoreMockedStatic.verify(PartyStore::getInstance);
+
+ }
+
}
@Test
