Omer Katz
06/12/2023, 5:16 PMpackage bla.testdoubles.stubs
import bla.testdoubles.TreehouseTestFixture
import bla.testdoubles.fakes.FakeRequest
import bla.ServiceRequest
typealias Builder = ServiceRequest.ServiceRequestBuilder<FakeRequest>
val FakeRequestFixture = MyCustomTestFixture<FakeRequest> {
}
val ServiceRequestFixture = MyCustomTestFixture<Builder> {
property<Builder, FakeRequest>(Builder::request) {
FakeRequestFixture
}
property<Builder, String>("fullRequestURI") {
// TODO: use Faker
"123"
}
}
The compiler says that Builder::request
is a private member and cannot be accessed. I'm trying to refer to the automatically generated setter and not the private request variable that the Builder declared.
This is the error:
Cannot access 'request': it is private in 'ServiceRequestBuilder'
The generated setter uses the setRequest
method and that should be public.
What am I doing wrong here?