@Override public SELF isNotInstanceOf(Class<?> type) { return super.isNotInstanceOf(type); }
@Override public SELF isNotInstanceOf(Class<?> type) { return super.isNotInstanceOf(type); }
@Test public void testDontCreateDiffForShouldUpdate() { final List<Annotation> annotations = new ArrayList<>(); Annotation annotation = new Annotation() { @Override public Class<? extends Annotation> annotationType() { return ShouldUpdate.class; } }; annotations.add(annotation); MethodParamModel methodParamModel = MethodParamModelFactory.create( mDiffTypeSpecWrappingInt, "testParam", annotations, new ArrayList<AnnotationSpec>(), ImmutableList.<Class<? extends Annotation>>of(), false, null); assertThat(methodParamModel).isNotInstanceOf(RenderDataDiffModel.class); }
@Test public void testFindTiViewInterfaceInComplexStructure() throws Exception { final LoggingInterceptor interceptor = new LoggingInterceptor(); final TiView interceptView = interceptor.intercept(new MyActivity()); assertThat(interceptView) .isInstanceOf(TiView.class) .isInstanceOf(MyView.class) .isNotInstanceOf(MyActivity.class) .isNotInstanceOf(BaseActivity.class); }
@Test public void getRandomInstance_should_default_to_normal_random_if_desired_algorithm_is_not_available() { Random randomGenerator = TraceAndSpanIdGenerator.getRandomInstance("QuantumDoohickey"); assertThat(randomGenerator).isNotNull(); assertThat(randomGenerator).isNotInstanceOf(SecureRandom.class); }
@Test public void whenMemcachedCacheManagerBeanAlreadyInContextThenMemcachedWithNonCustomConfigurationLoaded() { loadContext(CacheWithMemcachedCacheManagerConfiguration.class, "memcached.cache.expiration=3600", "memcached.cache.prefix=custom:prefix", "memcached.cache.namespace=custom_namespace"); MemcachedCacheManager memcachedCacheManager = this.applicationContext.getBean(MemcachedCacheManager.class); assertThat(memcachedCacheManager) .as("Auto-configured disposable instance should not be loaded in context") .isNotInstanceOf(DisposableMemcachedCacheManager.class); assertMemcachedCacheManager(memcachedCacheManager, Default.EXPIRATION, null, Default.PREFIX, Default.NAMESPACE); }
@Test void testScopedDataSourceIsNotDecorated() { ApplicationContextRunner contextRunner = this.contextRunner.withUserConfiguration(TestScopedDataSourceConfiguration.class); contextRunner.run(context -> { assertThat(context).getBeanNames(DataSource.class).containsOnly("dataSource", "scopedTarget.dataSource"); assertThat(context).getBean("dataSource").isInstanceOf(DecoratedDataSource.class); assertThat(context).getBean("scopedTarget.dataSource").isNotInstanceOf(DecoratedDataSource.class); }); }