gordonad / powermock

Automatically exported from code.google.com/p/powermock
0 stars 0 forks source link

createPartialMock no longer works as expected. #33

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Because we're adding a defer constructor in each class this will have
implications when creating partial mocks if there's only one constructor in
the class. I.e.

   tested = createPartialMock(LineSplitDataPackageWriter.class, new String[] {
            ""}, mDataWriterMock);

java.lang.RuntimeException: Several matching constructors found, please
specify the argument parameter types so that PowerMock can determine which
method you're refering to.
Matching constructors in class se.myapp.LineSplitDataPackageWriter were:
se.myapp.service.model.LineSplitDataPackageWriter(
org.powermock.core.classloader.annotations.internal.IndicateReloadClass.class )
se.myapp.service.model.LineSplitDataPackageWriter(
se.myapp.IDataPackageWriter.class )

Original issue reported on code.google.com by johan.ha...@gmail.com on 24 Oct 2008 at 7:26

GoogleCodeExporter commented 9 years ago
This is actually a bug in the Whitebox getConstructor method.

Original comment by johan.ha...@gmail.com on 24 Oct 2008 at 1:09

GoogleCodeExporter commented 9 years ago
createPartialMock now works as expected

Original comment by johan.ha...@gmail.com on 26 Oct 2008 at 7:59