-
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.
Signed-off-by: salaboy <Salaboy@gmail.com>
- Loading branch information
Showing
8 changed files
with
192 additions
and
131 deletions.
There are no files selected for viewing
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
80 changes: 80 additions & 0 deletions
80
testcontainers-dapr/src/main/java/io/dapr/testcontainers/Component.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,80 @@ | ||
/* | ||
* 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; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
import java.util.Map; | ||
import java.util.Objects; | ||
|
||
/** | ||
* Represents a Dapr component. | ||
*/ | ||
public class Component { | ||
private String name; | ||
private String type; | ||
private String version; | ||
private List<MetadataEntry> metadata; | ||
|
||
/** | ||
* Creates a new component. | ||
* | ||
* @param name Component name. | ||
* @param type Component type. | ||
* @param version Component version. | ||
* @param metadata Metadata. | ||
*/ | ||
public Component(String name, String type, String version, Map<String, Object> metadata) { | ||
this.name = name; | ||
this.type = type; | ||
this.version = version; | ||
this.metadata = new ArrayList<MetadataEntry>(); | ||
if (!metadata.isEmpty()) { | ||
for (Map.Entry<String, Object> entry : metadata.entrySet()) { | ||
this.metadata.add(new MetadataEntry(entry.getKey(), entry.getValue())); | ||
} | ||
} | ||
} | ||
|
||
/** | ||
* Creates a new component. | ||
* | ||
* @param name Component name. | ||
* @param type Component type. | ||
* @param version Component version. | ||
* @param metadataEntries Component metadata entries. | ||
*/ | ||
public Component(String name, String type, String version, List<MetadataEntry> metadataEntries) { | ||
this.name = name; | ||
this.type = type; | ||
this.version = version; | ||
metadata = Objects.requireNonNull(metadataEntries); | ||
} | ||
|
||
public String getName() { | ||
return name; | ||
} | ||
|
||
public String getType() { | ||
return type; | ||
} | ||
|
||
public List<MetadataEntry> getMetadata() { | ||
return metadata; | ||
} | ||
|
||
public String getVersion() { | ||
return version; | ||
} | ||
} |
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
8 changes: 8 additions & 0 deletions
8
testcontainers-dapr/src/main/java/io/dapr/testcontainers/DaprLogLevel.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,8 @@ | ||
package io.dapr.testcontainers; | ||
|
||
public enum DaprLogLevel { | ||
ERROR, | ||
WARN, | ||
INFO, | ||
DEBUG | ||
} |
40 changes: 40 additions & 0 deletions
40
testcontainers-dapr/src/main/java/io/dapr/testcontainers/MetadataEntry.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,40 @@ | ||
/* | ||
* 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; | ||
|
||
public class MetadataEntry { | ||
private String name; | ||
private Object value; | ||
|
||
public MetadataEntry(String name, Object value) { | ||
this.name = name; | ||
this.value = value; | ||
} | ||
|
||
public String getName() { | ||
return name; | ||
} | ||
|
||
public Object getValue() { | ||
return value; | ||
} | ||
|
||
public void setName(String name) { | ||
this.name = name; | ||
} | ||
|
||
public void setValue(Object value) { | ||
this.value = value; | ||
} | ||
} |
52 changes: 52 additions & 0 deletions
52
testcontainers-dapr/src/main/java/io/dapr/testcontainers/Subscription.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,52 @@ | ||
/* | ||
* 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; | ||
|
||
public class Subscription { | ||
private String name; | ||
private String pubsubName; | ||
private String topic; | ||
private String route; | ||
|
||
/** | ||
* Creates a new subscription. | ||
* | ||
* @param name Subscription name. | ||
* @param pubsubName PubSub name. | ||
* @param topic Topic name. | ||
* @param route Route. | ||
*/ | ||
public Subscription(String name, String pubsubName, String topic, String route) { | ||
this.name = name; | ||
this.pubsubName = pubsubName; | ||
this.topic = topic; | ||
this.route = route; | ||
} | ||
|
||
public String getName() { | ||
return name; | ||
} | ||
|
||
public String getPubsubName() { | ||
return pubsubName; | ||
} | ||
|
||
public String getTopic() { | ||
return topic; | ||
} | ||
|
||
public String getRoute() { | ||
return route; | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
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