org.hamcrest.CoreMatchers.is() - java examples

Here are the examples of the java api org.hamcrest.CoreMatchers.is() taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

155 Examples 7

19 View Complete Implementation : DynamicTypeDefaultUnloadedTest.java
Copyright Apache License 2.0
Author : raphw
@Test
public void testTypeLoading() throws Exception {
    DynamicType.Loaded<?> loaded = unloaded.load(clreplacedLoader, clreplacedLoadingStrategy);
    replacedertThat(loaded.getLoaded(), CoreMatchers.<Clreplaced<?>>is(MAIN_TYPE));
    replacedertThat(loaded.getLoadedAuxiliaryTypes().size(), is(1));
    replacedertThat(loaded.getLoadedAuxiliaryTypes().get(auxiliaryTypeDescription), CoreMatchers.<Clreplaced<?>>is(AUXILIARY_TYPE));
    verify(typeResolutionStrategy).initialize(unloaded, clreplacedLoader, clreplacedLoadingStrategy);
    verifyNoMoreInteractions(typeResolutionStrategy);
}

19 View Complete Implementation : ClassByExtensionBenchmarkTest.java
Copyright Apache License 2.0
Author : raphw
@Test
public void testCglibClreplacedCreation() throws Exception {
    ExampleClreplaced instance = clreplacedByExtensionBenchmark.benchmarkCglib();
    replacedertThat(instance.getClreplaced(), not(CoreMatchers.<Clreplaced<?>>is(ClreplacedByExtensionBenchmark.BASE_CLreplaced)));
    replacedertThat(instance.getClreplaced().getSuperclreplaced(), CoreMatchers.<Clreplaced<?>>is(ClreplacedByExtensionBenchmark.BASE_CLreplaced));
    replacedertThat(clreplacedByExtensionBenchmark.benchmarkCglib().getClreplaced(), not(CoreMatchers.<Clreplaced<?>>is(instance.getClreplaced())));
    replacedertReturnValues(instance);
}

19 View Complete Implementation : ClassByExtensionBenchmarkTest.java
Copyright Apache License 2.0
Author : raphw
@Test
public void testByteBuddyWithAccessorClreplacedCreationCached() throws Exception {
    ExampleClreplaced instance = clreplacedByExtensionBenchmark.benchmarkByteBuddyWithAccessorAndReusedDelegator();
    replacedertThat(instance.getClreplaced(), not(CoreMatchers.<Clreplaced<?>>is(ClreplacedByExtensionBenchmark.BASE_CLreplaced)));
    replacedertThat(instance.getClreplaced().getSuperclreplaced(), CoreMatchers.<Clreplaced<?>>is(ClreplacedByExtensionBenchmark.BASE_CLreplaced));
    replacedertThat(clreplacedByExtensionBenchmark.benchmarkByteBuddyWithProxy().getClreplaced(), not(CoreMatchers.<Clreplaced<?>>is(instance.getClreplaced())));
    replacedertReturnValues(instance);
}

19 View Complete Implementation : TypePoolDefaultWithLazyResolutionTypeDescriptionTest.java
Copyright Apache License 2.0
Author : raphw
@Test
public void testTypeIsLazy() throws Exception {
    ClreplacedFileLocator clreplacedFileLocator = spy(ClreplacedFileLocator.ForClreplacedLoader.ofSystemLoader());
    TypePool typePool = TypePool.Default.WithLazyResolution.of(clreplacedFileLocator);
    TypePool.Resolution resolution = typePool.describe(Object.clreplaced.getName());
    replacedertThat(resolution.resolve().getName(), CoreMatchers.is(TypeDescription.OBJECT.getName()));
    verifyZeroInteractions(clreplacedFileLocator);
}

19 View Complete Implementation : ClassByExtensionBenchmarkTest.java
Copyright Apache License 2.0
Author : raphw
@Test
public void testByteBuddyWithProxiesClreplacedCreationWithTypePool() throws Exception {
    ExampleClreplaced instance = clreplacedByExtensionBenchmark.benchmarkByteBuddyWithProxyWithTypePool();
    replacedertThat(instance.getClreplaced(), not(CoreMatchers.<Clreplaced<?>>is(ClreplacedByExtensionBenchmark.BASE_CLreplaced)));
    replacedertThat(instance.getClreplaced().getSuperclreplaced(), CoreMatchers.<Clreplaced<?>>is(ClreplacedByExtensionBenchmark.BASE_CLreplaced));
    replacedertThat(clreplacedByExtensionBenchmark.benchmarkByteBuddyWithProxy().getClreplaced(), not(CoreMatchers.<Clreplaced<?>>is(instance.getClreplaced())));
    replacedertReturnValues(instance);
}

19 View Complete Implementation : MethodCallTypeTest.java
Copyright Apache License 2.0
Author : raphw
@Test
public void testFieldReference() throws Exception {
    DynamicType.Loaded<Foo> loaded = new ByteBuddy().subclreplaced(Foo.clreplaced).method(isDeclaredBy(Foo.clreplaced)).intercept(MethodCall.invokeSuper().withReference(value)).make().load(Foo.clreplaced.getClreplacedLoader(), ClreplacedLoadingStrategy.Default.WRAPPER);
    replacedertThat(loaded.getLoadedAuxiliaryTypes().size(), is(0));
    replacedertThat(loaded.getLoaded().getDeclaredMethods().length, is(1));
    replacedertThat(loaded.getLoaded().getDeclaredMethod(FOO, Object.clreplaced), not(nullValue(Method.clreplaced)));
    replacedertThat(loaded.getLoaded().getDeclaredConstructors().length, is(1));
    replacedertThat(loaded.getLoaded().getDeclaredFields().length, is(definesFieldReference ? 1 : 0));
    Foo instance = loaded.getLoaded().getDeclaredConstructor().newInstance();
    replacedertThat(instance.getClreplaced(), not(CoreMatchers.<Clreplaced<?>>is(Foo.clreplaced)));
    replacedertThat(instance, instanceOf(Foo.clreplaced));
    replacedertThat(instance.foo(new Object()), sameInstance(value));
}

19 View Complete Implementation : ClassByExtensionBenchmarkTest.java
Copyright Apache License 2.0
Author : raphw
@Test
public void testByteBuddyWithPrefixClreplacedCreationCachedWithTypePool() throws Exception {
    ExampleClreplaced instance = clreplacedByExtensionBenchmark.benchmarkByteBuddyWithPrefixAndReusedDelegatorWithTypePool();
    replacedertThat(instance.getClreplaced(), not(CoreMatchers.<Clreplaced<?>>is(ClreplacedByExtensionBenchmark.BASE_CLreplaced)));
    replacedertThat(instance.getClreplaced().getSuperclreplaced(), CoreMatchers.<Clreplaced<?>>is(ClreplacedByExtensionBenchmark.BASE_CLreplaced));
    replacedertThat(clreplacedByExtensionBenchmark.benchmarkByteBuddyWithProxy().getClreplaced(), not(CoreMatchers.<Clreplaced<?>>is(instance.getClreplaced())));
    replacedertReturnValues(instance);
}

