// Path: instrument-starters/opentracing-spring-cloud-core/src/main/java/io/opentracing/contrib/spring/cloud/async/instrument/TracedAsyncConfigurer.java
// public class TracedAsyncConfigurer extends AsyncConfigurerSupport {
// 
//   private final Tracer tracer;
//   private final AsyncConfigurer delegate;
// 
//   public TracedAsyncConfigurer(Tracer tracer, AsyncConfigurer delegate) {
//     this.tracer = tracer;
//     this.delegate = delegate;
//   }
// 
//   @Override
//   public Executor getAsyncExecutor() {
//     return new TracedExecutor(this.delegate.getAsyncExecutor(), this.tracer);
//   }
// 
//   @Override
//   public AsyncUncaughtExceptionHandler getAsyncUncaughtExceptionHandler() {
//     return delegate.getAsyncUncaughtExceptionHandler();
//   }
// }


import static org.assertj.core.api.BDDAssertions.then;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
import io.opentracing.Tracer;
import io.opentracing.contrib.spring.cloud.async.instrument.TracedAsyncConfigurer;
import io.opentracing.mock.MockTracer;
import org.junit.Test;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.scheduling.annotation.AsyncConfigurer;
/**
 * Copyright 2017-2019 The OpenTracing Authors
 *
 * 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 io.opentracing.contrib.spring.cloud.async;



/**
 * @author kameshs
 */
public class CustomAsyncConfigurerAutoConfigurationTest {

  @Test
  public void should_return_bean_when_its_not_async_configurer() {
    CustomAsyncConfigurerAutoConfiguration configuration = new CustomAsyncConfigurerAutoConfiguration();
    Object bean = configuration.postProcessAfterInitialization(new Object(), "someBean");
// Path: instrument-starters/opentracing-spring-cloud-core/src/main/java/io/opentracing/contrib/spring/cloud/async/instrument/TracedAsyncConfigurer.java
// public class TracedAsyncConfigurer extends AsyncConfigurerSupport {
// 
//   private final Tracer tracer;
//   private final AsyncConfigurer delegate;
// 
//   public TracedAsyncConfigurer(Tracer tracer, AsyncConfigurer delegate) {
//     this.tracer = tracer;
//     this.delegate = delegate;
//   }
// 
//   @Override
//   public Executor getAsyncExecutor() {
//     return new TracedExecutor(this.delegate.getAsyncExecutor(), this.tracer);
//   }
// 
//   @Override
//   public AsyncUncaughtExceptionHandler getAsyncUncaughtExceptionHandler() {
//     return delegate.getAsyncUncaughtExceptionHandler();
//   }
// }


// Path: instrument-starters/opentracing-spring-cloud-core/src/test/java/io/opentracing/contrib/spring/cloud/async/CustomAsyncConfigurerAutoConfigurationTest.java
import static org.assertj.core.api.BDDAssertions.then;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
import io.opentracing.Tracer;
import io.opentracing.contrib.spring.cloud.async.instrument.TracedAsyncConfigurer;
import io.opentracing.mock.MockTracer;
import org.junit.Test;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.scheduling.annotation.AsyncConfigurer;

/**
 * Copyright 2017-2019 The OpenTracing Authors
 *
 * 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 io.opentracing.contrib.spring.cloud.async;



/**
 * @author kameshs
 */
public class CustomAsyncConfigurerAutoConfigurationTest {

  @Test
  public void should_return_bean_when_its_not_async_configurer() {
    CustomAsyncConfigurerAutoConfiguration configuration = new CustomAsyncConfigurerAutoConfiguration();
    Object bean = configuration.postProcessAfterInitialization(new Object(), "someBean");
    then(bean).isNotInstanceOf(TracedAsyncConfigurer.class);