Search in sources :

Example 1 with SentinelUsageModel

use of com.ctrip.xpipe.redis.console.model.SentinelUsageModel in project x-pipe by ctripcorp.

the class SentinelUpdateControllerTest method testJsonShow.

@Test
public void testJsonShow() {
    SentinelUsageModel usageModel1 = new SentinelUsageModel("SHAJQ", 2).addSentinelUsage("127.0.0.1:6379,127.0.0.1:6380", 100).addSentinelUsage("192.168.0.1:6379,192.168.0.1:6380", 200);
    SentinelUsageModel usageModel2 = new SentinelUsageModel("SHAOY", 2).addSentinelUsage("127.0.0.2:6381,127.0.0.1:6382", 150).addSentinelUsage("192.168.0.2:6381,192.168.0.1:6382", 150);
    Map<String, SentinelUsageModel> map = Maps.newHashMapWithExpectedSize(2);
    map.put("SHAJQ", usageModel1);
    map.put("SHAOY", usageModel2);
    JsonCodec jsonTool = new JsonCodec(true, true);
    System.out.println(jsonTool.encode(map));
}
Also used : JsonCodec(com.ctrip.xpipe.codec.JsonCodec) SentinelUsageModel(com.ctrip.xpipe.redis.console.model.SentinelUsageModel) Matchers.anyString(org.mockito.Matchers.anyString) Test(org.junit.Test)

Aggregations

JsonCodec (com.ctrip.xpipe.codec.JsonCodec)1 SentinelUsageModel (com.ctrip.xpipe.redis.console.model.SentinelUsageModel)1 Test (org.junit.Test)1 Matchers.anyString (org.mockito.Matchers.anyString)1