diff --git a/src/main/java/biz/nynja/account/services/AccountServiceImpl.java b/src/main/java/biz/nynja/account/services/AccountServiceImpl.java index c78dd22e539af6411658d6d59113c06fb6674584..4c2f0d213a0953e297239d0b748d3e373ac6566a 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 6bd124fdac63a4908c3533e64a8f5bafce325950..0c54f007819e50c59b92db23d4e7576ed87701b9 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()