/*
 * Copyright 2016-2018 shardingsphere.io.
 * <p>
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 * </p>
 */

package io.shardingsphere.orchestration.internal.config.listener;

import io.shardingsphere.orchestration.reg.api.RegistryCenter;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.junit.MockitoJUnitRunner;

@RunWith(MockitoJUnitRunner.class)
public final class ConfigMapOrchestrationListenerTest {
    
    private ConfigMapOrchestrationListener configMapOrchestrationListener;
    
    @Mock
    private RegistryCenter regCenter;
    
    @Before
    public void setUp() {
        configMapOrchestrationListener = new ConfigMapOrchestrationListener("test", regCenter);
    }
    
    @Test
    public void assertWatch() {
    }
}

@@ -743,16 +743,83 @@
 Center;%0A
+import io.shardingsphere.orchestration.reg.listener.EventListener;%0A
 import o
@@ -835,16 +835,16 @@
 Before;%0A
-
 import o
@@ -962,16 +962,154 @@
 unner;%0A%0A
+import static org.mockito.ArgumentMatchers.any;%0Aimport static org.mockito.ArgumentMatchers.eq;%0Aimport static org.mockito.Mockito.verify;%0A%0A
 @RunWith
@@ -1484,16 +1484,16 @@
   @Test%0A
-
     publ
@@ -1512,20 +1512,157 @@
 rtWatch() %7B%0A
+        configMapOrchestrationListener.watch();%0A        verify(regCenter).watch(eq(%22/test/config/configmap%22), any(EventListener.class));%0A
     %7D%0A%7D%0A

add assertWatch()