-
Notifications
You must be signed in to change notification settings - Fork 207
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding Dapr configuration support to Testcontainers (#1148)
* Adding Dapr configuration support to Testcontainers Signed-off-by: Artur Ciocanu <ciocanu@adobe.com> * Fixing a small styling issue Signed-off-by: Artur Ciocanu <ciocanu@adobe.com> * Fixing Dapr Testcontainer Component test Signed-off-by: Artur Ciocanu <ciocanu@adobe.com> * Fix Dapr Testcontainer Subscription test Signed-off-by: Artur Ciocanu <ciocanu@adobe.com> * Fix Darp Testcontainer Configuration test Signed-off-by: Artur Ciocanu <ciocanu@adobe.com> * Fix expected YAML structure Signed-off-by: Artur Ciocanu <ciocanu@adobe.com> * Fix Configuration test Signed-off-by: Artur Ciocanu <ciocanu@adobe.com> * Fix Dapr Component test Signed-off-by: Artur Ciocanu <ciocanu@adobe.com> --------- Signed-off-by: Artur Ciocanu <ciocanu@adobe.com> Co-authored-by: Artur Ciocanu <ciocanu@adobe.com>
- Loading branch information
1 parent
7dcab0b
commit b1196d3
Showing
15 changed files
with
549 additions
and
167 deletions.
There are no files selected for viewing
45 changes: 45 additions & 0 deletions
45
testcontainers-dapr/src/main/java/io/dapr/testcontainers/Configuration.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/* | ||
* Copyright 2024 The Dapr Authors | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
package io.dapr.testcontainers; | ||
|
||
/** | ||
* Represents a Dapr component. | ||
*/ | ||
public class Configuration { | ||
private final String name; | ||
private final TracingConfigurationSettings tracing; | ||
|
||
//@TODO: add httpPipeline | ||
//@TODO: add secrets | ||
//@TODO: add components | ||
//@TODO: add accessControl | ||
|
||
/** | ||
* Creates a new configuration. | ||
* @param name Configuration name. | ||
* @param tracing TracingConfigParameters tracing configuration parameters. | ||
*/ | ||
public Configuration(String name, TracingConfigurationSettings tracing) { | ||
this.name = name; | ||
this.tracing = tracing; | ||
} | ||
|
||
public String getName() { | ||
return name; | ||
} | ||
|
||
public TracingConfigurationSettings getTracing() { | ||
return tracing; | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
testcontainers-dapr/src/main/java/io/dapr/testcontainers/ConfigurationSettings.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
package io.dapr.testcontainers; | ||
|
||
// This is a marker interface, so we could get | ||
// a list of all the configuration settings implementations | ||
public interface ConfigurationSettings { | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
...ontainers-dapr/src/main/java/io/dapr/testcontainers/OtelTracingConfigurationSettings.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package io.dapr.testcontainers; | ||
|
||
/** | ||
* Configuration settings for Otel tracing. | ||
*/ | ||
public class OtelTracingConfigurationSettings implements ConfigurationSettings { | ||
private final String endpointAddress; | ||
private final Boolean isSecure; | ||
private final String protocol; | ||
|
||
/** | ||
* Creates a new configuration. | ||
* @param endpointAddress tracing endpoint address | ||
* @param isSecure if the endpoint is secure | ||
* @param protocol tracing protocol | ||
*/ | ||
public OtelTracingConfigurationSettings(String endpointAddress, Boolean isSecure, String protocol) { | ||
this.endpointAddress = endpointAddress; | ||
this.isSecure = isSecure; | ||
this.protocol = protocol; | ||
} | ||
|
||
public String getEndpointAddress() { | ||
return endpointAddress; | ||
} | ||
|
||
public Boolean getSecure() { | ||
return isSecure; | ||
} | ||
|
||
public String getProtocol() { | ||
return protocol; | ||
} | ||
} |
Oops, something went wrong.