1919import org .testcontainers .containers .Network ;
2020import org .yaml .snakeyaml .Yaml ;
2121
22- import io .diagrid .dapr .DaprContainer ;
23- import io .diagrid .dapr .DaprContainer .Component ;
24- import io .diagrid .dapr .DaprContainer .MetadataEntry ;
22+ import io .dapr .testcontainers .Component ;
23+ import io .dapr .testcontainers .DaprContainer ;
24+ import io .dapr .testcontainers .DaprLogLevel ;
25+ import io .dapr .testcontainers .MetadataEntry ;
2526import io .quarkiverse .dapr .config .DaprDevServiceBuildTimeConfig ;
2627import io .quarkus .deployment .IsNormal ;
2728import io .quarkus .deployment .annotations .BuildStep ;
@@ -126,7 +127,7 @@ private DevServicesResultBuildItem.RunningDevService startDapr(
126127 DaprContainer dapr = new DaprContainer (config .daprdImage ())
127128 .withAppName ("local-dapr-app" )
128129 .withAppPort (QuarkusPorts .http (launchModeTest ))
129- .withDaprLogLevel (DaprContainer . DaprLogLevel .debug )
130+ .withDaprLogLevel (DaprLogLevel .DEBUG )
130131 .withAppChannelAddress ("host.testcontainers.internal" );
131132
132133 Yaml yaml = new Yaml ();
@@ -148,8 +149,8 @@ private DevServicesResultBuildItem.RunningDevService startDapr(
148149
149150 dapr .start ();
150151
151- System .setProperty (DAPR_GRPC_PORT_PROPERTY , Integer .toString (dapr .getGRPCPort ()));
152- System .setProperty (DAPR_HTTP_PORT_PROPERTY , Integer .toString (dapr .getHTTPPort ()));
152+ System .setProperty (DAPR_GRPC_PORT_PROPERTY , Integer .toString (dapr .getGrpcPort ()));
153+ System .setProperty (DAPR_HTTP_PORT_PROPERTY , Integer .toString (dapr .getHttpPort ()));
153154
154155 return new DevServicesResultBuildItem .RunningDevService (FEATURE ,
155156 dapr .getContainerId (),
@@ -203,13 +204,15 @@ private static Optional<Component> tryGenerateComponentFromFile(Yaml yaml, Path
203204 Map <String , Object > map = yaml .load (componentAsString );
204205
205206 Map <String , Object > spec = (Map <String , Object >) map .get ("spec" );
207+ String version = (String ) spec .get ("version" );
208+
206209 String type = (String ) spec .get ("type" );
207210 Map <String , Object > metadata = (Map <String , Object >) map
208211 .get ("metadata" );
209212 String name = (String ) metadata .get ("name" );
210213 List <Map <String , Object >> specMetadata = (List <Map <String , Object >>) spec
211214 .getOrDefault ("metadata" , Collections .emptyMap ());
212- ArrayList <MetadataEntry > metadataEntries = new ArrayList <>();
215+ List <MetadataEntry > metadataEntries = new ArrayList <>();
213216
214217 for (Map <String , Object > specMetadataItem : specMetadata ) {
215218 String metadataItemName = (String ) specMetadataItem .get ("name" );
@@ -219,7 +222,7 @@ private static Optional<Component> tryGenerateComponentFromFile(Yaml yaml, Path
219222 .add (new MetadataEntry (metadataItemName ,
220223 metadataItemValue ));
221224 }
222- return Optional .of (new Component (name , type , metadataEntries ));
225+ return Optional .of (new Component (name , type , version , metadataEntries ));
223226 }
224227
225228 private static Network getNetwork () {
0 commit comments