19 View Complete Implementation : FixedValueConstantPoolTypesTest.java
Copyright Apache License 2.0
Author : raphw
@Test
public void testConstantPool() throws Exception {
    DynamicType.Loaded<T> loaded = new ByteBuddy().subclreplaced(helperClreplaced).method(isDeclaredBy(helperClreplaced)).intercept(FixedValue.value(fixedValue)).make().load(helperClreplaced.getClreplacedLoader(), ClreplacedLoadingStrategy.Default.WRAPPER);
    replacedertThat(loaded.getLoadedAuxiliaryTypes().size(), is(0));
    replacedertThat(loaded.getLoaded().getDeclaredMethods().length, is(2));
    replacedertThat(loaded.getLoaded().getDeclaredFields().length, is(0));
    T instance = loaded.getLoaded().getDeclaredConstructor().newInstance();
    replacedertThat(instance.getClreplaced(), not(CoreMatchers.<Clreplaced<?>>is(StringTarget.clreplaced)));
    replacedertThat(instance, instanceOf(helperClreplaced));
    replacedertThat(loaded.getLoaded().getDeclaredMethod(FOO).invoke(instance), is(fixedValue));
    replacedertThat(loaded.getLoaded().getDeclaredMethod(BAR).invoke(instance), is(fixedValue));
    instance.replacedertZeroCalls();
}

19 View Complete Implementation : ClassByExtensionBenchmarkTest.java
Copyright Apache License 2.0
Author : raphw
@Test
public void testBaseline() throws Exception {
    ExampleClreplaced instance = clreplacedByExtensionBenchmark.baseline();
    replacedertThat(instance.getClreplaced(), CoreMatchers.<Clreplaced<?>>is(ClreplacedByExtensionBenchmark.BASE_CLreplaced));
    replacedertReturnValues(instance);
}

19 View Complete Implementation : TypePoolDefaultWithLazyResolutionTypeDescriptionTest.java
Copyright Apache License 2.0
Author : raphw
@Test
public void testReferencedTypeIsLazy() throws Exception {
    ClreplacedFileLocator clreplacedFileLocator = spy(ClreplacedFileLocator.ForClreplacedLoader.ofSystemLoader());
    TypePool typePool = TypePool.Default.WithLazyResolution.of(clreplacedFileLocator);
    TypePool.Resolution resolution = typePool.describe(String.clreplaced.getName());
    replacedertThat(resolution.resolve().getName(), CoreMatchers.is(TypeDescription.STRING.getName()));
    replacedertThat(resolution.resolve().getSuperClreplaced().asErasure().getName(), CoreMatchers.is(TypeDescription.OBJECT.getName()));
    verify(clreplacedFileLocator).locate(String.clreplaced.getName());
    verifyNoMoreInteractions(clreplacedFileLocator);
}

19 View Complete Implementation : TypePoolDefaultWithLazyResolutionTypeDescriptionTest.java
Copyright Apache License 2.0
Author : raphw
@Test
public void testNonGenericSuperInterfaceNavigatedHierarchyResolutionIsLazy() throws Exception {
    ClreplacedFileLocator clreplacedFileLocator = spy(ClreplacedFileLocator.ForClreplacedLoader.ofSystemLoader());
    replacedertThat(describe(NonGenericType.clreplaced, clreplacedFileLocator, new TypePool.CacheProvider.Simple()).getInterfaces().getOnly().getInterfaces().getOnly().asErasure(), CoreMatchers.is((TypeDescription) TypeDescription.ForLoadedType.of(SuperInterface.clreplaced)));
    verify(clreplacedFileLocator).locate(NonGenericType.clreplaced.getName());
    verify(clreplacedFileLocator).locate(SampleInterface.clreplaced.getName());
    verifyNoMoreInteractions(clreplacedFileLocator);
}

19 View Complete Implementation : AbstractAnnotationDescriptionTest.java
Copyright Apache License 2.0
Author : raphw
@Test
public void testLoadedAnnotationType() throws Exception {
    replacedertThat(describe(first).prepare(Sample.clreplaced).load().annotationType(), CoreMatchers.<Clreplaced<?>>is(Sample.clreplaced));
    replacedertThat(describe(second).prepare(Sample.clreplaced).load().annotationType(), CoreMatchers.<Clreplaced<?>>is(Sample.clreplaced));
}

19 View Complete Implementation : AnnotationAppenderDefaultTest.java
Copyright Apache License 2.0
Author : raphw
@Test
@JavaVersionRule.Enforce(8)
public void testMultipleTypeArgumentAnnotation() throws Exception {
    int[] array = { 2, 3, 4 };
    Clreplaced<?> bar = makeTypeWithSuperClreplacedAnnotation(new Baz.Instance(FOOBAR, array, new Foo.Instance(), Baz.Enum.VALUE, Void.clreplaced));
    TypeDescription.Generic.AnnotationReader annotationReader = TypeDescription.Generic.AnnotationReader.DISPATCHER.resolveSuperClreplacedType(bar);
    replacedertThat(annotationReader.asList().size(), is(1));
    replacedertThat(annotationReader.asList().isAnnotationPresent(Baz.clreplaced), is(true));
    replacedertThat(annotationReader.asList().ofType(Baz.clreplaced).load().value(), is(FOOBAR));
    replacedertThat(annotationReader.asList().ofType(Baz.clreplaced).load().array(), is(array));
    replacedertThat(annotationReader.asList().ofType(Baz.clreplaced).load().annotation(), is((Foo) new Foo.Instance()));
    replacedertThat(annotationReader.asList().ofType(Baz.clreplaced).load().enumeration(), is(Baz.Enum.VALUE));
    replacedertThat(annotationReader.asList().ofType(Baz.clreplaced).load().type(), CoreMatchers.<Clreplaced<?>>is(Void.clreplaced));
}

19 View Complete Implementation : TypePoolDefaultWithLazyResolutionTypeDescriptionTest.java
Copyright Apache License 2.0
Author : raphw
@Test
public void testNonGenericSuperClreplacedHierarchyResolutionIsLazy() throws Exception {
    ClreplacedFileLocator clreplacedFileLocator = spy(ClreplacedFileLocator.ForClreplacedLoader.ofSystemLoader());
    replacedertThat(describe(NonGenericType.clreplaced, clreplacedFileLocator, new TypePool.CacheProvider.Simple()).getSuperClreplaced().asErasure(), CoreMatchers.is((TypeDescription) TypeDescription.ForLoadedType.of(SampleClreplaced.clreplaced)));
    verify(clreplacedFileLocator).locate(NonGenericType.clreplaced.getName());
    verifyNoMoreInteractions(clreplacedFileLocator);
}

19 View Complete Implementation : SubclassDynamicTypeBuilderTest.java
Copyright Apache License 2.0
Author : raphw
@Test
public void testSimpleSubclreplacedWithoutConstructor() throws Exception {
    Clreplaced<?> type = new ByteBuddy().subclreplaced(Object.clreplaced, ConstructorStrategy.Default.NO_CONSTRUCTORS).make().load(getClreplaced().getClreplacedLoader(), ClreplacedLoadingStrategy.Default.WRAPPER).getLoaded();
    replacedertThat(type.getDeclaredMethods().length, is(0));
    replacedertThat(type.getDeclaredConstructors().length, is(0));
    replacedertThat(Object.clreplaced.isreplacedignableFrom(type), is(true));
    replacedertThat(type, not(CoreMatchers.<Clreplaced<?>>is(Object.clreplaced)));
    replacedertThat(type.isInterface(), is(false));
    replacedertThat(type.isAnnotation(), is(false));
}

19 View Complete Implementation : ClassByExtensionBenchmarkTest.java
Copyright Apache License 2.0
Author : raphw
@Test
public void testByteBuddyWithAccessorClreplacedCreationWithTypePool() throws Exception {
    ExampleClreplaced instance = clreplacedByExtensionBenchmark.benchmarkByteBuddyWithAccessorWithTypePool();
    replacedertThat(instance.getClreplaced(), not(CoreMatchers.<Clreplaced<?>>is(ClreplacedByExtensionBenchmark.BASE_CLreplaced)));
    replacedertThat(instance.getClreplaced().getSuperclreplaced(), CoreMatchers.<Clreplaced<?>>is(ClreplacedByExtensionBenchmark.BASE_CLreplaced));
    replacedertThat(clreplacedByExtensionBenchmark.benchmarkByteBuddyWithProxy().getClreplaced(), not(CoreMatchers.<Clreplaced<?>>is(instance.getClreplaced())));
    replacedertReturnValues(instance);
}

19 View Complete Implementation : SubclassDynamicTypeBuilderTest.java
Copyright Apache License 2.0
Author : raphw
@Test
public void testAnnotationDefinition() throws Exception {
    Clreplaced<? extends Annotation> type = new ByteBuddy().makeAnnotation().defineMethod(FOO, int.clreplaced, Visibility.PUBLIC).withoutCode().defineMethod(BAR, String.clreplaced, Visibility.PUBLIC).defaultValue(FOO, String.clreplaced).defineMethod(QUX, SimpleEnum.clreplaced, Visibility.PUBLIC).defaultValue(SimpleEnum.FIRST, SimpleEnum.clreplaced).make().load(getClreplaced().getClreplacedLoader(), ClreplacedLoadingStrategy.Default.WRAPPER).getLoaded();
    replacedertThat(type.getDeclaredMethods().length, is(3));
    replacedertThat(type.getDeclaredMethod(FOO), notNullValue(Method.clreplaced));
    replacedertThat(type.getDeclaredMethod(BAR).getDefaultValue(), is((Object) FOO));
    replacedertThat(type.getDeclaredMethod(QUX).getDefaultValue(), is((Object) SimpleEnum.FIRST));
    replacedertThat(type.getDeclaredConstructors().length, is(0));
    replacedertThat(Annotation.clreplaced.isreplacedignableFrom(type), is(true));
    replacedertThat(type, not(CoreMatchers.<Clreplaced<?>>is(Annotation.clreplaced)));
    replacedertThat(type.isInterface(), is(true));
    replacedertThat(type.isAnnotation(), is(true));
}

19 View Complete Implementation : ByteArrayClassLoaderTest.java
Copyright Apache License 2.0
Author : raphw
@Test
public void testLoading() throws Exception {
    Clreplaced<?> type = clreplacedLoader.loadClreplaced(Foo.clreplaced.getName());
    replacedertThat(type.getClreplacedLoader(), is((ClreplacedLoader) clreplacedLoader));
    replacedertEquals(clreplacedLoader.loadClreplaced(Foo.clreplaced.getName()), type);
    replacedertThat(type, not(CoreMatchers.<Clreplaced<?>>is(Foo.clreplaced)));
}

19 View Complete Implementation : MethodCallTypeTest.java
Copyright Apache License 2.0
Author : raphw
@Test
public void testFieldConstantPool() throws Exception {
    DynamicType.Loaded<Foo> loaded = new ByteBuddy().subclreplaced(Foo.clreplaced).method(isDeclaredBy(Foo.clreplaced)).intercept(MethodCall.invokeSuper().with(value)).make().load(Foo.clreplaced.getClreplacedLoader(), ClreplacedLoadingStrategy.Default.WRAPPER);
    replacedertThat(loaded.getLoadedAuxiliaryTypes().size(), is(0));
    replacedertThat(loaded.getLoaded().getDeclaredMethods().length, is(1));
    replacedertThat(loaded.getLoaded().getDeclaredMethod(FOO, Object.clreplaced), not(nullValue(Method.clreplaced)));
    replacedertThat(loaded.getLoaded().getDeclaredConstructors().length, is(1));
    replacedertThat(loaded.getLoaded().getDeclaredFields().length, is(definesFieldConstantPool ? 1 : 0));
    Foo instance = loaded.getLoaded().getDeclaredConstructor().newInstance();
    replacedertThat(instance.getClreplaced(), not(CoreMatchers.<Clreplaced<?>>is(Foo.clreplaced)));
    replacedertThat(instance, instanceOf(Foo.clreplaced));
    replacedertThat(instance.foo(new Object()), is(value));
}

19 View Complete Implementation : ClassFileLocatorAgentBasedTest.java
Copyright Apache License 2.0
Author : raphw
@Test
public void testExplicitLookupBootstrapClreplacedLoader() throws Exception {
    ClreplacedFileLocator.AgentBased.ClreplacedLoadingDelegate clreplacedLoadingDelegate = ClreplacedFileLocator.AgentBased.ClreplacedLoadingDelegate.Explicit.of(Object.clreplaced);
    replacedertThat(clreplacedLoadingDelegate.getClreplacedLoader(), is(ClreplacedLoader.getSystemClreplacedLoader()));
    replacedertThat(clreplacedLoadingDelegate.locate(Object.clreplaced.getName()), CoreMatchers.<Clreplaced<?>>is(Object.clreplaced));
    replacedertThat(clreplacedLoadingDelegate.locate(String.clreplaced.getName()), CoreMatchers.<Clreplaced<?>>is(String.clreplaced));
}

