@@ -0,0 +1,2715 @@
+/*%0A * Copyright 2020 NAVER Corp.%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.navercorp.pinpoint.collector.monitor;%0A%0Aimport com.codahale.metrics.MetricRegistry;%0Aimport org.junit.After;%0Aimport org.junit.Before;%0Aimport org.junit.Test;%0A%0Aimport java.util.concurrent.Callable;%0Aimport java.util.concurrent.Future;%0Aimport java.util.concurrent.LinkedBlockingQueue;%0Aimport java.util.concurrent.TimeUnit;%0A%0Aimport static org.mockito.ArgumentMatchers.any;%0Aimport static org.mockito.Mockito.spy;%0Aimport static org.mockito.Mockito.times;%0Aimport static org.mockito.Mockito.verify;%0A%0A/**%0A * @author Woonduk Kang(emeroad)%0A */%0Apublic class MonitoredThreadPoolExecutorTest %7B%0A    private RunnableDecorator runnableDecorator;%0A    private MonitoredThreadPoolExecutor threadPoolExecutor;%0A%0A    @Before%0A    public void setUp() throws Exception %7B%0A        MetricRegistry metricRegistry = new MetricRegistry();%0A        this.runnableDecorator = spy(new MonitoredRunnableDecorator(%22test%22, metricRegistry));%0A        this.threadPoolExecutor = new MonitoredThreadPoolExecutor(1, 1, 1000, TimeUnit.MILLISECONDS, new LinkedBlockingQueue%3C%3E(), runnableDecorator);%0A    %7D%0A%0A    @After%0A    public void tearDown() throws Exception %7B%0A        if (this.threadPoolExecutor != null) %7B%0A            this.threadPoolExecutor.shutdown();%0A        %7D%0A    %7D%0A%0A    @Test%0A    public void submit_runnable() %7B%0A        threadPoolExecutor.submit(new Runnable() %7B%0A            @Override%0A            public void run() %7B%0A%0A            %7D%0A        %7D);%0A%0A        verify(runnableDecorator, times(1)).decorate(any(Runnable.class));%0A    %7D%0A%0A    @Test%0A    public void submit_callable() %7B%0A        threadPoolExecutor.submit(new Callable%3CObject%3E() %7B%0A            @Override%0A            public Object call() throws Exception %7B%0A                return null;%0A            %7D%0A        %7D);%0A%0A        verify(runnableDecorator, times(1)).decorate(any(Runnable.class));%0A    %7D%0A%0A    @Test%0A    public void submit_runnable_futureTask() %7B%0A        Future%3CObject%3E submit = threadPoolExecutor.submit(new Runnable() %7B%0A            @Override%0A            public void run() %7B%0A            %7D%0A        %7D, new Object());%0A%0A        verify(runnableDecorator, times(1)).decorate(any(Runnable.class));%0A    %7D%0A%7D

Add testcase