Added example used in wiki in tests
This commit is contained in:
parent
0121657b4b
commit
8a4a70673c
|
@ -204,4 +204,32 @@ public class ResourceRegistryClientTestWikiExamples extends ContextTest {
|
|||
logger.debug("{}", list);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void jsonQueryExample1() throws ResourceRegistryException, Exception{
|
||||
String jsonQuery = "{\n"
|
||||
+ " \"@class\": \"EService\",\n"
|
||||
+ " \"consistsOf\": [\n"
|
||||
+ " {\n"
|
||||
+ " \"@class\": \"IsIdentifiedBy\",\n"
|
||||
+ " \"target\": {\n"
|
||||
+ " \"@class\": \"SoftwareFacet\",\n"
|
||||
+ " \"group\": \"DataTransfer\",\n"
|
||||
+ " \"name\": \"data-transfer-service\"\n"
|
||||
+ " }\n"
|
||||
+ " }\n"
|
||||
+ " {\n"
|
||||
+ " \"@class\": \"ConsistsOf\",\n"
|
||||
+ " \"target\": {\n"
|
||||
+ " \"@class\": \"StateFacet\",\n"
|
||||
+ " \"value\": \"down\"\n"
|
||||
+ " }\n"
|
||||
+ " },\n"
|
||||
+ " \n"
|
||||
+ " ]\n"
|
||||
+ "}";
|
||||
|
||||
String jsonString = resourceRegistryClient.jsonQuery(jsonQuery);
|
||||
List<EService> list = ElementMapper.unmarshalList(EService.class, jsonString);
|
||||
logger.debug("{}", list);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue