Hi everyone. I'm trying to use kotlin fixtures to ...
# server
o
Hi everyone. I'm trying to use kotlin fixtures to create a builder object:
Copy code
package 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:
Copy code
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?