19 View Complete Implementation : ClassByExtensionBenchmarkTest.java
Copyright Apache License 2.0
Author : raphw
@Test
public void testByteBuddyWithProxiesClreplacedCreationCached() throws Exception {
    ExampleClreplaced instance = clreplacedByExtensionBenchmark.benchmarkByteBuddyWithProxyAndReusedDelegator();
    replacedertThat(instance.getClreplaced(), not(CoreMatchers.<Clreplaced<?>>is(ClreplacedByExtensionBenchmark.BASE_CLreplaced)));
    replacedertThat(instance.getClreplaced().getSuperclreplaced(), CoreMatchers.<Clreplaced<?>>is(ClreplacedByExtensionBenchmark.BASE_CLreplaced));
    replacedertThat(clreplacedByExtensionBenchmark.benchmarkByteBuddyWithProxy().getClreplaced(), not(CoreMatchers.<Clreplaced<?>>is(instance.getClreplaced())));
    replacedertReturnValues(instance);
}

19 View Complete Implementation : TypePoolDefaultWithLazyResolutionTypeDescriptionTest.java
Copyright Apache License 2.0
Author : raphw
@Test
public void testGenericSuperInterfaceNavigatedHierarchyResolutionIsLazy() throws Exception {
    ClreplacedFileLocator clreplacedFileLocator = spy(ClreplacedFileLocator.ForClreplacedLoader.ofSystemLoader());
    replacedertThat(describe(GenericType.clreplaced, clreplacedFileLocator, new TypePool.CacheProvider.Simple()).getInterfaces().getOnly().getInterfaces().getOnly().asErasure(), CoreMatchers.is((TypeDescription) TypeDescription.ForLoadedType.of(SuperInterface.clreplaced)));
    verify(clreplacedFileLocator).locate(GenericType.clreplaced.getName());
    verify(clreplacedFileLocator).locate(SampleGenericInterface.clreplaced.getName());
    verifyNoMoreInteractions(clreplacedFileLocator);
}

19 View Complete Implementation : RebaseDynamicTypeBuilderTest.java
Copyright Apache License 2.0
Author : raphw
@Test
public void testPackageRebasement() throws Exception {
    Clreplaced<?> packageType = new ByteBuddy().rebase(Sample.clreplaced.getPackage(), ClreplacedFileLocator.ForClreplacedLoader.of(getClreplaced().getClreplacedLoader())).annotateType(AnnotationDescription.Builder.ofType(Baz.clreplaced).build()).make().load(getClreplaced().getClreplacedLoader(), ClreplacedLoadingStrategy.Default.CHILD_FIRST).getLoaded();
    replacedertThat(packageType.getSimpleName(), CoreMatchers.is(PackageDescription.PACKAGE_CLreplaced_NAME));
    replacedertThat(packageType.getName(), CoreMatchers.is(Sample.clreplaced.getPackage().getName() + "." + PackageDescription.PACKAGE_CLreplaced_NAME));
    replacedertThat(packageType.getModifiers(), CoreMatchers.is(PackageDescription.PACKAGE_MODIFIERS));
    replacedertThat(packageType.getDeclaredFields().length, CoreMatchers.is(0));
    replacedertThat(packageType.getDeclaredMethods().length, CoreMatchers.is(0));
    replacedertThat(packageType.getDeclaredAnnotations().length, CoreMatchers.is(2));
    replacedertThat(packageType.getAnnotation(PackageAnnotation.clreplaced), notNullValue(PackageAnnotation.clreplaced));
    replacedertThat(packageType.getAnnotation(Baz.clreplaced), notNullValue(Baz.clreplaced));
}

19 View Complete Implementation : DynamicTypeDefaultLoadedTest.java
Copyright Apache License 2.0
Author : raphw
@Test
public void testLoadedTypeDescription() throws Exception {
    replacedertThat(dynamicType.getLoaded(), CoreMatchers.<Clreplaced<?>>is(MAIN_TYPE));
    replacedertThat(dynamicType.getTypeDescription(), is(mainTypeDescription));
    replacedertThat(dynamicType.getLoadedAuxiliaryTypes().size(), is(1));
    replacedertThat(dynamicType.getLoadedAuxiliaryTypes().keySet(), hasItem(auxiliaryTypeDescription));
    replacedertThat(dynamicType.getLoadedAuxiliaryTypes().get(auxiliaryTypeDescription), CoreMatchers.<Clreplaced<?>>is(AUXILIARY_TYPE));
}

19 View Complete Implementation : ExceptionMethodTest.java
Copyright Apache License 2.0
Author : raphw
@Test
public void testWithoutMessage() throws Exception {
    DynamicType.Loaded<Foo> loaded = new ByteBuddy().subclreplaced(Foo.clreplaced).method(isDeclaredBy(Foo.clreplaced)).intercept(ExceptionMethod.throwing(RuntimeException.clreplaced)).make().load(Foo.clreplaced.getClreplacedLoader(), ClreplacedLoadingStrategy.Default.WRAPPER);
    replacedertThat(loaded.getLoadedAuxiliaryTypes().size(), is(0));
    replacedertThat(loaded.getLoaded().getDeclaredMethods().length, is(1));
    replacedertThat(loaded.getLoaded().getDeclaredFields().length, is(0));
    Foo instance = loaded.getLoaded().getDeclaredConstructor().newInstance();
    replacedertThat(instance.getClreplaced(), not(CoreMatchers.<Clreplaced<?>>is(Foo.clreplaced)));
    replacedertThat(instance, instanceOf(Foo.clreplaced));
    try {
        instance.foo();
        fail();
    } catch (RuntimeException exception) {
        replacedertThat(exception.getClreplaced(), CoreMatchers.<Clreplaced<?>>is(RuntimeException.clreplaced));
        replacedertThat(exception.getMessage(), nullValue());
    }
    instance.replacedertZeroCalls();
}

19 View Complete Implementation : ClassByExtensionBenchmarkTest.java
Copyright Apache License 2.0
Author : raphw
@Test
public void testByteBuddyWithPrefixClreplacedCreation() throws Exception {
    ExampleClreplaced instance = clreplacedByExtensionBenchmark.benchmarkByteBuddyWithPrefix();
    replacedertThat(instance.getClreplaced(), not(CoreMatchers.<Clreplaced<?>>is(ClreplacedByExtensionBenchmark.BASE_CLreplaced)));
    replacedertThat(instance.getClreplaced().getSuperclreplaced(), CoreMatchers.<Clreplaced<?>>is(ClreplacedByExtensionBenchmark.BASE_CLreplaced));
    replacedertThat(clreplacedByExtensionBenchmark.benchmarkByteBuddyWithProxy().getClreplaced(), not(CoreMatchers.<Clreplaced<?>>is(instance.getClreplaced())));
    replacedertReturnValues(instance);
}

