You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@brooklyn.apache.org by he...@apache.org on 2022/12/13 01:56:53 UTC
[brooklyn-server] 04/04: allow AbstractBlueprintTest to let mgmt context be decorated with custom types
This is an automated email from the ASF dual-hosted git repository.
heneveld pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/brooklyn-server.git
commit c79b72ae412bc676220011978ca21aa1163a80c6
Author: Alex Heneveld <al...@cloudsoft.io>
AuthorDate: Tue Dec 13 01:33:57 2022 +0000
allow AbstractBlueprintTest to let mgmt context be decorated with custom types
---
.../brooklyn/launcher/blueprints/AbstractBlueprintTest.java | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/launcher/src/test/java/org/apache/brooklyn/launcher/blueprints/AbstractBlueprintTest.java b/launcher/src/test/java/org/apache/brooklyn/launcher/blueprints/AbstractBlueprintTest.java
index fda84338cd..c5bf51cf04 100644
--- a/launcher/src/test/java/org/apache/brooklyn/launcher/blueprints/AbstractBlueprintTest.java
+++ b/launcher/src/test/java/org/apache/brooklyn/launcher/blueprints/AbstractBlueprintTest.java
@@ -319,7 +319,7 @@ public abstract class AbstractBlueprintTest {
newMgmt)
.setConfigKeyAtManagmentContext();
- return newMgmt;
+ return decorateManagementContext(newMgmt);
}
// -----
@@ -332,12 +332,16 @@ public abstract class AbstractBlueprintTest {
/** @return A started management context -- with or without rebind depending on the value of {@link #isRebindEnabled()} */
protected ManagementContext createOrigManagementContext() {
if (isRebindEnabled()) {
- return createBuilderForRebindingManagementContext().buildStarted();
+ return decorateManagementContext(createBuilderForRebindingManagementContext().buildStarted());
} else {
- return LocalManagementContextForTests.newInstance();
+ return decorateManagementContext(LocalManagementContextForTests.newInstance());
}
}
+ protected ManagementContext decorateManagementContext(ManagementContext mgmt) {
+ return mgmt;
+ }
+
protected Application createAndStartApplication(String input) throws Exception {
Application app = this.createApplicationUnstarted(input);
app.invoke(Startable.START, MutableMap.of()).get();