@@ -48,7 +48,6 @@ public class DaprContainer extends GenericContainer<DaprContainer> {
4848  private  static  final  Logger  LOGGER  = LoggerFactory .getLogger (DaprContainer .class );
4949  private  static  final  int  DAPRD_DEFAULT_HTTP_PORT  = 3500 ;
5050  private  static  final  int  DAPRD_DEFAULT_GRPC_PORT  = 50001 ;
51-   private  static  final  DaprProtocol  DAPR_PROTOCOL  = DaprProtocol .HTTP ;
5251  private  static  final  DockerImageName  DEFAULT_IMAGE_NAME  =
5352          DockerImageName .parse (DAPR_RUNTIME_IMAGE_TAG );
5453  private  static  final  Yaml  YAML_MAPPER  = YamlMapperFactory .create ();
@@ -76,6 +75,7 @@ public class DaprContainer extends GenericContainer<DaprContainer> {
7675  private  DaprSchedulerContainer  schedulerContainer ;
7776  private  String  appName ;
7877  private  Integer  appPort ;
78+   private  DaprProtocol  appProtocol ;
7979  private  String  appHealthCheckPath ;
8080  private  Integer  appHealthCheckProbeInterval  = 5 ; //default from docs 
8181  private  Integer  appHealthCheckProbeTimeout  = 500 ; //default from docs 
@@ -126,6 +126,11 @@ public DaprContainer withAppPort(Integer port) {
126126    return  this ;
127127  }
128128
129+   public  DaprContainer  withAppProtocol (DaprProtocol  protocol ) {
130+     this .appProtocol  = protocol ;
131+     return  this ;
132+   }
133+ 
129134  public  DaprContainer  withAppChannelAddress (String  appChannelAddress ) {
130135    this .appChannelAddress  = appChannelAddress ;
131136    return  this ;
@@ -308,8 +313,6 @@ protected void configure() {
308313    cmds .add ("--app-id" );
309314    cmds .add (appName );
310315    cmds .add ("--dapr-listen-addresses=0.0.0.0" );
311-     cmds .add ("--app-protocol" );
312-     cmds .add (DAPR_PROTOCOL .getName ());
313316    cmds .add ("--placement-host-address" );
314317    cmds .add (placementService  + ":50005" );
315318    cmds .add ("--scheduler-host-address" );
@@ -325,6 +328,11 @@ protected void configure() {
325328      cmds .add (Integer .toString (appPort ));
326329    }
327330
331+     if  (appProtocol  != null ) {
332+       cmds .add ("--app-protocol" );
333+       cmds .add (appProtocol .getName ());
334+     }
335+ 
328336    if  (appHealthCheckPath  != null  && !appHealthCheckPath .isEmpty ()) {
329337      cmds .add ("--enable-app-health-check" );
330338      cmds .add ("--app-health-check-path" );
@@ -413,6 +421,10 @@ public Integer getAppPort() {
413421    return  appPort ;
414422  }
415423
424+   public  DaprProtocol  getAppProtocol () {
425+     return  appProtocol ;
426+   }
427+ 
416428  public  String  getAppHealthCheckPath () {
417429    return  appHealthCheckPath ;
418430  }
0 commit comments