[ https://issues.apache.org/jira/browse/BROOKLYN-602?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16634663#comment-16634663 ]
ASF GitHub Bot commented on BROOKLYN-602: ----------------------------------------- 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<SpecParameter<?>> 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 > priority of parameters should not be reset by extending a config key in yaml > ---------------------------------------------------------------------------- > > Key: BROOKLYN-602 > URL: https://issues.apache.org/jira/browse/BROOKLYN-602 > Project: Brooklyn > Issue Type: Bug > Affects Versions: 1.0.0-M1 > Reporter: Aled Sage > Priority: Minor > > Currently, if you write a yaml entity that extends an entity to add > constraints / descriptions to the config keys, it re-orders the keys: the > keys declared in the yaml appear at the top. > The order should be preserved. -- This message was sent by Atlassian JIRA (v7.6.3#76005)