Java tutorial
/** * Copyright 2014 NAVER Corp. * 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. */ package com.navercorp.pinpoint.plugin.okhttp; import com.navercorp.pinpoint.bootstrap.plugin.test.Expectations; import com.navercorp.pinpoint.bootstrap.plugin.test.PluginTestVerifier; import com.navercorp.pinpoint.bootstrap.plugin.test.PluginTestVerifierHolder; import com.navercorp.pinpoint.test.plugin.Dependency; import com.navercorp.pinpoint.test.plugin.PinpointPluginTestSuite; import com.squareup.okhttp.*; import org.junit.Test; import org.junit.runner.RunWith; import java.lang.reflect.Method; /** * @author jaehong.kim */ @RunWith(PinpointPluginTestSuite.class) @Dependency({ "com.squareup.okhttp:okhttp:[2.0.0],[2.1.0],[2.2.0],[2.3.0]" }) public class OkHttpClientBackwardCompatibilityIT { @Test public void execute() throws Exception { Request request = new Request.Builder().url("http://google.com").build(); OkHttpClient client = new OkHttpClient(); Response response = client.newCall(request).execute(); PluginTestVerifier verifier = PluginTestVerifierHolder.getInstance(); verifier.printCache(); Method callMethod = Call.class.getDeclaredMethod("execute"); verifier.verifyTrace(Expectations.event("OK_HTTP_CLIENT_INTERNAL", callMethod)); } }