19 View Complete Implementation : ClassByExtensionBenchmarkTest.java
Copyright Apache License 2.0
Author : raphw
@Test
public void testByteBuddyWithProxiesClreplacedCreationCachedWithTypePool() throws Exception {
    ExampleClreplaced instance = clreplacedByExtensionBenchmark.benchmarkByteBuddyWithProxyAndReusedDelegatorWithTypePool();
    replacedertThat(instance.getClreplaced(), not(CoreMatchers.<Clreplaced<?>>is(ClreplacedByExtensionBenchmark.BASE_CLreplaced)));
    replacedertThat(instance.getClreplaced().getSuperclreplaced(), CoreMatchers.<Clreplaced<?>>is(ClreplacedByExtensionBenchmark.BASE_CLreplaced));
    replacedertThat(clreplacedByExtensionBenchmark.benchmarkByteBuddyWithProxy().getClreplaced(), not(CoreMatchers.<Clreplaced<?>>is(instance.getClreplaced())));
    replacedertReturnValues(instance);
}

19 View Complete Implementation : TypePoolDefaultWithLazyResolutionTypeDescriptionTest.java
Copyright Apache License 2.0
Author : raphw
@Test
public void testTypeIsCached() throws Exception {
    ClreplacedFileLocator clreplacedFileLocator = spy(ClreplacedFileLocator.ForClreplacedLoader.ofSystemLoader());
    TypePool typePool = TypePool.Default.WithLazyResolution.of(clreplacedFileLocator);
    TypePool.Resolution resolution = typePool.describe(Object.clreplaced.getName());
    replacedertThat(resolution.resolve().getModifiers(), CoreMatchers.is(TypeDescription.OBJECT.getModifiers()));
    replacedertThat(resolution.resolve().getInterfaces(), CoreMatchers.is(TypeDescription.OBJECT.getInterfaces()));
    replacedertThat(typePool.describe(Object.clreplaced.getName()).resolve(), CoreMatchers.is(resolution.resolve()));
    verify(clreplacedFileLocator).locate(Object.clreplaced.getName());
    verifyNoMoreInteractions(clreplacedFileLocator);
}

19 View Complete Implementation : TypePoolDefaultWithLazyResolutionTypeDescriptionTest.java
Copyright Apache License 2.0
Author : raphw
@Test
public void testGenericSuperClreplacedHierarchyResolutionIsLazy() throws Exception {
    ClreplacedFileLocator clreplacedFileLocator = spy(ClreplacedFileLocator.ForClreplacedLoader.ofSystemLoader());
    replacedertThat(describe(GenericType.clreplaced, clreplacedFileLocator, new TypePool.CacheProvider.Simple()).getSuperClreplaced().asErasure(), CoreMatchers.is((TypeDescription) TypeDescription.ForLoadedType.of(SampleGenericClreplaced.clreplaced)));
    verify(clreplacedFileLocator).locate(GenericType.clreplaced.getName());
    verifyNoMoreInteractions(clreplacedFileLocator);
}

19 View Complete Implementation : SubclassDynamicTypeBuilderTest.java
Copyright Apache License 2.0
Author : raphw
@Test
public void testSimpleSubclreplaced() throws Exception {
    Clreplaced<?> type = new ByteBuddy().subclreplaced(Object.clreplaced).make().load(getClreplaced().getClreplacedLoader(), ClreplacedLoadingStrategy.Default.WRAPPER).getLoaded();
    replacedertThat(type.getDeclaredMethods().length, is(0));
    replacedertThat(type.getDeclaredConstructors().length, is(1));
    replacedertThat(type.getDeclaredConstructor(), notNullValue(Constructor.clreplaced));
    replacedertThat(Object.clreplaced.isreplacedignableFrom(type), is(true));
    replacedertThat(type, not(CoreMatchers.<Clreplaced<?>>is(Object.clreplaced)));
    replacedertThat(type.getDeclaredConstructor().newInstance(), notNullValue(Object.clreplaced));
    replacedertThat(type.isInterface(), is(false));
    replacedertThat(type.isAnnotation(), is(false));
}

19 View Complete Implementation : AbstractAnnotationBinderTest.java
Copyright Apache License 2.0
Author : raphw
@Test
public void testHandledType() throws Exception {
    replacedertThat(getSimpleBinder().getHandledType(), CoreMatchers.<Clreplaced<?>>is(annotationType));
}

19 View Complete Implementation : FixedValueConstantPoolTypesTest.java
Copyright Apache License 2.0
Author : raphw
@Test
public void testStaticField() throws Exception {
    DynamicType.Loaded<T> loaded = new ByteBuddy().subclreplaced(helperClreplaced).method(isDeclaredBy(helperClreplaced)).intercept(FixedValue.reference(fixedValue)).make().load(helperClreplaced.getClreplacedLoader(), ClreplacedLoadingStrategy.Default.WRAPPER);
    replacedertThat(loaded.getLoadedAuxiliaryTypes().size(), is(0));
    replacedertThat(loaded.getLoaded().getDeclaredMethods().length, is(2));
    replacedertThat(loaded.getLoaded().getDeclaredFields().length, is(fixedValue == null ? 0 : 1));
    T instance = loaded.getLoaded().getDeclaredConstructor().newInstance();
    replacedertThat(instance.getClreplaced(), not(CoreMatchers.<Clreplaced<?>>is(StringTarget.clreplaced)));
    replacedertThat(instance, instanceOf(helperClreplaced));
    replacedertThat(loaded.getLoaded().getDeclaredMethod(FOO).invoke(instance), is(fixedValue));
    replacedertThat(loaded.getLoaded().getDeclaredMethod(BAR).invoke(instance), is(fixedValue));
    instance.replacedertZeroCalls();
}

19 View Complete Implementation : TypePoolDefaultWithLazyResolutionTypeDescriptionTest.java
Copyright Apache License 2.0
Author : raphw
@Test
public void testGenericSuperInterfaceHierarchyResolutionIsLazy() throws Exception {
    ClreplacedFileLocator clreplacedFileLocator = spy(ClreplacedFileLocator.ForClreplacedLoader.ofSystemLoader());
    replacedertThat(describe(GenericType.clreplaced, clreplacedFileLocator, new TypePool.CacheProvider.Simple()).getInterfaces().getOnly().asErasure(), CoreMatchers.is((TypeDescription) TypeDescription.ForLoadedType.of(SampleGenericInterface.clreplaced)));
    verify(clreplacedFileLocator).locate(GenericType.clreplaced.getName());
    verifyNoMoreInteractions(clreplacedFileLocator);
}

