Skip to content

Commit

Permalink
maintenance: Add getAllTeamsSUFromRegisterUser, getAllTeamsSUOnly, ge…
Browse files Browse the repository at this point in the history
…tAllTeamsSU, deleteTeam, updateTeam and changePwd for UserTeamsControllerService

Signed-off-by: Khatib Tamal <[email protected]>
  • Loading branch information
khatibtamal authored and muralibasani committed Jul 22, 2024
1 parent b3f93d3 commit 11438e2
Show file tree
Hide file tree
Showing 3 changed files with 600 additions and 49 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import java.util.Random;
import java.util.Set;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
Expand Down Expand Up @@ -267,18 +266,6 @@ private int getTenantId(String tenantName) {
.getKey();
}

String generateRandomWord(int len) {
String chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghi" + "jklmnopqrstuvwxyz";
Random rnd = new Random();
StringBuilder sb = new StringBuilder(len);
for (int i = 0; i < len; i++) {
sb.append(chars.charAt(rnd.nextInt(chars.length())));
}
return sb.toString();
}

// public ResetPasswordInfo resetPassword(String userName,String token, String password) { }

public ResetPasswordInfo resetPasswordGenerateToken(String username) {
log.info("resetPasswordGenerateToken {}", username);
ResetPasswordInfo resetPasswordInfo = new ResetPasswordInfo();
Expand Down
8 changes: 8 additions & 0 deletions core/src/test/java/io/aiven/klaw/UtilMethods.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
import io.aiven.klaw.model.enums.RequestStatus;
import io.aiven.klaw.model.enums.SchemaType;
import io.aiven.klaw.model.requests.AclRequestsModel;
import io.aiven.klaw.model.requests.ChangePasswordRequestModel;
import io.aiven.klaw.model.requests.ConsumerOffsetResetRequestModel;
import io.aiven.klaw.model.requests.EnvModel;
import io.aiven.klaw.model.requests.ProfileModel;
Expand Down Expand Up @@ -625,6 +626,13 @@ public TeamModel getTeamModelMock() {
return team;
}

public ChangePasswordRequestModel getChangePwdRequestModelMock() {
ChangePasswordRequestModel changePwd = new ChangePasswordRequestModel();
changePwd.setPwd("newpassword");
changePwd.setRepeatPwd("newpassword");
return changePwd;
}

public List<TopicRequest> getTopicRequests() {
List<TopicRequest> allTopicReqs = new ArrayList<>();
TopicRequest topicRequest = new TopicRequest();
Expand Down
Loading

0 comments on commit 11438e2

Please sign in to comment.