mirror of https://github.com/dapr/java-sdk.git
Fix IT to switch to GRPC service invocation.
This commit is contained in:
parent
7eacfcc88f
commit
5d20a217a7
|
|
@ -140,18 +140,28 @@ public class DaprRun implements Stoppable {
|
||||||
System.getProperties().setProperty(Properties.GRPC_PORT.getName(), String.valueOf(this.ports.getGrpcPort()));
|
System.getProperties().setProperty(Properties.GRPC_PORT.getName(), String.valueOf(this.ports.getGrpcPort()));
|
||||||
}
|
}
|
||||||
System.getProperties().setProperty(Properties.API_PROTOCOL.getName(), DaprApiProtocol.GRPC.name());
|
System.getProperties().setProperty(Properties.API_PROTOCOL.getName(), DaprApiProtocol.GRPC.name());
|
||||||
|
System.getProperties().setProperty(
|
||||||
|
Properties.API_METHOD_INVOCATION_PROTOCOL.getName(),
|
||||||
|
DaprApiProtocol.GRPC.name());
|
||||||
}
|
}
|
||||||
|
|
||||||
public void switchToGRPC() {
|
public void switchToGRPC() {
|
||||||
System.getProperties().setProperty(Properties.API_PROTOCOL.getName(), DaprApiProtocol.GRPC.name());
|
System.getProperties().setProperty(Properties.API_PROTOCOL.getName(), DaprApiProtocol.GRPC.name());
|
||||||
|
System.getProperties().setProperty(
|
||||||
|
Properties.API_METHOD_INVOCATION_PROTOCOL.getName(),
|
||||||
|
DaprApiProtocol.GRPC.name());
|
||||||
}
|
}
|
||||||
|
|
||||||
public void switchToHTTP() {
|
public void switchToHTTP() {
|
||||||
System.getProperties().setProperty(Properties.API_PROTOCOL.getName(), DaprApiProtocol.HTTP.name());
|
System.getProperties().setProperty(Properties.API_PROTOCOL.getName(), DaprApiProtocol.HTTP.name());
|
||||||
|
System.getProperties().setProperty(
|
||||||
|
Properties.API_METHOD_INVOCATION_PROTOCOL.getName(),
|
||||||
|
DaprApiProtocol.HTTP.name());
|
||||||
}
|
}
|
||||||
|
|
||||||
public void switchToProtocol(DaprApiProtocol protocol) {
|
public void switchToProtocol(DaprApiProtocol protocol) {
|
||||||
System.getProperties().setProperty(Properties.API_PROTOCOL.getName(), protocol.name());
|
System.getProperties().setProperty(Properties.API_PROTOCOL.getName(), protocol.name());
|
||||||
|
System.getProperties().setProperty(Properties.API_METHOD_INVOCATION_PROTOCOL.getName(), protocol.name());
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getGrpcPort() {
|
public int getGrpcPort() {
|
||||||
|
|
|
||||||
|
|
@ -139,7 +139,11 @@ public class MethodInvokeIT extends BaseIT {
|
||||||
client.invokeMethod(daprRun.getAppName(), "sleep", req.toByteArray(), HttpExtension.POST).block());
|
client.invokeMethod(daprRun.getAppName(), "sleep", req.toByteArray(), HttpExtension.POST).block());
|
||||||
|
|
||||||
assertEquals("UNKNOWN", exception.getErrorCode());
|
assertEquals("UNKNOWN", exception.getErrorCode());
|
||||||
assertEquals("UNKNOWN: HTTP status code: 500", exception.getMessage());
|
if (this.useGrpc) {
|
||||||
|
assertEquals("UNKNOWN: ", exception.getMessage());
|
||||||
|
} else {
|
||||||
|
assertEquals("UNKNOWN: HTTP status code: 500", exception.getMessage());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue