This repository was archived by the owner on May 4, 2019. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +23
-2
lines changed
vizceral/src/test/java/io/netifi/proteus/vizceral/service Expand file tree Collapse file tree 1 file changed +23
-2
lines changed Original file line number Diff line number Diff line change 99
1010import java .io .InputStream ;
1111import java .time .Duration ;
12+ import java .util .Collection ;
1213import java .util .List ;
14+ import java .util .function .Function ;
1315
14- import static org .junit .Assert .assertEquals ;
15- import static org .junit .Assert .assertNotNull ;
16+ import static org .junit .Assert .*;
1617
1718public class VizceralBridgeTest {
1819
@@ -65,6 +66,26 @@ public void vizSource() {
6566 List <Node > nodeList = root .getNodesList ();
6667 assertNotNull (nodeList );
6768 assertEquals (2 , nodeList .size ());
69+ boolean thereIsRequester = assertOneMatches (nodeList , (node ) ->
70+ "quickstart.clients-client1" .equals (node .getName ())
71+ &&
72+ node .getConnectionsList ().isEmpty ());
73+ assertTrue (thereIsRequester );
74+
75+ boolean thereIsResponder = assertOneMatches (nodeList , (node ) ->
76+ "quickstart.services.helloservices-helloservice-3fa7b9dc-7afd-4767-a781-b7265a9fa02d" .equals (node .getName ())
77+ &&
78+ node .getConnectionsList ().isEmpty ());
79+ assertTrue (thereIsResponder );
80+ }
81+
82+ private static <T > boolean assertOneMatches (Collection <T > it , Function <T , Boolean > assertion ) {
83+ for (T t : it ) {
84+ if (assertion .apply (t )) {
85+ return true ;
86+ }
87+ }
88+ return false ;
6889 }
6990
7091 private Mono <InputStream > zipkinMockSource () {
You can’t perform that action at this time.
0 commit comments