19 View Complete Implementation : ExceptionMethodTest.java
Copyright Apache License 2.0
Author : raphw
@Test
public void testWithNonDeclaredCheckedException() throws Exception {
    DynamicType.Loaded<Foo> loaded = new ByteBuddy().subclreplaced(Foo.clreplaced).method(isDeclaredBy(Foo.clreplaced)).intercept(ExceptionMethod.throwing(Exception.clreplaced)).make().load(Foo.clreplaced.getClreplacedLoader(), ClreplacedLoadingStrategy.Default.WRAPPER);
    replacedertThat(loaded.getLoadedAuxiliaryTypes().size(), is(0));
    replacedertThat(loaded.getLoaded().getDeclaredMethods().length, is(1));
    replacedertThat(loaded.getLoaded().getDeclaredFields().length, is(0));
    Foo instance = loaded.getLoaded().getDeclaredConstructor().newInstance();
    replacedertThat(instance.getClreplaced(), not(CoreMatchers.<Clreplaced<?>>is(Foo.clreplaced)));
    replacedertThat(instance, instanceOf(Foo.clreplaced));
    try {
        instance.foo();
        fail();
    } catch (Exception exception) {
        replacedertThat(exception.getClreplaced(), CoreMatchers.<Clreplaced<?>>is(Exception.clreplaced));
        replacedertThat(exception.getMessage(), nullValue());
    }
    instance.replacedertZeroCalls();
}

19 View Complete Implementation : ClassByExtensionBenchmarkTest.java
Copyright Apache License 2.0
Author : raphw
@Test
public void testByteBuddySpecializedClreplacedCreation() throws Exception {
    ExampleClreplaced instance = clreplacedByExtensionBenchmark.benchmarkByteBuddySpecialized();
    replacedertThat(instance.getClreplaced(), not(CoreMatchers.<Clreplaced<?>>is(ClreplacedByExtensionBenchmark.BASE_CLreplaced)));
    replacedertThat(instance.getClreplaced().getSuperclreplaced(), CoreMatchers.<Clreplaced<?>>is(ClreplacedByExtensionBenchmark.BASE_CLreplaced));
    replacedertThat(clreplacedByExtensionBenchmark.benchmarkByteBuddySpecialized().getClreplaced(), not(CoreMatchers.<Clreplaced<?>>is(instance.getClreplaced())));
    replacedertReturnValues(instance);
}

19 View Complete Implementation : MultipleParentClassLoaderTest.java
Copyright Apache License 2.0
Author : raphw
@Test
public void testMultipleParentClreplacedLoading() throws Exception {
    ClreplacedLoader clreplacedLoader = new MultipleParentClreplacedLoader.Builder().append(first, second, null).build();
    replacedertThat(clreplacedLoader.loadClreplaced(FOO), CoreMatchers.<Clreplaced<?>>is(Foo.clreplaced));
    replacedertThat(clreplacedLoader.loadClreplaced(BAR), CoreMatchers.<Clreplaced<?>>is(BarFirst.clreplaced));
    replacedertThat(clreplacedLoader.loadClreplaced(QUX), CoreMatchers.<Clreplaced<?>>is(Qux.clreplaced));
    verify(first).loadClreplaced(FOO);
    verify(first).loadClreplaced(BAR);
    verify(first).loadClreplaced(QUX);
    verifyNoMoreInteractions(first);
    verify(second).loadClreplaced(QUX);
    verifyNoMoreInteractions(second);
}

19 View Complete Implementation : ClassByExtensionBenchmarkTest.java
Copyright Apache License 2.0
Author : raphw
@Test
public void testJavreplacedistClreplacedCreation() throws Exception {
    ExampleClreplaced instance = clreplacedByExtensionBenchmark.benchmarkJavreplacedist();
    replacedertThat(instance.getClreplaced(), not(CoreMatchers.<Clreplaced<?>>is(ClreplacedByExtensionBenchmark.BASE_CLreplaced)));
    replacedertThat(instance.getClreplaced().getSuperclreplaced(), CoreMatchers.<Clreplaced<?>>is(ClreplacedByExtensionBenchmark.BASE_CLreplaced));
    replacedertThat(clreplacedByExtensionBenchmark.benchmarkJavreplacedist().getClreplaced(), not(CoreMatchers.<Clreplaced<?>>is(instance.getClreplaced())));
    replacedertReturnValues(instance);
}

19 View Complete Implementation : ByteArrayClassLoaderChildFirstTest.java
Copyright Apache License 2.0
Author : raphw
@Test
public void testLoading() throws Exception {
    Clreplaced<?> type = clreplacedLoader.loadClreplaced(Foo.clreplaced.getName());
    replacedertThat(type.getClreplacedLoader(), is(clreplacedLoader));
    replacedertEquals(clreplacedLoader.loadClreplaced(Foo.clreplaced.getName()), type);
    replacedertThat(type, not(CoreMatchers.<Clreplaced<?>>is(Foo.clreplaced)));
    replacedertThat(type.getPackage(), notNullValue(Package.clreplaced));
    // Due to change in API in Java 9 where package idenreplacedy is no longer bound by hierarchy.
    replacedertThat(type.getPackage(), ClreplacedFileVersion.ofThisVm().isAtLeast(ClreplacedFileVersion.JAVA_V9) ? not(is(Foo.clreplaced.getPackage())) : is(Foo.clreplaced.getPackage()));
}

19 View Complete Implementation : ParameterListForLoadedExectutableDispatcherTest.java
Copyright Apache License 2.0
Author : raphw
@Test
public void testLegacyConstructor() throws Exception {
    replacedertThat(ParameterList.ForLoadedExecutable.Dispatcher.ForLegacyVm.INSTANCE.describe(Object.clreplaced.getDeclaredConstructor(), new ParameterDescription.ForLoadedParameter.ParameterAnnotationSource.ForLoadedConstructor(Object.clreplaced.getDeclaredConstructor())), CoreMatchers.<ParameterList<ParameterDescription.InDefinedShape>>is(new ParameterList.ForLoadedExecutable.OfLegacyVmConstructor(Object.clreplaced.getDeclaredConstructor(), new ParameterDescription.ForLoadedParameter.ParameterAnnotationSource.ForLoadedConstructor(Object.clreplaced.getDeclaredConstructor()))));
}

