Github user aledsage commented on a diff in the pull request:
https://github.com/apache/incubator-brooklyn/pull/509#discussion_r24342145
--- Diff:
usage/rest-server/src/test/java/brooklyn/rest/resources/ServerResourceTest.java
---
@@ -97,5 +99,15 @@ public void testShutdown() throws Exception {
assertFalse(getManagementContext().isRunning());
}});
}
+
+ @Test
+ void testGetConfig() throws Exception {
+
((BrooklynProperties)getManagementContext().getConfig()).addFrom(ImmutableMap.of("foo.bar.baz",
"quux"));
--- End diff --
Better to do
`((ManagementContextInternal)getManagementContext()).getBrooklynProperties()`.
It effectively does the same thing, but we know we can always cast to the
"internal" version (whereas casting the return value of a getter isn't
guaranteed moving forwards).
Also, you can use `.put("foo.bar.baz", "quux")` rather than needing the map.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---