import java.util.Collection;
import java.util.List;
import java.util.stream.Collectors;
+import org.sonar.api.server.ws.Change;
import org.sonar.api.server.ws.Request;
import org.sonar.api.server.ws.Response;
import org.sonar.api.server.ws.WebService.NewController;
.setHandler(this)
.setInternal(true)
.setResponseExample(getClass().getResource("current-example.json"))
- .setSince("5.2");
+ .setSince("5.2")
+ .setChangelog(new Change("6.5", "showOnboardingTutorial is now returned in the response"));
}
@Override
.setLocal(user.isLocal())
.addAllGroups(groups)
.addAllScmAccounts(user.getScmAccountsAsList())
- .setPermissions(Permissions.newBuilder().addAllGlobal(getGlobalPermissions()).build());
+ .setPermissions(Permissions.newBuilder().addAllGlobal(getGlobalPermissions()).build())
+ .setShowOnboardingTutorial(!user.isOnboarded());
setNullable(emptyToNull(user.getEmail()), builder::setEmail);
setNullable(user.getExternalIdentity(), builder::setExternalIdentity);
setNullable(user.getExternalIdentityProvider(), builder::setExternalProvider);
.setLocal(true)
.setExternalIdentity("obiwan")
.setExternalIdentityProvider("sonarqube")
- .setScmAccounts(newArrayList("obiwan:github", "obiwan:bitbucket")));
+ .setScmAccounts(newArrayList("obiwan:github", "obiwan:bitbucket"))
+ .setOnboarded(false));
userSessionRule.logIn("obiwan.kenobi");
CurrentWsResponse response = call();
assertThat(response)
.extracting(CurrentWsResponse::getIsLoggedIn, CurrentWsResponse::getLogin, CurrentWsResponse::getName, CurrentWsResponse::getEmail, CurrentWsResponse::getLocal,
- CurrentWsResponse::getExternalIdentity, CurrentWsResponse::getExternalProvider, CurrentWsResponse::getScmAccountsList)
+ CurrentWsResponse::getExternalIdentity, CurrentWsResponse::getExternalProvider, CurrentWsResponse::getScmAccountsList, CurrentWsResponse::getShowOnboardingTutorial)
.containsExactly(true, "obiwan.kenobi", "Obiwan Kenobi", "obiwan.kenobi@starwars.com", true, "obiwan", "sonarqube",
- newArrayList("obiwan:github", "obiwan:bitbucket"));
+ newArrayList("obiwan:github", "obiwan:bitbucket"), true);
}
@Test
.setLocal(true)
.setExternalIdentity("obiwan.kenobi")
.setExternalIdentityProvider("sonarqube")
- .setScmAccounts(newArrayList("obiwan:github", "obiwan:bitbucket")));
+ .setScmAccounts(newArrayList("obiwan:github", "obiwan:bitbucket"))
+ .setOnboarded(true));
db.users().insertMember(db.users().insertGroup(newGroupDto().setName("Jedi")), obiwan);
db.users().insertMember(db.users().insertGroup(newGroupDto().setName("Rebel")), obiwan);
assertThat(definition.isInternal()).isTrue();
assertThat(definition.responseExampleAsString()).isNotEmpty();
assertThat(definition.params()).isEmpty();
- assertThat(definition.changelog()).isEmpty();
+ assertThat(definition.changelog()).hasSize(1);
}
private CurrentWsResponse call() {