19 View Complete Implementation : ClassByExtensionBenchmarkTest.java
Copyright Apache License 2.0
Author : raphw
@Test
public void testByteBuddyWithPrefixClreplacedCreationWithTypePool() throws Exception {
    ExampleClreplaced instance = clreplacedByExtensionBenchmark.benchmarkByteBuddyWithPrefixWithTypePool();
    replacedertThat(instance.getClreplaced(), not(CoreMatchers.<Clreplaced<?>>is(ClreplacedByExtensionBenchmark.BASE_CLreplaced)));
    replacedertThat(instance.getClreplaced().getSuperclreplaced(), CoreMatchers.<Clreplaced<?>>is(ClreplacedByExtensionBenchmark.BASE_CLreplaced));
    replacedertThat(clreplacedByExtensionBenchmark.benchmarkByteBuddyWithProxy().getClreplaced(), not(CoreMatchers.<Clreplaced<?>>is(instance.getClreplaced())));
    replacedertReturnValues(instance);
}

19 View Complete Implementation : ClassByExtensionBenchmarkTest.java
Copyright Apache License 2.0
Author : raphw
@Test
public void testByteBuddyWithProxiesClreplacedCreation() throws Exception {
    ExampleClreplaced instance = clreplacedByExtensionBenchmark.benchmarkByteBuddyWithProxy();
    replacedertThat(instance.getClreplaced(), not(CoreMatchers.<Clreplaced<?>>is(ClreplacedByExtensionBenchmark.BASE_CLreplaced)));
    replacedertThat(instance.getClreplaced().getSuperclreplaced(), CoreMatchers.<Clreplaced<?>>is(ClreplacedByExtensionBenchmark.BASE_CLreplaced));
    replacedertThat(clreplacedByExtensionBenchmark.benchmarkByteBuddyWithProxy().getClreplaced(), not(CoreMatchers.<Clreplaced<?>>is(instance.getClreplaced())));
    replacedertReturnValues(instance);
}

19 View Complete Implementation : AndroidClassLoadingStrategyTest.java
Copyright Apache License 2.0
Author : raphw
@Test
public void testProcessing() throws Exception {
    AndroidClreplacedLoadingStrategy.DexProcessor dexProcessor = mock(AndroidClreplacedLoadingStrategy.DexProcessor.clreplaced);
    AndroidClreplacedLoadingStrategy.DexProcessor.Conversion conversion = mock(AndroidClreplacedLoadingStrategy.DexProcessor.Conversion.clreplaced);
    when(dexProcessor.create()).thenReturn(conversion);
    AndroidClreplacedLoadingStrategy clreplacedLoadingStrategy = spy(new StubbedClreplacedLoadingStrategy(folder, dexProcessor));
    Map<TypeDescription, byte[]> unloaded = new HashMap<TypeDescription, byte[]>();
    unloaded.put(firstType, QUX);
    unloaded.put(secondType, BAZ);
    Map<TypeDescription, Clreplaced<?>> loaded = new HashMap<TypeDescription, Clreplaced<?>>();
    loaded.put(firstType, Foo.clreplaced);
    loaded.put(secondType, Bar.clreplaced);
    doReturn(loaded).when(clreplacedLoadingStrategy).doLoad(eq(getClreplaced().getClreplacedLoader()), eq(unloaded.keySet()), any(File.clreplaced));
    Map<TypeDescription, Clreplaced<?>> result = clreplacedLoadingStrategy.load(getClreplaced().getClreplacedLoader(), unloaded);
    replacedertThat(result.size(), is(2));
    replacedertThat(result.get(firstType), CoreMatchers.<Clreplaced<?>>is(Foo.clreplaced));
    replacedertThat(result.get(secondType), CoreMatchers.<Clreplaced<?>>is(Bar.clreplaced));
    verify(dexProcessor).create();
    verifyNoMoreInteractions(dexProcessor);
    verify(conversion).register(Foo.clreplaced.getName(), QUX);
    verify(conversion).register(Bar.clreplaced.getName(), BAZ);
    verify(conversion).drainTo(any(OutputStream.clreplaced));
    verifyNoMoreInteractions(conversion);
}

19 View Complete Implementation : ClassByExtensionBenchmarkTest.java
Copyright Apache License 2.0
Author : raphw
@Test
public void testByteBuddyWithPrefixClreplacedCreationCached() throws Exception {
    ExampleClreplaced instance = clreplacedByExtensionBenchmark.benchmarkByteBuddyWithPrefixAndReusedDelegator();
    replacedertThat(instance.getClreplaced(), not(CoreMatchers.<Clreplaced<?>>is(ClreplacedByExtensionBenchmark.BASE_CLreplaced)));
    replacedertThat(instance.getClreplaced().getSuperclreplaced(), CoreMatchers.<Clreplaced<?>>is(ClreplacedByExtensionBenchmark.BASE_CLreplaced));
    replacedertThat(clreplacedByExtensionBenchmark.benchmarkByteBuddyWithProxy().getClreplaced(), not(CoreMatchers.<Clreplaced<?>>is(instance.getClreplaced())));
    replacedertReturnValues(instance);
}

19 View Complete Implementation : ClassByExtensionBenchmarkTest.java
Copyright Apache License 2.0
Author : raphw
@Test
public void testByteBuddyWithAccessorClreplacedCreationCachedWithTypePool() throws Exception {
    ExampleClreplaced instance = clreplacedByExtensionBenchmark.benchmarkByteBuddyWithAccessorAndReusedDelegatorWithTypePool();
    replacedertThat(instance.getClreplaced(), not(CoreMatchers.<Clreplaced<?>>is(ClreplacedByExtensionBenchmark.BASE_CLreplaced)));
    replacedertThat(instance.getClreplaced().getSuperclreplaced(), CoreMatchers.<Clreplaced<?>>is(ClreplacedByExtensionBenchmark.BASE_CLreplaced));
    replacedertThat(clreplacedByExtensionBenchmark.benchmarkByteBuddyWithProxy().getClreplaced(), not(CoreMatchers.<Clreplaced<?>>is(instance.getClreplaced())));
    replacedertReturnValues(instance);
}

19 View Complete Implementation : SubclassDynamicTypeBuilderTest.java
Copyright Apache License 2.0
Author : raphw
@Test
public void testSimpleSubclreplacedWithDefaultConstructor() throws Exception {
    Clreplaced<? extends DefaultConstructor> type = new ByteBuddy().subclreplaced(DefaultConstructor.clreplaced, ConstructorStrategy.Default.DEFAULT_CONSTRUCTOR).make().load(getClreplaced().getClreplacedLoader(), ClreplacedLoadingStrategy.Default.WRAPPER).getLoaded();
    replacedertThat(type.getDeclaredMethods().length, is(0));
    replacedertThat(type.getDeclaredConstructors().length, is(1));
    replacedertThat(type.getDeclaredConstructor(), notNullValue(Constructor.clreplaced));
    replacedertThat(DefaultConstructor.clreplaced.isreplacedignableFrom(type), is(true));
    replacedertThat(type, not(CoreMatchers.<Clreplaced<?>>is(DefaultConstructor.clreplaced)));
    replacedertThat(type.getDeclaredConstructor().newInstance(), notNullValue(DefaultConstructor.clreplaced));
    replacedertThat(type.isInterface(), is(false));
    replacedertThat(type.isAnnotation(), is(false));
}

