From 1c9f7a944a934e21baf1899e6cebff6f728759c4 Mon Sep 17 00:00:00 2001 From: Stanimir Penkov Date: Tue, 5 Feb 2019 14:02:55 +0200 Subject: [PATCH] NY-6895: Disable functionality for updating auth provider Signed-off-by: Stanimir Penkov --- .../account/services/AccountServiceImpl.java | 10 ++++++++ .../account/services/AccountServiceTests.java | 25 +++++++++++++++++++ 2 files changed, 35 insertions(+) diff --git a/src/main/java/biz/nynja/account/services/AccountServiceImpl.java b/src/main/java/biz/nynja/account/services/AccountServiceImpl.java index c78dd22..4c2f0d2 100644 --- a/src/main/java/biz/nynja/account/services/AccountServiceImpl.java +++ b/src/main/java/biz/nynja/account/services/AccountServiceImpl.java @@ -1069,6 +1069,7 @@ public class AccountServiceImpl extends AccountServiceGrpc.AccountServiceImplBas return searchResultDetails.build(); } + //Currently not supported @Override @PerformPermissionCheck @Permitted(role = RoleConstants.ACCOUNT_ADMIN) @@ -1076,6 +1077,15 @@ public class AccountServiceImpl extends AccountServiceGrpc.AccountServiceImplBas @Permitted(role = RoleConstants.USER) public void updateAuthenticationProviderForProfile(UpdateAuthenticationProviderRequest request, StreamObserver responseObserver) { + + // This logic is used because the operation of updating authentication provider is currently not supported + if (true) { + logAndBuildGrpcStatusResponse(responseObserver, StatusResponse.newBuilder(), + "Not supported operation of updating authentication provider for profile: {}", + request.getProfileId(), Cause.ERROR_UPDATING_AUTH_PROVIDER, "Operation not supported"); + return; + } + logger.info("Updating auth provider for profile {} requested.", request.getProfileId()); logger.debug("Updating auth provider for profile requested: {}", request); diff --git a/src/test/java/biz/nynja/account/services/AccountServiceTests.java b/src/test/java/biz/nynja/account/services/AccountServiceTests.java index 6bd124f..0c54f00 100644 --- a/src/test/java/biz/nynja/account/services/AccountServiceTests.java +++ b/src/test/java/biz/nynja/account/services/AccountServiceTests.java @@ -19,6 +19,7 @@ import java.util.concurrent.ExecutionException; import java.util.stream.Collectors; import org.junit.Before; +import org.junit.Ignore; import org.junit.Test; import org.junit.runner.RunWith; import org.mockito.ArgumentCaptor; @@ -1721,6 +1722,8 @@ public class AccountServiceTests extends GrpcServerTestBase { reply.getError().getCause().equals(Cause.MISSING_PROFILE_ID)); } + // The test is disabled because update of auth provider is currently not supported + @Ignore @Test public void testUpdateAuthProviderPhoneForProfileOK() { final UpdateAuthenticationProviderRequest request = UpdateAuthenticationProviderRequest.newBuilder() @@ -1738,6 +1741,8 @@ public class AccountServiceTests extends GrpcServerTestBase { assertEquals("SUCCESS", reply.getStatus()); } + // The test is disabled because update of auth provider is currently not supported + @Ignore @Test public void testUpdateAuthProviderEmailForProfileOK() { final UpdateAuthenticationProviderRequest request = UpdateAuthenticationProviderRequest.newBuilder() @@ -1755,6 +1760,8 @@ public class AccountServiceTests extends GrpcServerTestBase { assertEquals("SUCCESS", reply.getStatus()); } + // The test is disabled because update of auth provider is currently not supported + @Ignore @Test public void testUpdateAuthProviderForProfileErrorUpdatingAuthProvider() { final UpdateAuthenticationProviderRequest request = UpdateAuthenticationProviderRequest.newBuilder() @@ -1774,6 +1781,8 @@ public class AccountServiceTests extends GrpcServerTestBase { reply.getError().getCause().equals(Cause.ERROR_UPDATING_AUTH_PROVIDER)); } + // The test is disabled because update of auth provider is currently not supported + @Ignore @Test public void testUpdateAuthProviderEmailForProfileAuthProviderUsed() { final UpdateAuthenticationProviderRequest request = UpdateAuthenticationProviderRequest.newBuilder() @@ -1798,6 +1807,8 @@ public class AccountServiceTests extends GrpcServerTestBase { reply.getError().getCause().equals(Cause.ERROR_UPDATING_AUTH_PROVIDER)); } + // The test is disabled because update of auth provider is currently not supported + @Ignore @Test public void testUpdateAuthProviderForProfileInvalidProfileId() { final UpdateAuthenticationProviderRequest request = UpdateAuthenticationProviderRequest.newBuilder() @@ -1813,6 +1824,8 @@ public class AccountServiceTests extends GrpcServerTestBase { reply.getError().getCause().equals(Cause.INVALID_PROFILE_ID)); } + // The test is disabled because update of auth provider is currently not supported + @Ignore @Test public void testUpdateAuthProviderForProfileMissingProfileId() { final UpdateAuthenticationProviderRequest request = UpdateAuthenticationProviderRequest.newBuilder() @@ -1827,6 +1840,8 @@ public class AccountServiceTests extends GrpcServerTestBase { reply.getError().getCause().equals(Cause.MISSING_PROFILE_ID)); } + // The test is disabled because update of auth provider is currently not supported + @Ignore @Test public void testUpdateAuthProviderForProfileMissingAuthProviderType() { final UpdateAuthenticationProviderRequest request = UpdateAuthenticationProviderRequest.newBuilder() @@ -1842,6 +1857,8 @@ public class AccountServiceTests extends GrpcServerTestBase { reply.getError().getCause().equals(Cause.MISSING_AUTH_PROVIDER_TYPE)); } + // The test is disabled because update of auth provider is currently not supported + @Ignore @Test public void testUpdateAuthProviderForProfileMissingAuthProviderIdentifier() { final UpdateAuthenticationProviderRequest request = UpdateAuthenticationProviderRequest.newBuilder() @@ -1857,6 +1874,8 @@ public class AccountServiceTests extends GrpcServerTestBase { reply.getError().getCause().equals(Cause.MISSING_AUTH_PROVIDER_ID)); } + // The test is disabled because update of auth provider is currently not supported + @Ignore @Test public void testUpdateAuthProviderForProfileInvalidPhone() { final UpdateAuthenticationProviderRequest request = UpdateAuthenticationProviderRequest.newBuilder() @@ -1873,6 +1892,8 @@ public class AccountServiceTests extends GrpcServerTestBase { reply.getError().getCause().equals(Cause.INVALID_PHONENUMBER)); } + // The test is disabled because update of auth provider is currently not supported + @Ignore @Test public void testUpdateAuthProviderForProfileInvalidEmail() { final UpdateAuthenticationProviderRequest request = UpdateAuthenticationProviderRequest.newBuilder() @@ -1889,6 +1910,8 @@ public class AccountServiceTests extends GrpcServerTestBase { reply.getError().getCause().equals(Cause.INVALID_EMAIL)); } + // The test is disabled because update of auth provider is currently not supported + @Ignore @Test public void testUpdateAuthProviderForProfileInvalidTypeFacebook() { final UpdateAuthenticationProviderRequest request = UpdateAuthenticationProviderRequest.newBuilder() @@ -1906,6 +1929,8 @@ public class AccountServiceTests extends GrpcServerTestBase { reply.getError().getCause().equals(Cause.INVALID_ADDITIONAL_LOGIN_OPTION_TYPE)); } + // The test is disabled because update of auth provider is currently not supported + @Ignore @Test public void testUpdateAuthProviderForProfileInvalidTypeGoogleplus() { final UpdateAuthenticationProviderRequest request = UpdateAuthenticationProviderRequest.newBuilder() -- GitLab