Java-SDK userType/Profile on UserBuilder missing?

I want to use your Java-SDK to create new users with a specific Profile/userType, which has specific profile attributes to them.
I have searched for an answer in your Wiki and in the READMEs, but did not find a clue how to create a new user with a certain userType to be able to fill in the attributes.
I would be glad for an answer!

Hi there. You should be able to use setType in UserBuilder. Check out our API docs here for the Java SDK:

Yeah… After 5h of upgrading the okta-sdk-java (before standard okta-spring-sdk) and okta-spring-boot to version 2.0.1 (before 1.5.1) there was a possibility while:

User user = UserBuilder.instance().setType(type.getId()).buildAndCreate();

would work for me, otherwise if you create the user first then set the profile

User user = UserBuilder.instance(){blahblah}.buildAndCreate();

, there will appear the error code casually:

“errorCode”: “E0000003”,
“errorSummary”: “The request body was not well-formed {blahblah}”,
“errorLink”: “E0000003”,
“errorId”: “oaeqgZFFjUXS2qcagR7-PIBYA”,

So, if you would implement the setType() method in 1.5.X version, this would be fine.