diff --git a/app/server/appsmith-server/src/main/java/com/appsmith/server/applications/base/ApplicationServiceCE.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/applications/base/ApplicationServiceCE.java index fd8e5a67ef38..6e6fd23d5055 100644 --- a/app/server/appsmith-server/src/main/java/com/appsmith/server/applications/base/ApplicationServiceCE.java +++ b/app/server/appsmith-server/src/main/java/com/appsmith/server/applications/base/ApplicationServiceCE.java @@ -3,7 +3,7 @@ import com.appsmith.server.acl.AclPermission; import com.appsmith.server.domains.Application; import com.appsmith.server.domains.ApplicationMode; -import com.appsmith.server.domains.GitAuth; +import com.appsmith.server.domains.Artifact; import com.appsmith.server.dtos.ApplicationAccessDTO; import com.appsmith.server.dtos.GitAuthDTO; import com.appsmith.server.services.CrudService; @@ -29,7 +29,7 @@ public interface ApplicationServiceCE extends CrudService { Flux findByWorkspaceIdAndBaseApplicationsInRecentlyUsedOrder(String workspaceId); - Mono save(Application application); + Mono save(Artifact application); Mono updateApplicationWithPresets(String branchedApplicationId, Application application); @@ -53,8 +53,6 @@ Mono changeViewAccessForAllBranchesByBranchedApplicationId( Mono setTransientFields(Application application); - Mono createOrUpdateSshKeyPair(String branchedApplicationId, String keyType); - Mono getSshKey(String applicationId); Mono findByBranchNameAndBaseApplicationId( diff --git a/app/server/appsmith-server/src/main/java/com/appsmith/server/applications/base/ApplicationServiceCEImpl.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/applications/base/ApplicationServiceCEImpl.java index 50872df66db3..afd1ad6335a6 100644 --- a/app/server/appsmith-server/src/main/java/com/appsmith/server/applications/base/ApplicationServiceCEImpl.java +++ b/app/server/appsmith-server/src/main/java/com/appsmith/server/applications/base/ApplicationServiceCEImpl.java @@ -1,15 +1,17 @@ package com.appsmith.server.applications.base; -import com.appsmith.external.constants.AnalyticsEvents; import com.appsmith.external.models.ActionDTO; import com.appsmith.external.models.Policy; import com.appsmith.server.acl.AclPermission; +import com.appsmith.server.artifacts.base.artifactbased.ArtifactBasedServiceCE; +import com.appsmith.server.artifacts.permissions.ArtifactPermission; import com.appsmith.server.constants.ApplicationConstants; import com.appsmith.server.constants.Assets; import com.appsmith.server.constants.FieldName; import com.appsmith.server.domains.Application; import com.appsmith.server.domains.ApplicationDetail; import com.appsmith.server.domains.ApplicationMode; +import com.appsmith.server.domains.Artifact; import com.appsmith.server.domains.Asset; import com.appsmith.server.domains.GitArtifactMetadata; import com.appsmith.server.domains.GitAuth; @@ -74,7 +76,7 @@ @Slf4j @Service public class ApplicationServiceCEImpl extends BaseService - implements ApplicationServiceCE { + implements ApplicationServiceCE, ArtifactBasedServiceCE { private final PolicySolution policySolution; private final PermissionGroupService permissionGroupService; @@ -165,8 +167,9 @@ public Flux findByWorkspaceId(String workspaceId, AclPermission per * This method is used to fetch all the applications for a given workspaceId. It also sorts the applications based * on recently used order. * For git connected applications only default branched application is returned. - * @param workspaceId workspaceId for which applications are to be fetched - * @return Flux of applications + * + * @param workspaceId workspaceId for which applications are to be fetched + * @return Flux of applications */ @Override public Flux findByWorkspaceIdAndBaseApplicationsInRecentlyUsedOrder(String workspaceId) { @@ -212,7 +215,8 @@ public Flux findByWorkspaceIdAndBaseApplicationsInRecentlyUsedOrder } @Override - public Mono save(Application application) { + public Mono save(Artifact artifact) { + Application application = (Application) artifact; if (!StringUtils.isEmpty(application.getName())) { application.setSlug(TextUtils.makeSlug(application.getName())); } @@ -227,6 +231,11 @@ public Mono save(Application application) { return repository.save(application).flatMap(this::setTransientFields); } + @Override + public ArtifactPermission getPermissionService() { + return applicationPermission; + } + @Override public Mono create(Application object) { throw new UnsupportedOperationException( @@ -649,84 +658,6 @@ private Flux setTransientFields(Flux applicationsFlux) }); } - /** - * Generate SSH private and public keys required to communicate with remote. Keys will be stored only in the - * default/root application only and not the child branched application. This decision is taken because the combined - * size of keys is close to 4kB - * - * @param branchedApplicationId application for which the SSH key needs to be generated - * @return public key which will be used by user to copy to relevant platform - */ - @Override - public Mono createOrUpdateSshKeyPair(String branchedApplicationId, String keyType) { - GitAuth gitAuth = GitDeployKeyGenerator.generateSSHKey(keyType); - return repository - .findById(branchedApplicationId, applicationPermission.getEditPermission()) - .switchIfEmpty(Mono.error( - new AppsmithException(AppsmithError.NO_RESOURCE_FOUND, "application", branchedApplicationId))) - .flatMap(application -> { - GitArtifactMetadata gitData = application.getGitApplicationMetadata(); - // Check if the current application is the root application - - if (gitData != null - && !StringUtils.isEmpty(gitData.getDefaultArtifactId()) - && branchedApplicationId.equals(gitData.getDefaultArtifactId())) { - // This is the root application with update SSH key request - gitAuth.setRegeneratedKey(true); - gitData.setGitAuth(gitAuth); - return save(application); - } else if (gitData == null) { - // This is a root application with generate SSH key request - GitArtifactMetadata gitArtifactMetadata = new GitArtifactMetadata(); - gitArtifactMetadata.setDefaultApplicationId(branchedApplicationId); - gitArtifactMetadata.setGitAuth(gitAuth); - application.setGitApplicationMetadata(gitArtifactMetadata); - return save(application); - } - // Children application with update SSH key request for root application - // Fetch root application and then make updates. We are storing the git metadata only in root - // application - if (StringUtils.isEmpty(gitData.getDefaultArtifactId())) { - throw new AppsmithException( - AppsmithError.INVALID_GIT_CONFIGURATION, - "Unable to find root application, please connect your application to remote repo to resolve this issue."); - } - gitAuth.setRegeneratedKey(true); - - return repository - .findById(gitData.getDefaultArtifactId(), applicationPermission.getEditPermission()) - .flatMap(baseApplication -> { - GitArtifactMetadata gitArtifactMetadata = baseApplication.getGitApplicationMetadata(); - gitArtifactMetadata.setDefaultApplicationId(baseApplication.getId()); - gitArtifactMetadata.setGitAuth(gitAuth); - baseApplication.setGitApplicationMetadata(gitArtifactMetadata); - return save(baseApplication); - }); - }) - .flatMap(application -> { - // Send generate SSH key analytics event - assert application.getId() != null; - final Map eventData = Map.of( - FieldName.APP_MODE, ApplicationMode.EDIT.toString(), FieldName.APPLICATION, application); - final Map data = Map.of( - FieldName.APPLICATION_ID, - application.getId(), - "organizationId", - application.getWorkspaceId(), - "isRegeneratedKey", - gitAuth.isRegeneratedKey(), - FieldName.EVENT_DATA, - eventData); - return analyticsService - .sendObjectEvent(AnalyticsEvents.GENERATE_SSH_KEY, application, data) - .onErrorResume(e -> { - log.warn("Error sending ssh key generation data point", e); - return Mono.just(application); - }); - }) - .thenReturn(gitAuth); - } - /** * Method to get the SSH public key * @@ -1025,9 +956,10 @@ public Flux findBranchedApplicationIdsByBaseApplicationId(String baseApp /** * Gets branched application with the right permission set based on mode of application + * * @param defaultApplicationId : default app id - * @param branchName : branch name of the application - * @param mode : is it edit mode or view mode + * @param branchName : branch name of the application + * @param mode : is it edit mode or view mode * @return : returns a publisher of branched application */ @Override diff --git a/app/server/appsmith-server/src/main/java/com/appsmith/server/applications/base/ApplicationServiceImpl.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/applications/base/ApplicationServiceImpl.java index 513506baaedf..4c2afe584650 100644 --- a/app/server/appsmith-server/src/main/java/com/appsmith/server/applications/base/ApplicationServiceImpl.java +++ b/app/server/appsmith-server/src/main/java/com/appsmith/server/applications/base/ApplicationServiceImpl.java @@ -1,5 +1,7 @@ package com.appsmith.server.applications.base; +import com.appsmith.server.artifacts.base.artifactbased.ArtifactBasedService; +import com.appsmith.server.domains.Application; import com.appsmith.server.repositories.ApplicationRepository; import com.appsmith.server.repositories.NewActionRepository; import com.appsmith.server.services.AnalyticsService; @@ -20,7 +22,8 @@ @Slf4j @Service -public class ApplicationServiceImpl extends ApplicationServiceCECompatibleImpl implements ApplicationService { +public class ApplicationServiceImpl extends ApplicationServiceCECompatibleImpl + implements ApplicationService, ArtifactBasedService { public ApplicationServiceImpl( Validator validator, diff --git a/app/server/appsmith-server/src/main/java/com/appsmith/server/artifacts/base/ArtifactService.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/artifacts/base/ArtifactService.java new file mode 100644 index 000000000000..541477b8a020 --- /dev/null +++ b/app/server/appsmith-server/src/main/java/com/appsmith/server/artifacts/base/ArtifactService.java @@ -0,0 +1,3 @@ +package com.appsmith.server.artifacts.base; + +public interface ArtifactService extends ArtifactServiceCE {} diff --git a/app/server/appsmith-server/src/main/java/com/appsmith/server/artifacts/base/ArtifactServiceCE.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/artifacts/base/ArtifactServiceCE.java new file mode 100644 index 000000000000..c8d37afd9a02 --- /dev/null +++ b/app/server/appsmith-server/src/main/java/com/appsmith/server/artifacts/base/ArtifactServiceCE.java @@ -0,0 +1,24 @@ +package com.appsmith.server.artifacts.base; + +import com.appsmith.server.artifacts.base.artifactbased.ArtifactBasedService; +import com.appsmith.server.constants.ArtifactType; +import com.appsmith.server.domains.Artifact; +import com.appsmith.server.domains.GitAuth; +import reactor.core.publisher.Mono; + +public interface ArtifactServiceCE { + + /** + * This method returns the appropriate ArtifactBasedService based on the type of artifact. + */ + ArtifactBasedService getArtifactBasedService(ArtifactType artifactType); + + /** + * Generate SSH private and public keys required to communicate with remote. Keys will be stored only in the + * default/root application only and not the child branched application. This decision is taken because the combined + * size of keys is close to 4kB + * + * @return public key which will be used by user to copy to relevant platform + */ + Mono createOrUpdateSshKeyPair(ArtifactType artifactType, String branchedArtifactId, String keyType); +} diff --git a/app/server/appsmith-server/src/main/java/com/appsmith/server/artifacts/base/ArtifactServiceCEImpl.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/artifacts/base/ArtifactServiceCEImpl.java new file mode 100644 index 000000000000..c5c4f2a50036 --- /dev/null +++ b/app/server/appsmith-server/src/main/java/com/appsmith/server/artifacts/base/ArtifactServiceCEImpl.java @@ -0,0 +1,116 @@ +package com.appsmith.server.artifacts.base; + +import com.appsmith.external.constants.AnalyticsEvents; +import com.appsmith.server.artifacts.base.artifactbased.ArtifactBasedService; +import com.appsmith.server.artifacts.permissions.ArtifactPermission; +import com.appsmith.server.constants.ArtifactType; +import com.appsmith.server.constants.FieldName; +import com.appsmith.server.domains.Application; +import com.appsmith.server.domains.ApplicationMode; +import com.appsmith.server.domains.Artifact; +import com.appsmith.server.domains.GitArtifactMetadata; +import com.appsmith.server.domains.GitAuth; +import com.appsmith.server.exceptions.AppsmithError; +import com.appsmith.server.exceptions.AppsmithException; +import com.appsmith.server.helpers.GitDeployKeyGenerator; +import com.appsmith.server.services.AnalyticsService; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; +import org.springframework.util.StringUtils; +import reactor.core.publisher.Mono; + +import java.util.Map; + +@Slf4j +@Service +public class ArtifactServiceCEImpl implements ArtifactServiceCE { + + protected final ArtifactBasedService applicationService; + private final AnalyticsService analyticsService; + + public ArtifactServiceCEImpl( + ArtifactBasedService applicationService, AnalyticsService analyticsService) { + this.applicationService = applicationService; + this.analyticsService = analyticsService; + } + + @Override + public ArtifactBasedService getArtifactBasedService(ArtifactType artifactType) { + return applicationService; + } + + @Override + public Mono createOrUpdateSshKeyPair( + ArtifactType artifactType, String branchedArtifactId, String keyType) { + GitAuth gitAuth = GitDeployKeyGenerator.generateSSHKey(keyType); + ArtifactBasedService artifactBasedService = getArtifactBasedService(artifactType); + ArtifactPermission artifactPermission = artifactBasedService.getPermissionService(); + final String artifactTypeName = artifactType.name().toLowerCase(); + return artifactBasedService + .findById(branchedArtifactId, artifactPermission.getEditPermission()) + .switchIfEmpty(Mono.error( + new AppsmithException(AppsmithError.NO_RESOURCE_FOUND, artifactTypeName, branchedArtifactId))) + .flatMap(artifact -> { + GitArtifactMetadata gitData = artifact.getGitArtifactMetadata(); + // Check if the current artifact is the root artifact + + if (gitData != null + && StringUtils.hasLength(gitData.getDefaultArtifactId()) + && branchedArtifactId.equals(gitData.getDefaultArtifactId())) { + // This is the root application with update SSH key request + gitAuth.setRegeneratedKey(true); + gitData.setGitAuth(gitAuth); + return artifactBasedService.save(artifact); + } else if (gitData == null) { + // This is a root application with generate SSH key request + GitArtifactMetadata gitArtifactMetadata = new GitArtifactMetadata(); + gitArtifactMetadata.setDefaultApplicationId(branchedArtifactId); + gitArtifactMetadata.setGitAuth(gitAuth); + artifact.setGitArtifactMetadata(gitArtifactMetadata); + return artifactBasedService.save(artifact); + } + // Children application with update SSH key request for root application + // Fetch root application and then make updates. We are storing the git metadata only in root + // application + if (!StringUtils.hasLength(gitData.getDefaultArtifactId())) { + return Mono.error(new AppsmithException( + AppsmithError.INVALID_GIT_CONFIGURATION, + "Unable to find root " + artifactTypeName + ", please connect your " + artifactTypeName + + " to remote repo to resolve this issue.")); + } + gitAuth.setRegeneratedKey(true); + + return artifactBasedService + .findById(gitData.getDefaultArtifactId(), artifactPermission.getEditPermission()) + .flatMap(baseApplication -> { + GitArtifactMetadata gitArtifactMetadata = baseApplication.getGitArtifactMetadata(); + gitArtifactMetadata.setDefaultApplicationId(baseApplication.getId()); + gitArtifactMetadata.setGitAuth(gitAuth); + baseApplication.setGitArtifactMetadata(gitArtifactMetadata); + return artifactBasedService.save(baseApplication); + }); + }) + .flatMap(artifact -> { + // Send generate SSH key analytics event + assert artifact.getId() != null; + final Map eventData = Map.of( + FieldName.APP_MODE, ApplicationMode.EDIT.toString(), FieldName.APPLICATION, artifact); + final Map data = Map.of( + FieldName.APPLICATION_ID, + artifact.getId(), + "organizationId", + artifact.getWorkspaceId(), + "isRegeneratedKey", + gitAuth.isRegeneratedKey(), + FieldName.EVENT_DATA, + eventData); + return analyticsService + .sendObjectEvent(AnalyticsEvents.GENERATE_SSH_KEY, artifact, data) + .onErrorResume(e -> { + log.warn("Error sending ssh key generation data point", e); + return Mono.just(artifact); + }); + }) + .thenReturn(gitAuth); + } +} diff --git a/app/server/appsmith-server/src/main/java/com/appsmith/server/artifacts/base/ArtifactServiceImpl.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/artifacts/base/ArtifactServiceImpl.java new file mode 100644 index 000000000000..515b15085268 --- /dev/null +++ b/app/server/appsmith-server/src/main/java/com/appsmith/server/artifacts/base/ArtifactServiceImpl.java @@ -0,0 +1,15 @@ +package com.appsmith.server.artifacts.base; + +import com.appsmith.server.artifacts.base.artifactbased.ArtifactBasedService; +import com.appsmith.server.domains.Application; +import com.appsmith.server.services.AnalyticsService; +import org.springframework.stereotype.Service; + +@Service +public class ArtifactServiceImpl extends ArtifactServiceCEImpl implements ArtifactService { + + public ArtifactServiceImpl( + ArtifactBasedService applicationService, AnalyticsService analyticsService) { + super(applicationService, analyticsService); + } +} diff --git a/app/server/appsmith-server/src/main/java/com/appsmith/server/artifacts/base/artifactbased/ArtifactBasedService.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/artifacts/base/artifactbased/ArtifactBasedService.java new file mode 100644 index 000000000000..098b1fa10c39 --- /dev/null +++ b/app/server/appsmith-server/src/main/java/com/appsmith/server/artifacts/base/artifactbased/ArtifactBasedService.java @@ -0,0 +1,5 @@ +package com.appsmith.server.artifacts.base.artifactbased; + +import com.appsmith.server.domains.Artifact; + +public interface ArtifactBasedService extends ArtifactBasedServiceCE {} diff --git a/app/server/appsmith-server/src/main/java/com/appsmith/server/artifacts/base/artifactbased/ArtifactBasedServiceCE.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/artifacts/base/artifactbased/ArtifactBasedServiceCE.java new file mode 100644 index 000000000000..90d10e9962c6 --- /dev/null +++ b/app/server/appsmith-server/src/main/java/com/appsmith/server/artifacts/base/artifactbased/ArtifactBasedServiceCE.java @@ -0,0 +1,15 @@ +package com.appsmith.server.artifacts.base.artifactbased; + +import com.appsmith.server.acl.AclPermission; +import com.appsmith.server.artifacts.permissions.ArtifactPermission; +import com.appsmith.server.domains.Artifact; +import reactor.core.publisher.Mono; + +public interface ArtifactBasedServiceCE { + + Mono findById(String id, AclPermission aclPermission); + + Mono save(Artifact artifact); + + ArtifactPermission getPermissionService(); +} diff --git a/app/server/appsmith-server/src/main/java/com/appsmith/server/artifacts/permissions/ArtifactPermission.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/artifacts/permissions/ArtifactPermission.java new file mode 100644 index 000000000000..0d9e4b870662 --- /dev/null +++ b/app/server/appsmith-server/src/main/java/com/appsmith/server/artifacts/permissions/ArtifactPermission.java @@ -0,0 +1,3 @@ +package com.appsmith.server.artifacts.permissions; + +public interface ArtifactPermission extends ArtifactPermissionCE {} diff --git a/app/server/appsmith-server/src/main/java/com/appsmith/server/solutions/ce/ArtifactPermissionCE.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/artifacts/permissions/ArtifactPermissionCE.java similarity index 70% rename from app/server/appsmith-server/src/main/java/com/appsmith/server/solutions/ce/ArtifactPermissionCE.java rename to app/server/appsmith-server/src/main/java/com/appsmith/server/artifacts/permissions/ArtifactPermissionCE.java index f2e9b574bbeb..78423dd64cfb 100644 --- a/app/server/appsmith-server/src/main/java/com/appsmith/server/solutions/ce/ArtifactPermissionCE.java +++ b/app/server/appsmith-server/src/main/java/com/appsmith/server/artifacts/permissions/ArtifactPermissionCE.java @@ -1,9 +1,11 @@ -package com.appsmith.server.solutions.ce; +package com.appsmith.server.artifacts.permissions; import com.appsmith.server.acl.AclPermission; public interface ArtifactPermissionCE { + AclPermission getEditPermission(); + AclPermission getDeletePermission(); AclPermission getGitConnectPermission(); diff --git a/app/server/appsmith-server/src/main/java/com/appsmith/server/controllers/ApplicationController.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/controllers/ApplicationController.java index c2774c57edf2..8836312ed8de 100644 --- a/app/server/appsmith-server/src/main/java/com/appsmith/server/controllers/ApplicationController.java +++ b/app/server/appsmith-server/src/main/java/com/appsmith/server/controllers/ApplicationController.java @@ -1,6 +1,7 @@ package com.appsmith.server.controllers; import com.appsmith.server.applications.base.ApplicationService; +import com.appsmith.server.artifacts.base.ArtifactService; import com.appsmith.server.constants.Url; import com.appsmith.server.controllers.ce.ApplicationControllerCE; import com.appsmith.server.exports.internal.ExportService; @@ -22,6 +23,7 @@ public class ApplicationController extends ApplicationControllerCE { public ApplicationController( + ArtifactService artifactService, ApplicationService service, ApplicationPageService applicationPageService, UserReleaseNotes userReleaseNotes, @@ -33,6 +35,7 @@ public ApplicationController( ImportService importService, ExportService exportService) { super( + artifactService, service, applicationPageService, userReleaseNotes, diff --git a/app/server/appsmith-server/src/main/java/com/appsmith/server/controllers/ce/ApplicationControllerCE.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/controllers/ce/ApplicationControllerCE.java index 90f7e717d28b..f1512a8866f9 100644 --- a/app/server/appsmith-server/src/main/java/com/appsmith/server/controllers/ce/ApplicationControllerCE.java +++ b/app/server/appsmith-server/src/main/java/com/appsmith/server/controllers/ce/ApplicationControllerCE.java @@ -3,6 +3,8 @@ import com.appsmith.external.models.Datasource; import com.appsmith.external.views.Views; import com.appsmith.server.applications.base.ApplicationService; +import com.appsmith.server.artifacts.base.ArtifactService; +import com.appsmith.server.constants.ArtifactType; import com.appsmith.server.constants.FieldName; import com.appsmith.server.constants.Url; import com.appsmith.server.domains.Application; @@ -62,6 +64,7 @@ @RequiredArgsConstructor public class ApplicationControllerCE { + protected final ArtifactService artifactService; protected final ApplicationService service; private final ApplicationPageService applicationPageService; private final UserReleaseNotes userReleaseNotes; @@ -248,7 +251,8 @@ public Mono> importApplicationFromFile( @PostMapping("/ssh-keypair/{branchedApplicationId}") public Mono> generateSSHKeyPair( @PathVariable String branchedApplicationId, @RequestParam(required = false) String keyType) { - return service.createOrUpdateSshKeyPair(branchedApplicationId, keyType) + return artifactService + .createOrUpdateSshKeyPair(ArtifactType.APPLICATION, branchedApplicationId, keyType) .map(created -> new ResponseDTO<>(HttpStatus.CREATED.value(), created, null)); } diff --git a/app/server/appsmith-server/src/main/java/com/appsmith/server/helpers/ImportArtifactPermissionProvider.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/helpers/ImportArtifactPermissionProvider.java index bcc90326cbe7..f60fb62d96e4 100644 --- a/app/server/appsmith-server/src/main/java/com/appsmith/server/helpers/ImportArtifactPermissionProvider.java +++ b/app/server/appsmith-server/src/main/java/com/appsmith/server/helpers/ImportArtifactPermissionProvider.java @@ -1,9 +1,9 @@ package com.appsmith.server.helpers; import com.appsmith.server.acl.AclPermission; +import com.appsmith.server.artifacts.permissions.ArtifactPermission; import com.appsmith.server.helpers.ce.ImportArtifactPermissionProviderCE; import com.appsmith.server.solutions.ActionPermission; -import com.appsmith.server.solutions.ArtifactPermission; import com.appsmith.server.solutions.ContextPermission; import com.appsmith.server.solutions.DatasourcePermission; import com.appsmith.server.solutions.WorkspacePermission; diff --git a/app/server/appsmith-server/src/main/java/com/appsmith/server/helpers/ce/ImportArtifactPermissionProviderCE.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/helpers/ce/ImportArtifactPermissionProviderCE.java index c1ee41c79126..b5422273ff85 100644 --- a/app/server/appsmith-server/src/main/java/com/appsmith/server/helpers/ce/ImportArtifactPermissionProviderCE.java +++ b/app/server/appsmith-server/src/main/java/com/appsmith/server/helpers/ce/ImportArtifactPermissionProviderCE.java @@ -3,13 +3,13 @@ import com.appsmith.external.models.BaseDomain; import com.appsmith.external.models.Datasource; import com.appsmith.server.acl.AclPermission; +import com.appsmith.server.artifacts.permissions.ArtifactPermission; import com.appsmith.server.domains.Application; import com.appsmith.server.domains.NewAction; import com.appsmith.server.domains.NewPage; import com.appsmith.server.domains.Workspace; import com.appsmith.server.solutions.ActionPermission; import com.appsmith.server.solutions.ApplicationPermission; -import com.appsmith.server.solutions.ArtifactPermission; import com.appsmith.server.solutions.ContextPermission; import com.appsmith.server.solutions.DatasourcePermission; import com.appsmith.server.solutions.WorkspacePermission; diff --git a/app/server/appsmith-server/src/main/java/com/appsmith/server/solutions/ArtifactPermission.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/solutions/ArtifactPermission.java deleted file mode 100644 index d6cc0b1dec57..000000000000 --- a/app/server/appsmith-server/src/main/java/com/appsmith/server/solutions/ArtifactPermission.java +++ /dev/null @@ -1,5 +0,0 @@ -package com.appsmith.server.solutions; - -import com.appsmith.server.solutions.ce.ArtifactPermissionCE; - -public interface ArtifactPermission extends ArtifactPermissionCE {} diff --git a/app/server/appsmith-server/src/main/java/com/appsmith/server/solutions/ce/ApplicationPermissionCE.java b/app/server/appsmith-server/src/main/java/com/appsmith/server/solutions/ce/ApplicationPermissionCE.java index 1b91b9a08330..2b1620ed4d13 100644 --- a/app/server/appsmith-server/src/main/java/com/appsmith/server/solutions/ce/ApplicationPermissionCE.java +++ b/app/server/appsmith-server/src/main/java/com/appsmith/server/solutions/ce/ApplicationPermissionCE.java @@ -1,7 +1,7 @@ package com.appsmith.server.solutions.ce; import com.appsmith.server.acl.AclPermission; -import com.appsmith.server.solutions.ArtifactPermission; +import com.appsmith.server.artifacts.permissions.ArtifactPermission; public interface ApplicationPermissionCE extends ArtifactPermission { diff --git a/app/server/appsmith-server/src/test/java/com/appsmith/server/controllers/ApplicationControllerTest.java b/app/server/appsmith-server/src/test/java/com/appsmith/server/controllers/ApplicationControllerTest.java index f8b9091b5a7e..c6b1d5d1c5f5 100644 --- a/app/server/appsmith-server/src/test/java/com/appsmith/server/controllers/ApplicationControllerTest.java +++ b/app/server/appsmith-server/src/test/java/com/appsmith/server/controllers/ApplicationControllerTest.java @@ -1,27 +1,13 @@ package com.appsmith.server.controllers; -import com.appsmith.server.applications.base.ApplicationService; -import com.appsmith.server.configurations.ProjectProperties; import com.appsmith.server.configurations.RedisTestContainerConfig; import com.appsmith.server.configurations.SecurityTestConfig; import com.appsmith.server.constants.Url; import com.appsmith.server.dtos.ApplicationImportDTO; import com.appsmith.server.dtos.ArtifactImportDTO; import com.appsmith.server.exceptions.AppsmithErrorCode; -import com.appsmith.server.exports.internal.ExportService; -import com.appsmith.server.exports.internal.partial.PartialExportService; -import com.appsmith.server.fork.internal.ApplicationForkingService; -import com.appsmith.server.helpers.CommonGitFileUtils; import com.appsmith.server.helpers.RedisUtils; import com.appsmith.server.imports.internal.ImportService; -import com.appsmith.server.imports.internal.partial.PartialImportService; -import com.appsmith.server.services.AnalyticsService; -import com.appsmith.server.services.ApplicationPageService; -import com.appsmith.server.services.ApplicationSnapshotService; -import com.appsmith.server.services.SessionUserService; -import com.appsmith.server.services.UserDataService; -import com.appsmith.server.solutions.UserReleaseNotes; -import com.appsmith.server.themes.base.ThemeService; import org.junit.jupiter.api.Test; import org.mockito.Mockito; import org.mockito.stubbing.Answer; @@ -49,51 +35,10 @@ @EnableAutoConfiguration(exclude = ReactiveMultipartAutoConfiguration.class) @Import({SecurityTestConfig.class, RedisUtils.class, RedisTestContainerConfig.class}) public class ApplicationControllerTest { - @MockBean - ApplicationService applicationService; - - @MockBean - ApplicationPageService applicationPageService; - - @MockBean - UserReleaseNotes applicationFetcher; - - @MockBean - ApplicationForkingService applicationForkingService; @MockBean ImportService importService; - @MockBean - ExportService exportService; - - @MockBean - ApplicationSnapshotService applicationSnapshotService; - - @MockBean - ThemeService themeService; - - @MockBean - UserDataService userDataService; - - @MockBean - AnalyticsService analyticsService; - - @MockBean - CommonGitFileUtils commonGitFileUtils; - - @MockBean - SessionUserService sessionUserService; - - @MockBean - PartialExportService partialExportService; - - @MockBean - PartialImportService partialImportService; - - @MockBean - ProjectProperties projectProperties; - @Autowired private WebTestClient webTestClient; diff --git a/app/server/appsmith-server/src/test/java/com/appsmith/server/git/autocommit/AutoCommitServiceTest.java b/app/server/appsmith-server/src/test/java/com/appsmith/server/git/autocommit/AutoCommitServiceTest.java index 66fe0fd2347a..3a7e5f53c350 100644 --- a/app/server/appsmith-server/src/test/java/com/appsmith/server/git/autocommit/AutoCommitServiceTest.java +++ b/app/server/appsmith-server/src/test/java/com/appsmith/server/git/autocommit/AutoCommitServiceTest.java @@ -78,7 +78,7 @@ public class AutoCommitServiceTest { @MockBean DSLMigrationUtils dslMigrationUtils; - @MockBean + @SpyBean ApplicationService applicationService; @MockBean @@ -201,12 +201,13 @@ public void beforeTest() { baseRepoSuffix = Paths.get(WORKSPACE_ID, DEFAULT_APP_ID, REPO_NAME); // used for fetching application on autocommit service and gitAutoCommitHelper.autocommit - Mockito.when(applicationService.findByBranchNameAndBaseApplicationId( - anyString(), anyString(), any(AclPermission.class))) - .thenReturn(Mono.just(testApplication)); + Mockito.doReturn(Mono.just(testApplication)) + .when(applicationService) + .findByBranchNameAndBaseApplicationId(anyString(), anyString(), any(AclPermission.class)); - Mockito.when(applicationService.findById(anyString(), any(AclPermission.class))) - .thenReturn(Mono.just(testApplication)); + Mockito.doReturn(Mono.just(testApplication)) + .when(applicationService) + .findById(anyString(), any(AclPermission.class)); // create page-dto PageDTO pageDTO = createPageDTO(); @@ -224,8 +225,9 @@ public void beforeTest() { .when(gitExecutor) .pushApplication(baseRepoSuffix, REPO_URL, PUBLIC_KEY, PRIVATE_KEY, BRANCH_NAME); - Mockito.when(applicationService.findById(anyString(), any(AclPermission.class))) - .thenReturn(Mono.just(testApplication)); + Mockito.doReturn(Mono.just(testApplication)) + .when(applicationService) + .findById(anyString(), any(AclPermission.class)); Mockito.when(gitPrivateRepoHelper.isBranchProtected(any(), anyString())).thenReturn(Mono.just(FALSE)); @@ -480,12 +482,13 @@ public void testAutoCommit_whenAutoCommitAlreadyInProgressOnSameBranch_returnsIn public void testAutoCommit_whenNoGitMetadata_returnsNonGitApp() { testApplication.setGitApplicationMetadata(null); // used for fetching application on autocommit service and gitAutoCommitHelper.autocommit - Mockito.when(applicationService.findById(anyString(), any(AclPermission.class))) - .thenReturn(Mono.just(testApplication)); + Mockito.doReturn(Mono.just(testApplication)) + .when(applicationService) + .findById(anyString(), any(AclPermission.class)); - Mockito.when(applicationService.findByBranchNameAndBaseApplicationId( - anyString(), anyString(), any(AclPermission.class))) - .thenReturn(Mono.just(testApplication)); + Mockito.doReturn(Mono.just(testApplication)) + .when(applicationService) + .findByBranchNameAndBaseApplicationId(anyString(), anyString(), any(AclPermission.class)); // this would not trigger autocommit Mono autoCommitResponseDTOMono = diff --git a/app/server/appsmith-server/src/test/java/com/appsmith/server/git/autocommit/helpers/GitAutoCommitHelperImplTest.java b/app/server/appsmith-server/src/test/java/com/appsmith/server/git/autocommit/helpers/GitAutoCommitHelperImplTest.java index 7af8f7f170e7..80f0f122c5ae 100644 --- a/app/server/appsmith-server/src/test/java/com/appsmith/server/git/autocommit/helpers/GitAutoCommitHelperImplTest.java +++ b/app/server/appsmith-server/src/test/java/com/appsmith/server/git/autocommit/helpers/GitAutoCommitHelperImplTest.java @@ -44,7 +44,7 @@ public class GitAutoCommitHelperImplTest { @MockBean AutoCommitEventHandler autoCommitEventHandler; - @MockBean + @SpyBean ApplicationService applicationService; @MockBean @@ -81,13 +81,14 @@ public void autoCommitApplication_WhenBranchIsProtected_AutoCommitNotTriggered() application.setId(defaultApplicationId); application.setGitApplicationMetadata(new GitArtifactMetadata()); - Mockito.when(applicationService.findById(defaultApplicationId, applicationPermission.getEditPermission())) - .thenReturn(Mono.just(application)); + Mockito.doReturn(Mono.just(application)) + .when(applicationService) + .findById(defaultApplicationId, applicationPermission.getEditPermission()); Mockito.when(gitPrivateRepoHelper.isBranchProtected(any(GitArtifactMetadata.class), eq(branchName))) .thenReturn(Mono.just(Boolean.TRUE)); - Mockito.when(applicationService.findByBranchNameAndBaseApplicationId( - anyString(), anyString(), any(AclPermission.class))) - .thenReturn(Mono.just(application)); + Mockito.doReturn(Mono.just(application)) + .when(applicationService) + .findByBranchNameAndBaseApplicationId(anyString(), anyString(), any(AclPermission.class)); StepVerifier.create(gitAutoCommitHelper.autoCommitClientMigration(defaultApplicationId, branchName)) .assertNext(aBoolean -> { @@ -105,11 +106,12 @@ public void autoCommitApplication_WhenAutoCommitDisabled_AutoCommitNotTriggered( metadata.getAutoCommitConfig().setEnabled(Boolean.FALSE); application.setGitApplicationMetadata(metadata); - Mockito.when(applicationService.findById(defaultApplicationId, applicationPermission.getEditPermission())) - .thenReturn(Mono.just(application)); - Mockito.when(applicationService.findByBranchNameAndBaseApplicationId( - anyString(), anyString(), any(AclPermission.class))) - .thenReturn(Mono.just(application)); + Mockito.doReturn(Mono.just(application)) + .when(applicationService) + .findById(defaultApplicationId, applicationPermission.getEditPermission()); + Mockito.doReturn(Mono.just(application)) + .when(applicationService) + .findByBranchNameAndBaseApplicationId(anyString(), anyString(), any(AclPermission.class)); Mockito.when(gitPrivateRepoHelper.isBranchProtected(any(GitArtifactMetadata.class), eq(branchName))) .thenReturn(Mono.just(Boolean.FALSE)); @@ -126,13 +128,14 @@ public void autoCommitApplication_WhenAnotherCommitIsRunning_AutoCommitNotTrigge application.setId(defaultApplicationId); application.setGitApplicationMetadata(new GitArtifactMetadata()); - Mockito.when(applicationService.findById(defaultApplicationId, applicationPermission.getEditPermission())) - .thenReturn(Mono.just(application)); + Mockito.doReturn(Mono.just(application)) + .when(applicationService) + .findById(defaultApplicationId, applicationPermission.getEditPermission()); Mockito.when(gitPrivateRepoHelper.isBranchProtected(any(GitArtifactMetadata.class), eq(branchName))) .thenReturn(Mono.just(Boolean.FALSE)); - Mockito.when(applicationService.findByBranchNameAndBaseApplicationId( - anyString(), anyString(), any(AclPermission.class))) - .thenReturn(Mono.just(application)); + Mockito.doReturn(Mono.just(application)) + .when(applicationService) + .findByBranchNameAndBaseApplicationId(anyString(), anyString(), any(AclPermission.class)); Mono autoCommitMono = redisUtils .startAutoCommit(defaultApplicationId, branchName) @@ -158,11 +161,12 @@ public void autoCommitApplication_WhenAllConditionsMatched_AutoCommitTriggered() metaData.setGitAuth(gitAuth); application.setGitApplicationMetadata(metaData); - Mockito.when(applicationService.findById(defaultApplicationId, applicationPermission.getEditPermission())) - .thenReturn(Mono.just(application)); - Mockito.when(applicationService.findByBranchNameAndBaseApplicationId( - anyString(), anyString(), any(AclPermission.class))) - .thenReturn(Mono.just(application)); + Mockito.doReturn(Mono.just(application)) + .when(applicationService) + .findById(defaultApplicationId, applicationPermission.getEditPermission()); + Mockito.doReturn(Mono.just(application)) + .when(applicationService) + .findByBranchNameAndBaseApplicationId(anyString(), anyString(), any(AclPermission.class)); Mockito.when(commonGitService.fetchRemoteChanges(any(Application.class), any(Application.class), anyBoolean())) .thenReturn(Mono.just(branchTrackingStatus)); @@ -256,11 +260,12 @@ public void autoCommitApplication_WhenRemoteAhead_AutoCommitNotTriggered() { metadata.getAutoCommitConfig().setEnabled(Boolean.TRUE); application.setGitApplicationMetadata(metadata); - Mockito.when(applicationService.findById(defaultApplicationId, applicationPermission.getEditPermission())) - .thenReturn(Mono.just(application)); - Mockito.when(applicationService.findByBranchNameAndBaseApplicationId( - anyString(), anyString(), any(AclPermission.class))) - .thenReturn(Mono.just(application)); + Mockito.doReturn(Mono.just(application)) + .when(applicationService) + .findById(defaultApplicationId, applicationPermission.getEditPermission()); + Mockito.doReturn(Mono.just(application)) + .when(applicationService) + .findByBranchNameAndBaseApplicationId(anyString(), anyString(), any(AclPermission.class)); Mockito.when(commonGitService.fetchRemoteChanges(any(Application.class), any(Application.class), anyBoolean())) .thenReturn(Mono.just(branchTrackingStatus)); @@ -291,12 +296,13 @@ public void autoCommitApplication_WhenServerRequiresMigration_successIfEverythin application.setGitApplicationMetadata(metaData); - Mockito.when(applicationService.findById(anyString(), any(AclPermission.class))) - .thenReturn(Mono.just(application)); + Mockito.doReturn(Mono.just(application)) + .when(applicationService) + .findById(anyString(), any(AclPermission.class)); - Mockito.when(applicationService.findByBranchNameAndBaseApplicationId( - anyString(), anyString(), any(AclPermission.class))) - .thenReturn(Mono.just(application)); + Mockito.doReturn(Mono.just(application)) + .when(applicationService) + .findByBranchNameAndBaseApplicationId(anyString(), anyString(), any(AclPermission.class)); Mockito.when(commonGitService.fetchRemoteChanges(any(Application.class), any(Application.class), anyBoolean())) .thenReturn(Mono.just(branchTrackingStatus)); @@ -335,12 +341,13 @@ public void autoCommitApplication_WhenServerDoesNotRequireMigration_returnFalse( metaData.setGitAuth(gitAuth); application.setGitApplicationMetadata(metaData); - Mockito.when(applicationService.findById(anyString(), any(AclPermission.class))) - .thenReturn(Mono.just(application)); + Mockito.doReturn(Mono.just(application)) + .when(applicationService) + .findById(anyString(), any(AclPermission.class)); - Mockito.when(applicationService.findByBranchNameAndBaseApplicationId( - anyString(), anyString(), any(AclPermission.class))) - .thenReturn(Mono.just(application)); + Mockito.doReturn(Mono.just(application)) + .when(applicationService) + .findByBranchNameAndBaseApplicationId(anyString(), anyString(), any(AclPermission.class)); StepVerifier.create(gitAutoCommitHelper.autoCommitServerMigration(defaultApplicationId, branchName)) .assertNext(isAutoCommitPublished -> { diff --git a/app/server/appsmith-server/src/test/java/com/appsmith/server/refactors/ce/RefactoringServiceCEImplTest.java b/app/server/appsmith-server/src/test/java/com/appsmith/server/refactors/ce/RefactoringServiceCEImplTest.java index 61d74b6a9116..dcbfbd0aad29 100644 --- a/app/server/appsmith-server/src/test/java/com/appsmith/server/refactors/ce/RefactoringServiceCEImplTest.java +++ b/app/server/appsmith-server/src/test/java/com/appsmith/server/refactors/ce/RefactoringServiceCEImplTest.java @@ -66,7 +66,7 @@ class RefactoringServiceCEImplTest { @MockBean private UpdateLayoutService updateLayoutService; - @MockBean + @SpyBean private ApplicationService applicationService; @MockBean @@ -161,7 +161,7 @@ public void testRefactorCollectionName_withEmptyActions_returnsValidLayout() { Application application = new Application(); application.setId("testAppId"); application.setEvaluationVersion(EVALUATION_VERSION); - Mockito.when(applicationService.findById(Mockito.anyString())).thenReturn(Mono.just(application)); + Mockito.doReturn(Mono.just(application)).when(applicationService).findById(Mockito.anyString()); Mockito.when(newActionService.findByPageIdAndViewMode(Mockito.anyString(), Mockito.anyBoolean(), Mockito.any())) .thenReturn(Flux.empty()); @@ -287,7 +287,7 @@ public void testRefactorCollectionName_withActions_returnsValidLayout() { Application application = new Application(); application.setId("testAppId"); application.setEvaluationVersion(EVALUATION_VERSION); - Mockito.when(applicationService.findById(Mockito.anyString())).thenReturn(Mono.just(application)); + Mockito.doReturn(Mono.just(application)).when(applicationService).findById(Mockito.anyString()); NewAction newAction = new NewAction(); ActionDTO actionDTO = new ActionDTO(); diff --git a/app/server/appsmith-server/src/test/java/com/appsmith/server/services/ce/ApplicationServiceCETest.java b/app/server/appsmith-server/src/test/java/com/appsmith/server/services/ce/ApplicationServiceCETest.java index f71b19257321..89c9a9adabd4 100644 --- a/app/server/appsmith-server/src/test/java/com/appsmith/server/services/ce/ApplicationServiceCETest.java +++ b/app/server/appsmith-server/src/test/java/com/appsmith/server/services/ce/ApplicationServiceCETest.java @@ -14,6 +14,8 @@ import com.appsmith.server.acl.AclPermission; import com.appsmith.server.actioncollections.base.ActionCollectionService; import com.appsmith.server.applications.base.ApplicationService; +import com.appsmith.server.artifacts.base.ArtifactService; +import com.appsmith.server.constants.ArtifactType; import com.appsmith.server.constants.FieldName; import com.appsmith.server.datasources.base.DatasourceService; import com.appsmith.server.domains.ActionCollection; @@ -176,6 +178,9 @@ public class ApplicationServiceCETest { static Application gitConnectedApp = new Application(); + @Autowired + ArtifactService artifactService; + @Autowired ApplicationService applicationService; @@ -3514,8 +3519,8 @@ public void generateSshKeyPair_WhenDefaultApplicationIdNotSet_CurrentAppUpdated( Mono applicationMono = applicationPageService .createApplication(unsavedApplication) - .flatMap(savedApplication -> applicationService - .createOrUpdateSshKeyPair(savedApplication.getId(), null) + .flatMap(savedApplication -> artifactService + .createOrUpdateSshKeyPair(ArtifactType.APPLICATION, savedApplication.getId(), null) .thenReturn(savedApplication.getId())) .flatMap(testApplicationId -> applicationRepository.findById(testApplicationId, MANAGE_APPLICATIONS)); @@ -3544,8 +3549,8 @@ public void generateSshKeyPair_WhenDefaultApplicationIdSet_DefaultApplicationUpd .createApplication(unsavedMainApp, workspaceId) .block(); - Mono> tuple2Mono = applicationService - .createOrUpdateSshKeyPair(savedApplication.getId(), null) + Mono> tuple2Mono = artifactService + .createOrUpdateSshKeyPair(ArtifactType.APPLICATION, savedApplication.getId(), null) .thenReturn(savedApplication) .flatMap(savedMainApp -> { Application unsavedChildApp = new Application(); @@ -3555,8 +3560,8 @@ public void generateSshKeyPair_WhenDefaultApplicationIdSet_DefaultApplicationUpd unsavedChildApp.setWorkspaceId(workspaceId); return applicationPageService.createApplication(unsavedChildApp, workspaceId); }) - .flatMap(savedChildApp -> applicationService - .createOrUpdateSshKeyPair(savedChildApp.getId(), null) + .flatMap(savedChildApp -> artifactService + .createOrUpdateSshKeyPair(ArtifactType.APPLICATION, savedChildApp.getId(), null) .thenReturn(savedChildApp)) .flatMap(savedChildApp -> { // fetch and return both child and main applications diff --git a/app/server/appsmith-server/src/test/java/com/appsmith/server/services/ce/ApplicationSnapshotServiceUnitTest.java b/app/server/appsmith-server/src/test/java/com/appsmith/server/services/ce/ApplicationSnapshotServiceUnitTest.java index f278c9f1143f..b9620e099287 100644 --- a/app/server/appsmith-server/src/test/java/com/appsmith/server/services/ce/ApplicationSnapshotServiceUnitTest.java +++ b/app/server/appsmith-server/src/test/java/com/appsmith/server/services/ce/ApplicationSnapshotServiceUnitTest.java @@ -24,6 +24,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; import org.springframework.boot.test.mock.mockito.MockBean; +import org.springframework.boot.test.mock.mockito.SpyBean; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; import reactor.test.StepVerifier; @@ -41,7 +42,7 @@ @SpringBootTest public class ApplicationSnapshotServiceUnitTest { - @MockBean + @SpyBean ApplicationService applicationService; @MockBean @@ -82,9 +83,9 @@ public void createApplicationSnapshot_WhenApplicationTooLarge_SnapshotCreatedSuc ApplicationJson applicationJson = new ApplicationJson(); applicationJson.setPageList(List.of(newPage)); - Mockito.when(applicationService.findBranchedApplicationId( - branchName, defaultAppId, AclPermission.MANAGE_APPLICATIONS)) - .thenReturn(Mono.just(branchedAppId)); + Mockito.doReturn(Mono.just(branchedAppId)) + .when(applicationService) + .findBranchedApplicationId(branchName, defaultAppId, AclPermission.MANAGE_APPLICATIONS); Mockito.when(exportService.exportByArtifactId( branchedAppId, SerialiseArtifactObjective.VERSION_CONTROL, ArtifactType.APPLICATION)) @@ -119,8 +120,9 @@ public void restoreSnapshot_WhenSnapshotHasMultipleChunks_RestoredSuccessfully() application.setWorkspaceId(workspaceId); application.setId(branchedAppId); - Mockito.when(applicationService.findById(branchedAppId, AclPermission.MANAGE_APPLICATIONS)) - .thenReturn(Mono.just(application)); + Mockito.doReturn(Mono.just(application)) + .when(applicationService) + .findById(branchedAppId, AclPermission.MANAGE_APPLICATIONS); ApplicationJson applicationJson = new ApplicationJson(); applicationJson.setExportedApplication(application); diff --git a/app/server/appsmith-server/src/test/java/com/appsmith/server/solutions/ce/ActionExecutionSolutionCEImplTest.java b/app/server/appsmith-server/src/test/java/com/appsmith/server/solutions/ce/ActionExecutionSolutionCEImplTest.java index ff664b5ee37c..0fc84add17f8 100644 --- a/app/server/appsmith-server/src/test/java/com/appsmith/server/solutions/ce/ActionExecutionSolutionCEImplTest.java +++ b/app/server/appsmith-server/src/test/java/com/appsmith/server/solutions/ce/ActionExecutionSolutionCEImplTest.java @@ -107,7 +107,7 @@ class ActionExecutionSolutionCEImplTest { @MockBean NewPageService newPageService; - @MockBean + @SpyBean ApplicationService applicationService; @SpyBean