use of com.alibaba.csp.sentinel.slotchain.SlotChainBuilder in project Sentinel by alibaba.
the class SpiLoaderTest method testLoadFirstInstanceOrDefault.
@Test
public void testLoadFirstInstanceOrDefault() {
SlotChainBuilder slotChainBuilder = SpiLoader.of(SlotChainBuilder.class).loadFirstInstanceOrDefault();
assertNotNull(slotChainBuilder);
assertTrue(slotChainBuilder instanceof DefaultSlotChainBuilder);
}
use of com.alibaba.csp.sentinel.slotchain.SlotChainBuilder in project Sentinel by alibaba.
the class SpiLoaderTest method testLoadFirstInstance.
@Test
public void testLoadFirstInstance() {
ProcessorSlot slot = SpiLoader.of(ProcessorSlot.class).loadFirstInstance();
assertNotNull(slot);
assertTrue(slot instanceof NodeSelectorSlot);
SlotChainBuilder chainBuilder = SpiLoader.of(SlotChainBuilder.class).loadFirstInstance();
assertNotNull(chainBuilder);
assertTrue(chainBuilder instanceof SlotChainBuilder);
InitFunc initFunc = SpiLoader.of(InitFunc.class).loadFirstInstance();
assertNotNull(initFunc);
assertTrue(initFunc instanceof MetricCallbackInit);
}
use of com.alibaba.csp.sentinel.slotchain.SlotChainBuilder in project Sentinel by alibaba.
the class SpiLoaderTest method testLoadDefaultInstance.
@Test
public void testLoadDefaultInstance() {
SlotChainBuilder slotChainBuilder = SpiLoader.of(SlotChainBuilder.class).loadDefaultInstance();
assertNotNull(slotChainBuilder);
assertTrue(slotChainBuilder instanceof DefaultSlotChainBuilder);
}
Aggregations