use of com.weibo.api.motan.switcher.LocalSwitcherService in project motan by weibocom.
the class LocalSwitcherServiceTest method testProtocolSwitcher.
@Test
public void testProtocolSwitcher() {
String protocolSwitcher = MotanConstants.PROTOCOL_SWITCHER_PREFIX + "motan";
LocalSwitcherService localSwitcherService = new LocalSwitcherService();
localSwitcherService.setValue(protocolSwitcher, false);
Switcher switcher = localSwitcherService.getSwitcher(protocolSwitcher);
Assert.assertNotNull(switcher);
Assert.assertFalse(switcher.isOn());
localSwitcherService.setValue(protocolSwitcher, true);
switcher = localSwitcherService.getSwitcher(protocolSwitcher);
Assert.assertNotNull(switcher);
Assert.assertTrue(switcher.isOn());
}
Aggregations