@@ -56,10 +56,10 @@ public class DaprContainer extends GenericContainer<DaprContainer> {
5656 private static final YamlConverter <Subscription > SUBSCRIPTION_CONVERTER = new SubscriptionYamlConverter (YAML_MAPPER );
5757 private static final YamlConverter <HttpEndpoint > HTTPENDPOINT_CONVERTER = new HttpEndpointYamlConverter (YAML_MAPPER );
5858 private static final YamlConverter <Configuration > CONFIGURATION_CONVERTER = new ConfigurationYamlConverter (
59- YAML_MAPPER );
59+ YAML_MAPPER );
6060 private static final WaitStrategy WAIT_STRATEGY = Wait .forHttp ("/v1.0/healthz/outbound" )
61- .forPort (DAPRD_DEFAULT_HTTP_PORT )
62- .forStatusCodeMatching (statusCode -> statusCode >= 200 && statusCode <= 399 );
61+ .forPort (DAPRD_DEFAULT_HTTP_PORT )
62+ .forStatusCodeMatching (statusCode -> statusCode >= 200 && statusCode <= 399 );
6363
6464 private final Set <Component > components = new HashSet <>();
6565 private final Set <Subscription > subscriptions = new HashSet <>();
@@ -68,8 +68,8 @@ public class DaprContainer extends GenericContainer<DaprContainer> {
6868 private String appChannelAddress = "localhost" ;
6969 private String placementService = "placement" ;
7070 private String schedulerService = "scheduler" ;
71- private String placementDockerImageName = DAPR_PLACEMENT_IMAGE_TAG ;
72- private String schedulerDockerImageName = DAPR_SCHEDULER_IMAGE_TAG ;
71+ private DockerImageName placementDockerImageName = DockerImageName . parse ( DAPR_PLACEMENT_IMAGE_TAG ) ;
72+ private DockerImageName schedulerDockerImageName = DockerImageName . parse ( DAPR_SCHEDULER_IMAGE_TAG ) ;
7373
7474 private Configuration configuration ;
7575 private DaprPlacementContainer placementContainer ;
@@ -82,6 +82,7 @@ public class DaprContainer extends GenericContainer<DaprContainer> {
8282
8383 /**
8484 * Creates a new Dapr container.
85+ *
8586 * @param dockerImageName Docker image name.
8687 */
8788 public DaprContainer (DockerImageName dockerImageName ) {
@@ -94,6 +95,7 @@ public DaprContainer(DockerImageName dockerImageName) {
9495
9596 /**
9697 * Creates a new Dapr container.
98+ *
9799 * @param image Docker image name.
98100 */
99101 public DaprContainer (String image ) {
@@ -166,16 +168,26 @@ public DaprContainer withHttpEndpoint(HttpEndpoint httpEndpoint) {
166168 return this ;
167169 }
168170
169- public DaprContainer withPlacementImage (String placementDockerImageName ) {
171+ public DaprContainer withPlacementImage (DockerImageName placementDockerImageName ) {
170172 this .placementDockerImageName = placementDockerImageName ;
171173 return this ;
172174 }
173175
174- public DaprContainer withSchedulerImage (String schedulerDockerImageName ) {
176+ public DaprContainer withPlacementImage (String placementDockerImageName ) {
177+ this .placementDockerImageName = DockerImageName .parse (placementDockerImageName );
178+ return this ;
179+ }
180+
181+ public DaprContainer withSchedulerImage (DockerImageName schedulerDockerImageName ) {
175182 this .schedulerDockerImageName = schedulerDockerImageName ;
176183 return this ;
177184 }
178185
186+ public DaprContainer withSchedulerImage (String schedulerDockerImageName ) {
187+ this .schedulerDockerImageName = DockerImageName .parse (schedulerDockerImageName );
188+ return this ;
189+ }
190+
179191 public DaprContainer withReusablePlacement (boolean shouldReusePlacement ) {
180192 this .shouldReusePlacement = shouldReusePlacement ;
181193 return this ;
@@ -203,6 +215,7 @@ public DaprContainer withComponent(Component component) {
203215
204216 /**
205217 * Adds a Dapr component from a YAML file.
218+ *
206219 * @param path Path to the YAML file.
207220 * @return This container.
208221 */
@@ -217,7 +230,7 @@ public DaprContainer withComponent(Path path) {
217230 String type = (String ) spec .get ("type" );
218231 String version = (String ) spec .get ("version" );
219232 List <Map <String , String >> specMetadata =
220- (List <Map <String , String >>) spec .getOrDefault ("metadata" , Collections .emptyList ());
233+ (List <Map <String , String >>) spec .getOrDefault ("metadata" , Collections .emptyList ());
221234
222235 ArrayList <MetadataEntry > metadataEntries = new ArrayList <>();
223236
@@ -258,17 +271,17 @@ protected void configure() {
258271
259272 if (this .placementContainer == null ) {
260273 this .placementContainer = new DaprPlacementContainer (this .placementDockerImageName )
261- .withNetwork (getNetwork ())
262- .withNetworkAliases (placementService )
263- .withReuse (this .shouldReusePlacement );
274+ .withNetwork (getNetwork ())
275+ .withNetworkAliases (placementService )
276+ .withReuse (this .shouldReusePlacement );
264277 this .placementContainer .start ();
265278 }
266279
267280 if (this .schedulerContainer == null ) {
268281 this .schedulerContainer = new DaprSchedulerContainer (this .schedulerDockerImageName )
269- .withNetwork (getNetwork ())
270- .withNetworkAliases (schedulerService )
271- .withReuse (this .shouldReuseScheduler );
282+ .withNetwork (getNetwork ())
283+ .withNetworkAliases (schedulerService )
284+ .withReuse (this .shouldReuseScheduler );
272285 this .schedulerContainer .start ();
273286 }
274287
@@ -384,6 +397,14 @@ public static DockerImageName getDefaultImageName() {
384397 return DEFAULT_IMAGE_NAME ;
385398 }
386399
400+ public DockerImageName getPlacementDockerImageName () {
401+ return placementDockerImageName ;
402+ }
403+
404+ public DockerImageName getSchedulerDockerImageName () {
405+ return schedulerDockerImageName ;
406+ }
407+
387408 // Required by spotbugs plugin
388409 @ Override
389410 public boolean equals (Object o ) {
0 commit comments