@@ -0,0 +1,2744 @@
+/*%0A * Copyright 1999-2018 Alibaba Group Holding Ltd.%0A *%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0A * you may not use this file except in compliance with the License.%0A * You may obtain a copy of the License at%0A *%0A *      http://www.apache.org/licenses/LICENSE-2.0%0A *%0A * Unless required by applicable law or agreed to in writing, software%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0A * See the License for the specific language governing permissions and%0A * limitations under the License.%0A */%0A%0Apackage com.alibaba.nacos.config.server.remote;%0A%0Aimport com.alibaba.nacos.config.server.model.event.LocalDataChangeEvent;%0Aimport com.alibaba.nacos.config.server.utils.GroupKey2;%0Aimport com.alibaba.nacos.core.remote.ConnectionManager;%0Aimport com.alibaba.nacos.core.remote.RpcPushService;%0Aimport com.alibaba.nacos.core.remote.control.TpsMonitorManager;%0Aimport org.junit.Before;%0Aimport org.junit.Test;%0Aimport org.junit.runner.RunWith;%0Aimport org.mockito.Mock;%0Aimport org.mockito.junit.MockitoJUnitRunner;%0Aimport org.springframework.test.util.ReflectionTestUtils;%0A%0Aimport java.util.ArrayList;%0Aimport java.util.List;%0A%0A@RunWith(MockitoJUnitRunner.class)%0Apublic class RpcConfigChangeNotifierTest %7B%0A    %0A    private RpcConfigChangeNotifier rpcConfigChangeNotifier;%0A    %0A    @Mock%0A    private TpsMonitorManager tpsMonitorManager;%0A    %0A    @Mock%0A    private ConfigChangeListenContext configChangeListenContext;%0A    %0A    @Mock%0A    private RpcPushService rpcPushService;%0A    %0A    @Mock%0A    private ConnectionManager connectionManager;%0A    %0A    @Before%0A    public void setUp() %7B%0A        rpcConfigChangeNotifier = new RpcConfigChangeNotifier();%0A        %0A        ReflectionTestUtils.setField(rpcConfigChangeNotifier, %22tpsMonitorManager%22, tpsMonitorManager);%0A        ReflectionTestUtils.setField(rpcConfigChangeNotifier, %22configChangeListenContext%22, configChangeListenContext);%0A        ReflectionTestUtils.setField(rpcConfigChangeNotifier, %22rpcPushService%22, rpcPushService);%0A        ReflectionTestUtils.setField(rpcConfigChangeNotifier, %22connectionManager%22, connectionManager);%0A    %7D%0A    %0A    @Test%0A    public void testOnEvent() %7B%0A        final String groupKey = GroupKey2.getKey(%22nacos.internal.tps.control_rule_1%22, %22nacos%22, %22tenant%22);%0A        final String limitGroupKey = GroupKey2.getKey(%22nacos.internal.tps.nacos.internal.connection.limit.rule%22, %22nacos%22, %22tenant%22);%0A        List%3CString%3E betaIps = new ArrayList%3C%3E();%0A        %0A        betaIps.add(%221.1.1.1%22);%0A        rpcConfigChangeNotifier.onEvent(new LocalDataChangeEvent(groupKey, true, betaIps));%0A        rpcConfigChangeNotifier.onEvent(new LocalDataChangeEvent(limitGroupKey));%0A    %7D%0A%7D%0A

add junit test for RpcConfigChangeNotifier (#7884)