Fix configuration property name when group is empty
See gh-5335
This commit is contained in:
committed by
Stephane Nicoll
parent
497790571f
commit
79cd01eb7a
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2012-2015 the original author or authors.
|
||||
* Copyright 2012-2016 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -52,6 +52,17 @@ public class JsonReaderTests extends AbstractConfigurationMetadataTests {
|
||||
readFor("invalid");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void emptyGroupName() throws IOException {
|
||||
RawConfigurationMetadata rawMetadata = readFor("emptygroup");
|
||||
List<ConfigurationMetadataItem> items = rawMetadata.getItems();
|
||||
assertEquals(1, items.size());
|
||||
|
||||
ConfigurationMetadataItem item = items.get(0);
|
||||
assertProperty(item, "name", "name", String.class, null);
|
||||
|
||||
}
|
||||
|
||||
@Test
|
||||
public void simpleMetadata() throws IOException {
|
||||
RawConfigurationMetadata rawMetadata = readFor("foo");
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
{
|
||||
"groups": [
|
||||
{
|
||||
"name": "",
|
||||
"type": "org.acme.Foo",
|
||||
"sourceType": "org.acme.config.FooApp",
|
||||
"sourceMethod": "foo()",
|
||||
"description": "This is Foo."
|
||||
}
|
||||
],
|
||||
"properties": [
|
||||
{
|
||||
"name": "name",
|
||||
"type": "java.lang.String",
|
||||
"sourceType": "org.acme.Foo"
|
||||
}
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user