@@ -63,23 +63,25 @@ public void close() throws Exception {
6363 @ Test
6464 public void fluxFunctionNotIsolated () throws Exception {
6565 expected .expect (BeanCreationException .class );
66- SpringApplication .run (JavaFunctionInvokerApplication .class , "--server.port=0" ,
66+ SpringApplication .run (JavaFunctionInvokerApplication .class ,
67+ "--riff.function.invoker.protocol=grpc" , "--server.port=0" ,
6768 "--grpc.port=" + port , "--function.uri=file:target/test-classes"
6869 + "?handler=io.projectriff.functions.FluxDoubler" );
6970 }
7071
7172 @ Test
7273 public void nonExistentFunction () throws Exception {
7374 expected .expect (BeanCreationException .class );
74- SpringApplication .run (JavaFunctionInvokerApplication .class , "--server.port=0" ,
75+ SpringApplication .run (JavaFunctionInvokerApplication .class ,
76+ "--riff.function.invoker.protocol=grpc" , "--server.port=0" ,
7577 "--grpc.port=" + port , "--function.uri=file:target/test-classes"
7678 + "?handler=io.projectriff.functions.NotHere" );
7779 }
7880
7981 @ Test
8082 public void fluxFunction () throws Exception {
81- runner .run ("--server.port=0 " , "--grpc .port=" + port ,
82- "--function.uri=file:target/test-classes"
83+ runner .run ("--riff.function.invoker.protocol=grpc " , "--server .port=0" ,
84+ "--grpc.port=" + port , "-- function.uri=file:target/test-classes"
8385 + "?handler=io.projectriff.functions.FluxDoubler" );
8486 List <String > result = client .send ("5" );
8587 assertThat (result ).contains ("10" );
@@ -91,8 +93,8 @@ public void fluxFunction() throws Exception {
9193 @ Test
9294 // @Ignore("Function that blocks really gums things up")
9395 public void weirdFunction () throws Exception {
94- runner .run ("--server.port=0 " , "--grpc .port=" + port ,
95- "--function.uri=file:target/test-classes"
96+ runner .run ("--riff.function.invoker.protocol=grpc " , "--server .port=0" ,
97+ "--grpc.port=" + port , "-- function.uri=file:target/test-classes"
9698 + "?handler=io.projectriff.functions.Weird" );
9799 List <String > result = client .send ("start" );
98100 assertThat (result ).isEmpty ();
@@ -101,26 +103,26 @@ public void weirdFunction() throws Exception {
101103
102104 @ Test
103105 public void supplier () throws Exception {
104- runner .run ("--server.port=0 " , "--grpc .port=" + port ,
105- "--function.uri=file:target/test-classes"
106+ runner .run ("--riff.function.invoker.protocol=grpc " , "--server .port=0" ,
107+ "--grpc.port=" + port , "-- function.uri=file:target/test-classes"
106108 + "?handler=io.projectriff.functions.NumberEmitter" );
107109 List <String > result = client .send ();
108110 assertThat (result ).contains ("1" );
109111 }
110112
111113 @ Test
112114 public void fluxSupplier () throws Exception {
113- runner .run ("--server.port=0 " , "--grpc .port=" + port ,
114- "--function.uri=file:target/test-classes"
115+ runner .run ("--riff.function.invoker.protocol=grpc " , "--server .port=0" ,
116+ "--grpc.port=" + port , "-- function.uri=file:target/test-classes"
115117 + "?handler=io.projectriff.functions.Words" );
116118 List <String > result = client .send ();
117119 assertThat (result ).contains ("foo" );
118120 }
119121
120122 @ Test
121123 public void fluxJson () throws Exception {
122- runner .run ("--server.port=0 " , "--grpc .port=" + port ,
123- "--function.uri=file:target/test-classes"
124+ runner .run ("--riff.function.invoker.protocol=grpc " , "--server .port=0" ,
125+ "--grpc.port=" + port , "-- function.uri=file:target/test-classes"
124126 + "?handler=io.projectriff.functions.Greeter" );
125127 List <String > result = client .send ("{\" value\" :\" World\" }" );
126128 // Custom JSON serialization doesn't work across the class loader boundary
@@ -132,7 +134,8 @@ public void fluxJson() throws Exception {
132134
133135 @ Test
134136 public void messageFunction () throws Exception {
135- runner .run ("--server.port=0" , "--grpc.port=" + port ,
137+ runner .run ("--riff.function.invoker.protocol=grpc" , "--server.port=0" ,
138+ "--grpc.port=" + port ,
136139 "--function.uri=file:target/test-classes,file:target/test-functions"
137140 + "?handler=io.projectriff.functions.MessageGreeter" );
138141 List <String > result = client .send ("World" );
@@ -141,7 +144,8 @@ public void messageFunction() throws Exception {
141144
142145 @ Test
143146 public void fluxMessageFunction () throws Exception {
144- runner .run ("--server.port=0" , "--grpc.port=" + port ,
147+ runner .run ("--riff.function.invoker.protocol=grpc" , "--server.port=0" ,
148+ "--grpc.port=" + port ,
145149 "--function.uri=file:target/test-classes,file:target/test-functions"
146150 + "?handler=io.projectriff.functions.FluxMessageGreeter" );
147151 List <String > result = client .send ("{\" value\" :\" World\" }" );
@@ -150,7 +154,8 @@ public void fluxMessageFunction() throws Exception {
150154
151155 @ Test
152156 public void windowFunction () throws Exception {
153- runner .run ("--server.port=0" , "--grpc.port=" + port ,
157+ runner .run ("--riff.function.invoker.protocol=grpc" , "--server.port=0" ,
158+ "--grpc.port=" + port ,
154159 "--function.uri=file:target/test-classes,file:target/test-functions"
155160 + "?handler=io.projectriff.functions.VoteStreamProcessor" );
156161 List <String > result = client .send ("one" , "one" , "two" );
@@ -159,8 +164,8 @@ public void windowFunction() throws Exception {
159164
160165 @ Test
161166 public void simpleFunction () throws Exception {
162- runner .run ("--server.port=0 " , "--grpc .port=" + port ,
163- "--function.uri=file:target/test-classes"
167+ runner .run ("--riff.function.invoker.protocol=grpc " , "--server .port=0" ,
168+ "--grpc.port=" + port , "-- function.uri=file:target/test-classes"
164169 + "?handler=io.projectriff.functions.Doubler" );
165170 List <String > result = client .send (
166171 message -> new String (message .getPayload ().toByteArray ()) + ":"
@@ -172,8 +177,8 @@ public void simpleFunction() throws Exception {
172177
173178 @ Test
174179 public void pojoFunction () throws Exception {
175- runner .run ("--server.port=0 " , "--grpc .port=" + port ,
176- "--function.uri=file:target/test-classes"
180+ runner .run ("--riff.function.invoker.protocol=grpc " , "--server .port=0" ,
181+ "--grpc.port=" + port , "-- function.uri=file:target/test-classes"
177182 + "?handler=io.projectriff.functions.Greeter" );
178183 List <String > result = client .send (MediaType .APPLICATION_JSON ,
179184 "{\" value\" :\" World\" }" );
@@ -182,14 +187,16 @@ public void pojoFunction() throws Exception {
182187
183188 @ Test (expected = Exception .class )
184189 public void nonExistentFunctionWithMain () throws Exception {
185- runner .run ("--server.port=0" , "--grpc.port=" + port ,
190+ runner .run ("--riff.function.invoker.protocol=grpc" , "--server.port=0" ,
191+ "--grpc.port=" + port ,
186192 "--function.uri=app:classpath?" + "handler=notThere&"
187193 + "main=io.projectriff.functions.FunctionApp" );
188194 }
189195
190196 @ Test
191197 public void mainClassBeanName () throws Exception {
192- runner .run ("--server.port=0" , "--grpc.port=" + port ,
198+ runner .run ("--riff.function.invoker.protocol=grpc" , "--server.port=0" ,
199+ "--grpc.port=" + port ,
193200 "--function.uri=app:classpath?" + "handler=myDoubler&"
194201 + "main=io.projectriff.functions.FunctionApp" );
195202 List <String > result = client .send ("5" );
@@ -198,7 +205,8 @@ public void mainClassBeanName() throws Exception {
198205
199206 @ Test
200207 public void mainClassBeanType () throws Exception {
201- runner .run ("--server.port=0" , "--grpc.port=" + port ,
208+ runner .run ("--riff.function.invoker.protocol=grpc" , "--server.port=0" ,
209+ "--grpc.port=" + port ,
202210 "--function.uri=app:classpath?"
203211 + "handler=io.projectriff.functions.Doubler&"
204212 + "main=io.projectriff.functions.FunctionApp" );
0 commit comments