Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue #LR-203 debug: Keycloak Service debug #1218

Merged
merged 8 commits into from
Aug 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -145,15 +145,11 @@ public String activateUser(Map<String, Object> request, RequestContext context)
private void makeUserActiveOrInactive(String userId, boolean status, RequestContext context) {
try {
String fedUserId = getFederatedUserId(userId);
logger.info(context, "makeUserActiveOrInactive: fedration id formed: " + fedUserId);
logger.info(context, "makeUserActiveOrInactive: federation id formed: " + fedUserId);
validateUserId(fedUserId);
logger.info(context, "makeUserActiveOrInactive: user validated: ");
Keycloak keycloak = KeyCloakConnectionProvider.getConnection();
logger.info(
context,
"makeUserActiveOrInactive: keycloak: "
+ keycloak.toString()
+ " || "
+ keycloak.serverInfo());

logger.info(
context,
"makeUserActiveOrInactive: keycloak: "
Expand All @@ -168,7 +164,11 @@ private void makeUserActiveOrInactive(String userId, boolean status, RequestCont
ur.setEnabled(status);
resource.update(ur);
} catch (Exception e) {
e.printStackTrace();
logger.info(
"makeUserActiveOrInactive:error occurred while blocking or unblocking user: "
+ e.getCause()
+ " || "
+ e.getMessage());
logger.error(
context,
"makeUserActiveOrInactive:error occurred while blocking or unblocking user: ",
Expand Down
3 changes: 3 additions & 0 deletions service/src/test/java/org/sunbird/util/user/UserUtilTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,10 @@
import java.util.stream.Collectors;
import java.util.stream.Stream;
import org.junit.Assert;
import org.junit.FixMethodOrder;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.MethodSorters;
import org.mockito.Mockito;
import org.powermock.api.mockito.PowerMockito;
import org.powermock.core.classloader.annotations.PowerMockIgnore;
Expand Down Expand Up @@ -56,6 +58,7 @@
"jdk.internal.reflect.*",
"javax.crypto.*"
})
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
public class UserUtilTest {
private static Response response;
public static CassandraOperationImpl cassandraOperationImpl;
Expand Down