use of org.apache.servicecomb.inspector.internal.model.PriorityPropertyView in project java-chassis by ServiceComb.
the class InspectorImpl method createPriorityPropertyView.
private PriorityPropertyView createPriorityPropertyView(PriorityProperty<?> priorityProperty) {
PriorityPropertyView view = new PriorityPropertyView();
view.setDynamicProperties(new ArrayList<>());
for (DynamicProperty property : priorityProperty.getProperties()) {
view.getDynamicProperties().add(createDynamicPropertyView(property));
}
view.setDefaultValue(String.valueOf(priorityProperty.getDefaultValue()));
view.setValue(String.valueOf(priorityProperty.getValue()));
return view;
}
use of org.apache.servicecomb.inspector.internal.model.PriorityPropertyView in project java-chassis by ServiceComb.
the class TestInspectorImpl method priorityProperties.
@Test
public void priorityProperties() {
PriorityPropertyFactory propertyFactory = new PriorityPropertyFactory();
inspector.setPropertyFactory(propertyFactory);
propertyFactory.getOrCreate(int.class, 0, 0, "high", "low");
List<PriorityPropertyView> views = inspector.priorityProperties();
Assert.assertEquals(1, views.size());
Assert.assertThat(views.get(0).getDynamicProperties().stream().map(DynamicPropertyView::getKey).collect(Collectors.toList()), Matchers.contains("high", "low"));
}
Aggregations