Search in sources :

Example 1 with PriorityPropertyFactory

use of org.apache.servicecomb.config.priority.PriorityPropertyFactory 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"));
}
Also used : PriorityPropertyFactory(org.apache.servicecomb.config.priority.PriorityPropertyFactory) DynamicPropertyView(org.apache.servicecomb.inspector.internal.model.DynamicPropertyView) PriorityPropertyView(org.apache.servicecomb.inspector.internal.model.PriorityPropertyView) Test(org.junit.Test)

Example 2 with PriorityPropertyFactory

use of org.apache.servicecomb.config.priority.PriorityPropertyFactory in project incubator-servicecomb-java-chassis by apache.

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"));
}
Also used : PriorityPropertyFactory(org.apache.servicecomb.config.priority.PriorityPropertyFactory) DynamicPropertyView(org.apache.servicecomb.inspector.internal.model.DynamicPropertyView) PriorityPropertyView(org.apache.servicecomb.inspector.internal.model.PriorityPropertyView) Test(org.junit.Test)

Aggregations

PriorityPropertyFactory (org.apache.servicecomb.config.priority.PriorityPropertyFactory)2 DynamicPropertyView (org.apache.servicecomb.inspector.internal.model.DynamicPropertyView)2 PriorityPropertyView (org.apache.servicecomb.inspector.internal.model.PriorityPropertyView)2 Test (org.junit.Test)2