I want to mock the private constructor of a class with its multiple parameters (with Kotlin):
public final class Foo {
public static class Bla {
public final CustomType1 property1;
public final CustomType2 property2;
private Bla(CustomType1 param1, CustomType2 param2) {
this.property1 = (CustomType1)Objects.requireNonNull(param1);
this.property2 = (CustomType2)Objects.requireNonNull(param2);
}
}
}
Through that I try to mock the properties (property1, property2
) which are otherwise nearly impossible to mock.