Skip to content

Commit

Permalink
LPD-36483 add unit tests for the method copyCPDefinition from CPDefin…
Browse files Browse the repository at this point in the history
…ition Services classes
  • Loading branch information
regiCesar21 authored and brianchandotcom committed Sep 17, 2024
1 parent 7af828e commit ce1f121
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import com.liferay.portal.kernel.service.ServiceContextThreadLocal;
import com.liferay.portal.kernel.util.HtmlParser;
import com.liferay.portal.kernel.util.HttpComponentsUtil;
import com.liferay.portal.kernel.util.PortalUtil;
import com.liferay.portal.kernel.workflow.WorkflowConstants;

import java.util.ArrayList;

Expand Down Expand Up @@ -884,6 +885,14 @@ public class UpgradeCatchAllCheck implements ConfigurationBeanDeclaration {
_cpDefinitionLinkLocalService.addCPDefinitionLinkByCProductId(cpDefinitionId, cProductId, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, true, priority, type, serviceContext);
}

public void method(
long sourceCPDefinitionId, long groupId, int status) {

CPDefinitionLocalServiceUtil.copyCPDefinition(null, groupId);
CPDefinitionLocalServiceUtil.copyCPDefinition(sourceCPDefinitionId, groupId, WorkflowConstants.STATUS_DRAFT);
_cpDefinitionLocalService.copyCPDefinition(sourceCPDefinitionId, groupId, WorkflowConstants.STATUS_DRAFT);
}

public void method(
long commerceOrderId, long cpInstanceId, int quantity,
int shippedQuantity, String json, CommerceContext commerceContext,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -870,6 +870,14 @@ public class UpgradeCatchAllCheck implements ConfigurationBeanDeclaration {
_cpDefinitionLinkLocalService.addCPDefinitionLinkByCProductId(cpDefinitionId, cProductId, priority, type, serviceContext);
}

public void method(
long sourceCPDefinitionId, long groupId, int status) {

CPDefinitionLocalServiceUtil.copyCPDefinition(null, groupId);
CPDefinitionLocalServiceUtil.copyCPDefinition(sourceCPDefinitionId, groupId);
_cpDefinitionLocalService.copyCPDefinition(sourceCPDefinitionId, groupId);
}

public void method(
long commerceOrderId, long cpInstanceId, int quantity,
int shippedQuantity, String json, CommerceContext commerceContext,
Expand Down

0 comments on commit ce1f121

Please sign in to comment.