use of com.ctrip.xpipe.redis.console.model.SentinelModel in project x-pipe by ctripcorp.
the class SentinelUpdateControllerTest method testConvert2SentinelTbl.
@Test
public void testConvert2SentinelTbl() throws Exception {
when(dcService.find(anyString())).thenReturn(new DcTbl().setId(1));
SentinelModel sentinelModel = new SentinelModel().setDcName("JQ").setDesc("test").setSentinels(Arrays.asList(new HostPort("127.0.0.1", 6379), new HostPort("127.0.0.1", 6380), new HostPort("127.0.0.1", 6381)));
SetinelTbl setinelTbl = controller.convert2SentinelTbl(sentinelModel);
Assert.assertEquals(1, setinelTbl.getDcId());
Assert.assertEquals("test", setinelTbl.getSetinelDescription());
Assert.assertEquals("127.0.0.1:6379,127.0.0.1:6380,127.0.0.1:6381", setinelTbl.getSetinelAddress());
}
Aggregations