Skip to content

Commit

Permalink
LPS-99435 Inline
Browse files Browse the repository at this point in the history
  • Loading branch information
brianchandotcom committed Aug 13, 2019
1 parent e0fbf37 commit 2780077
Showing 1 changed file with 32 additions and 26 deletions.
Expand Up @@ -26,7 +26,6 @@
import com.liferay.portal.test.rule.LiferayIntegrationTestRule;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

import org.junit.After;
Expand Down Expand Up @@ -80,27 +79,32 @@ public void testActivateAccountEntryByModel() throws Exception {
AccountEntry accountEntry = _addAccountEntry(
WorkflowConstants.STATUS_INACTIVE);

long accountEntryId = accountEntry.getAccountEntryId();

_assertStatus(accountEntryId, WorkflowConstants.STATUS_INACTIVE);
_assertStatus(
accountEntry.getAccountEntryId(),
WorkflowConstants.STATUS_INACTIVE);

_accountEntryLocalService.activateAccountEntry(accountEntry);

_assertStatus(accountEntryId, WorkflowConstants.STATUS_APPROVED);
_assertStatus(
accountEntry.getAccountEntryId(),
WorkflowConstants.STATUS_APPROVED);
}

@Test
public void testActivateAccountEntryByPrimaryKey() throws Exception {
AccountEntry accountEntry = _addAccountEntry(
WorkflowConstants.STATUS_INACTIVE);

long accountEntryId = accountEntry.getAccountEntryId();

_assertStatus(accountEntryId, WorkflowConstants.STATUS_INACTIVE);
_assertStatus(
accountEntry.getAccountEntryId(),
WorkflowConstants.STATUS_INACTIVE);

_accountEntryLocalService.activateAccountEntry(accountEntryId);
_accountEntryLocalService.activateAccountEntry(
accountEntry.getAccountEntryId());

_assertStatus(accountEntryId, WorkflowConstants.STATUS_APPROVED);
_assertStatus(
accountEntry.getAccountEntryId(),
WorkflowConstants.STATUS_APPROVED);
}

@Test
Expand Down Expand Up @@ -139,26 +143,31 @@ public void testDeactivateAccountEntries() throws Exception {
public void testDeactivateAccountEntryByModel() throws Exception {
AccountEntry accountEntry = _addAccountEntry();

long accountEntryId = accountEntry.getAccountEntryId();

_assertStatus(accountEntryId, WorkflowConstants.STATUS_APPROVED);
_assertStatus(
accountEntry.getAccountEntryId(),
WorkflowConstants.STATUS_APPROVED);

_accountEntryLocalService.deactivateAccountEntry(accountEntry);

_assertStatus(accountEntryId, WorkflowConstants.STATUS_INACTIVE);
_assertStatus(
accountEntry.getAccountEntryId(),
WorkflowConstants.STATUS_INACTIVE);
}

@Test
public void testDeactivateAccountEntryByPrimaryKey() throws Exception {
AccountEntry accountEntry = _addAccountEntry();

long accountEntryId = accountEntry.getAccountEntryId();

_assertStatus(accountEntryId, WorkflowConstants.STATUS_APPROVED);
_assertStatus(
accountEntry.getAccountEntryId(),
WorkflowConstants.STATUS_APPROVED);

_accountEntryLocalService.deactivateAccountEntry(accountEntryId);
_accountEntryLocalService.deactivateAccountEntry(
accountEntry.getAccountEntryId());

_assertStatus(accountEntryId, WorkflowConstants.STATUS_INACTIVE);
_assertStatus(
accountEntry.getAccountEntryId(),
WorkflowConstants.STATUS_INACTIVE);
}

@Test
Expand All @@ -176,22 +185,19 @@ public void testDeleteAccountEntries() throws Exception {
public void testDeleteAccountEntryByModel() throws Exception {
AccountEntry accountEntry = _addAccountEntry();

long accountEntryId = accountEntry.getAccountEntryId();

_accountEntryLocalService.deleteAccountEntry(accountEntry);

_assertDeleted(accountEntryId);
_assertDeleted(accountEntry.getAccountEntryId());
}

@Test
public void testDeleteAccountEntryByPrimaryKey() throws Exception {
AccountEntry accountEntry = _addAccountEntry();

long accountEntryId = accountEntry.getAccountEntryId();

_accountEntryLocalService.deleteAccountEntry(accountEntryId);
_accountEntryLocalService.deleteAccountEntry(
accountEntry.getAccountEntryId());

_assertDeleted(accountEntryId);
_assertDeleted(accountEntry.getAccountEntryId());
}

private long[] _addAccountEntries() throws Exception {
Expand Down

0 comments on commit 2780077

Please sign in to comment.