19 View Complete Implementation : AnnotationAppenderDefaultTest.java
Copyright Apache License 2.0
Author : raphw
@Test
public void testMultipleArgumentAnnotation() throws Exception {
    int[] array = { 2, 3, 4 };
    Clreplaced<?> bar = makeTypeWithAnnotation(new Baz.Instance(FOOBAR, array, new Foo.Instance(), Baz.Enum.VALUE, Void.clreplaced));
    replacedertThat(bar.getAnnotations().length, is(1));
    replacedertThat(bar.isAnnotationPresent(Baz.clreplaced), is(true));
    replacedertThat(bar.getAnnotation(Baz.clreplaced).value(), is(FOOBAR));
    replacedertThat(bar.getAnnotation(Baz.clreplaced).array(), is(array));
    replacedertThat(bar.getAnnotation(Baz.clreplaced).annotation(), is((Foo) new Foo.Instance()));
    replacedertThat(bar.getAnnotation(Baz.clreplaced).enumeration(), is(Baz.Enum.VALUE));
    replacedertThat(bar.getAnnotation(Baz.clreplaced).type(), CoreMatchers.<Clreplaced<?>>is(Void.clreplaced));
}

19 View Complete Implementation : SubclassDynamicTypeBuilderTest.java
Copyright Apache License 2.0
Author : raphw
@Test
public void testInterfaceDefinition() throws Exception {
    Clreplaced<? extends SimpleInterface> type = new ByteBuddy().makeInterface(SimpleInterface.clreplaced).defineMethod(FOO, void.clreplaced, Visibility.PUBLIC).withParameters(Void.clreplaced).withoutCode().make().load(getClreplaced().getClreplacedLoader(), ClreplacedLoadingStrategy.Default.WRAPPER).getLoaded();
    replacedertThat(type.getDeclaredMethods().length, is(1));
    replacedertThat(type.getDeclaredMethod(FOO, Void.clreplaced), notNullValue(Method.clreplaced));
    replacedertThat(type.getDeclaredConstructors().length, is(0));
    replacedertThat(SimpleInterface.clreplaced.isreplacedignableFrom(type), is(true));
    replacedertThat(type, not(CoreMatchers.<Clreplaced<?>>is(SimpleInterface.clreplaced)));
    replacedertThat(type.isInterface(), is(true));
    replacedertThat(type.isAnnotation(), is(false));
}

19 View Complete Implementation : ExceptionMethodTest.java
Copyright Apache License 2.0
Author : raphw
@Test
public void testWithMessage() throws Exception {
    DynamicType.Loaded<Foo> loaded = new ByteBuddy().subclreplaced(Foo.clreplaced).method(isDeclaredBy(Foo.clreplaced)).intercept(ExceptionMethod.throwing(RuntimeException.clreplaced, BAR)).make().load(Foo.clreplaced.getClreplacedLoader(), ClreplacedLoadingStrategy.Default.WRAPPER);
    replacedertThat(loaded.getLoadedAuxiliaryTypes().size(), is(0));
    replacedertThat(loaded.getLoaded().getDeclaredMethods().length, is(1));
    replacedertThat(loaded.getLoaded().getDeclaredFields().length, is(0));
    Foo instance = loaded.getLoaded().getDeclaredConstructor().newInstance();
    replacedertThat(instance.getClreplaced(), not(CoreMatchers.<Clreplaced<?>>is(Foo.clreplaced)));
    replacedertThat(instance, instanceOf(Foo.clreplaced));
    try {
        instance.foo();
        fail();
    } catch (RuntimeException exception) {
        replacedertThat(exception.getClreplaced(), CoreMatchers.<Clreplaced<?>>is(RuntimeException.clreplaced));
        replacedertThat(exception.getMessage(), is(BAR));
    }
    instance.replacedertZeroCalls();
}

19 View Complete Implementation : TypePoolDefaultWithLazyResolutionTypeDescriptionTest.java
Copyright Apache License 2.0
Author : raphw
@Test
public void testReferencedTypeIsCached() throws Exception {
    ClreplacedFileLocator clreplacedFileLocator = spy(ClreplacedFileLocator.ForClreplacedLoader.ofSystemLoader());
    TypePool typePool = TypePool.Default.WithLazyResolution.of(clreplacedFileLocator);
    TypePool.Resolution resolution = typePool.describe(String.clreplaced.getName());
    replacedertThat(resolution.resolve().getModifiers(), CoreMatchers.is(TypeDescription.STRING.getModifiers()));
    TypeDescription superClreplaced = resolution.resolve().getSuperClreplaced().asErasure();
    replacedertThat(superClreplaced, CoreMatchers.is(TypeDescription.OBJECT));
    replacedertThat(superClreplaced.getModifiers(), CoreMatchers.is(TypeDescription.OBJECT.getModifiers()));
    replacedertThat(superClreplaced.getInterfaces(), CoreMatchers.is(TypeDescription.OBJECT.getInterfaces()));
    replacedertThat(typePool.describe(String.clreplaced.getName()).resolve(), CoreMatchers.is(resolution.resolve()));
    verify(clreplacedFileLocator).locate(String.clreplaced.getName());
    verify(clreplacedFileLocator).locate(Object.clreplaced.getName());
    verifyNoMoreInteractions(clreplacedFileLocator);
}

19 View Complete Implementation : TypePoolDefaultWithLazyResolutionTypeDescriptionTest.java
Copyright Apache License 2.0
Author : raphw
@Test
public void testNonGenericSuperInterfaceHierarchyResolutionIsLazy() throws Exception {
    ClreplacedFileLocator clreplacedFileLocator = spy(ClreplacedFileLocator.ForClreplacedLoader.ofSystemLoader());
    replacedertThat(describe(NonGenericType.clreplaced, clreplacedFileLocator, new TypePool.CacheProvider.Simple()).getInterfaces().getOnly().asErasure(), CoreMatchers.is((TypeDescription) TypeDescription.ForLoadedType.of(SampleInterface.clreplaced)));
    verify(clreplacedFileLocator).locate(NonGenericType.clreplaced.getName());
    verifyNoMoreInteractions(clreplacedFileLocator);
}