Github user geomacy commented on a diff in the pull request:
https://github.com/apache/brooklyn-server/pull/1004#discussion_r221763463
--- Diff:
camp/camp-brooklyn/src/test/java/org/apache/brooklyn/camp/brooklyn/ConfigParametersYamlTest.java
---
@@ -1194,6 +1199,66 @@ public String toString() {
}
}
+@Test
+public void testConfigParameterPinnedOrder() throws Exception {
+addCatalogItems(
+"brooklyn.catalog:",
+" version: " + TEST_VERSION,
+" itemType: entity",
+" items:",
+"- id: entity-without-keys",
+" item:",
+"type:
"+TestEntityWithPinnedConfig.class.getName(),
+"- id: entity-with-keys-redeclared",
+" item:",
+"type:
"+TestEntityWithPinnedConfig.class.getName(),
+"brooklyn.parameters:",
+" - name: pinned2",
+" - name: unpinned2");
+
+for (String symbolicName : ImmutableList.of("entity-without-keys",
"entity-with-keys-redeclared")) {
+// Mimicking the code in REST api's TypeResource, for getting
the config keys
+RegisteredType item =
mgmt().getTypeRegistry().get(symbolicName, TEST_VERSION);
+AbstractBrooklynObjectSpec spec =
mgmt().getTypeRegistry().createSpec(item, null, null);
+List> params = spec.getParameters();
+SpecParameter pinned1 = Iterables.find(params, (p) ->
p.getConfigKey().getName().equals("pinned2"));
--- End diff --
variable should really be called `pinned2` to match the name
---