@Override
    public void notify(final ConfigChangeEvent value) {
        if (value.getEventType().equals(EventType.DELETE)) {
            ruleSetting = null;
            grouping.setEndpointGroupingRule(new QuickUriGroupingRule());
        } else {
            ruleSetting = value.getNewValue();
            grouping.setEndpointGroupingRule(new EndpointGroupingRuleReader(new StringReader(ruleSetting)).read());
        }
    }
@Test
    public void testWatcher() throws FileNotFoundException {
        EndpointNameGrouping endpointNameGrouping = new EndpointNameGrouping();

        EndpointNameGroupingRuleWatcher watcher = new EndpointNameGroupingRuleWatcher(
            new ModuleProvider() {
                @Override
                public String name() {
                    return "test";
                }

                @Override
                public Class<? extends ModuleDefine> module() {
                    return CoreModule.class;
                }

                @Override
                public ConfigCreator newConfigCreator() {
                    return null;
                }

                @Override
                public void prepare() throws ServiceNotProvidedException, ModuleStartException {

                }

                @Override
                public void start() throws ServiceNotProvidedException, ModuleStartException {

                }

                @Override
                public void notifyAfterCompleted() throws ServiceNotProvidedException, ModuleStartException {

                }

                @Override
                public String[] requiredModules() {
                    return new String[0];
                }
            }, endpointNameGrouping);
        Assertions.assertEquals("/prod/{var}", endpointNameGrouping.format("serviceA", "/prod/123")._1());

        watcher.notify(new ConfigChangeWatcher.ConfigChangeEvent(
                "grouping:\n" +
                "  # Endpoint of the service would follow the following rules\n" +
                "  - service-name: serviceA\n" +
                "    rules:\n" +
                "      - /prod/{var}\n" +
                "      - /prod/{var}/info\n"
            , ConfigChangeWatcher.EventType.MODIFY
        ));

        Assertions.assertEquals("/prod/{var}/info", endpointNameGrouping.format("serviceA", "/prod/123/info")._1());

        watcher.notify(new ConfigChangeWatcher.ConfigChangeEvent("", ConfigChangeWatcher.EventType.DELETE));
        Assertions.assertEquals("/prod/123", endpointNameGrouping.format("serviceA", "/prod/123")._1());
    }