DefaultProviderBootstrap extends ProviderBootstrap<T> { protected boolean inList(String includeMethods, String excludeMethods, String methodName) { if (!StringUtils.ALL.equals(includeMethods)) { if (!inMethodConfigs(includeMethods, methodName)) { return false; } } if (inMethodConfigs(excludeMethods, methodName)) { return false; } return true; } protected  DefaultProviderBootstrap(ProviderConfig<T> providerConfig); @Override void export(); @Override void unExport();  }
@Test public void includeListTest() { ProviderConfig providerConfig = new ProviderConfig(); DefaultProviderBootstrap defaultProviderBootstra = new DefaultProviderBootstrap(providerConfig); boolean result = defaultProviderBootstra.inList("hello1", "hello2", "hello1"); Assert.assertTrue(result); }
@Test public void includeMultiListTest() { ProviderConfig providerConfig = new ProviderConfig(); DefaultProviderBootstrap defaultProviderBootstra = new DefaultProviderBootstrap(providerConfig); boolean result = defaultProviderBootstra.inList("hello1,hello3", "hello1,hello2,hello4", "hello1"); Assert.assertTrue(!result); }
@Test public void excludeListTest() { ProviderConfig providerConfig = new ProviderConfig(); DefaultProviderBootstrap defaultProviderBootstra = new DefaultProviderBootstrap(providerConfig); boolean result = defaultProviderBootstra.inList("hello1", "hello2", "hello2"); Assert.assertTrue(!result); }
@Test public void notInListTest() { ProviderConfig providerConfig = new ProviderConfig(); DefaultProviderBootstrap defaultProviderBootstra = new DefaultProviderBootstrap(providerConfig); boolean result = defaultProviderBootstra.inList("hello1", "hello2", "hello3"); Assert.assertTrue(!result); }
@Test public void PrefixIncludeListTest() { ProviderConfig providerConfig = new ProviderConfig(); DefaultProviderBootstrap defaultProviderBootstra = new DefaultProviderBootstrap(providerConfig); boolean result = defaultProviderBootstra.inList("hello1", "hello1", "hello"); Assert.assertTrue(!result); }