Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAngel Avila2016-03-02 04:58:11 -0500
committerRyan D. Brooks2016-03-02 04:58:11 -0500
commit640a48c2684153ac0cd054a785cbe136ade0dbab (patch)
tree876d7aea8dc9ec9e4bfbe4f28d39cf01415de563 /plugins/org.eclipse.osee.account.rest.test
parentb4a6440a00ba4adfe1bb26e7c35b1b59a2f31810 (diff)
downloadorg.eclipse.osee-640a48c2684153ac0cd054a785cbe136ade0dbab.tar.gz
org.eclipse.osee-640a48c2684153ac0cd054a785cbe136ade0dbab.tar.xz
org.eclipse.osee-640a48c2684153ac0cd054a785cbe136ade0dbab.zip
refactor[ats_ATS253925]: Change ids in Account from int to Long
Diffstat (limited to 'plugins/org.eclipse.osee.account.rest.test')
-rw-r--r--plugins/org.eclipse.osee.account.rest.test/src/org/eclipse/osee/account/rest/internal/AccountActiveResourceTest.java5
-rw-r--r--plugins/org.eclipse.osee.account.rest.test/src/org/eclipse/osee/account/rest/internal/AccountDataUtilTest.java16
-rw-r--r--plugins/org.eclipse.osee.account.rest.test/src/org/eclipse/osee/account/rest/internal/AccountOpsTest.java83
-rw-r--r--plugins/org.eclipse.osee.account.rest.test/src/org/eclipse/osee/account/rest/internal/AccountPreferencesResourceTest.java10
-rw-r--r--plugins/org.eclipse.osee.account.rest.test/src/org/eclipse/osee/account/rest/internal/AccountResourceTest.java27
-rw-r--r--plugins/org.eclipse.osee.account.rest.test/src/org/eclipse/osee/account/rest/internal/AccountSessionsResourceTest.java6
-rw-r--r--plugins/org.eclipse.osee.account.rest.test/src/org/eclipse/osee/account/rest/internal/AccountsResourceTest.java36
-rw-r--r--plugins/org.eclipse.osee.account.rest.test/src/org/eclipse/osee/account/rest/internal/SubscriptionsResourceTest.java112
-rw-r--r--plugins/org.eclipse.osee.account.rest.test/src/org/eclipse/osee/account/rest/internal/UnsubscribeResourceTest.java25
9 files changed, 158 insertions, 162 deletions
diff --git a/plugins/org.eclipse.osee.account.rest.test/src/org/eclipse/osee/account/rest/internal/AccountActiveResourceTest.java b/plugins/org.eclipse.osee.account.rest.test/src/org/eclipse/osee/account/rest/internal/AccountActiveResourceTest.java
index 0aabcf535e6..c9d66bf1454 100644
--- a/plugins/org.eclipse.osee.account.rest.test/src/org/eclipse/osee/account/rest/internal/AccountActiveResourceTest.java
+++ b/plugins/org.eclipse.osee.account.rest.test/src/org/eclipse/osee/account/rest/internal/AccountActiveResourceTest.java
@@ -17,13 +17,14 @@ import static org.mockito.MockitoAnnotations.initMocks;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.Response.Status;
import org.eclipse.osee.account.rest.model.AccountActiveData;
+import org.eclipse.osee.framework.core.data.ArtifactId;
import org.junit.Before;
import org.junit.Test;
import org.mockito.Mock;
/**
* Test Case for {@link AccountActiveResource}
- *
+ *
* @author Roberto E. Escobar
*/
public class AccountActiveResourceTest {
@@ -33,7 +34,7 @@ public class AccountActiveResourceTest {
@Mock private AccountActiveData activeData;
//@formatter:on
- private String accountId;
+ private ArtifactId accountId;
private AccountActiveResource resource;
@Before
diff --git a/plugins/org.eclipse.osee.account.rest.test/src/org/eclipse/osee/account/rest/internal/AccountDataUtilTest.java b/plugins/org.eclipse.osee.account.rest.test/src/org/eclipse/osee/account/rest/internal/AccountDataUtilTest.java
index de3c5c33505..af4ebdcba1f 100644
--- a/plugins/org.eclipse.osee.account.rest.test/src/org/eclipse/osee/account/rest/internal/AccountDataUtilTest.java
+++ b/plugins/org.eclipse.osee.account.rest.test/src/org/eclipse/osee/account/rest/internal/AccountDataUtilTest.java
@@ -21,12 +21,14 @@ import org.eclipse.osee.account.rest.model.AccountSessionData;
import org.eclipse.osee.account.rest.model.AccountSessionDetailsData;
import org.eclipse.osee.account.rest.model.SubscriptionData;
import org.eclipse.osee.account.rest.model.SubscriptionGroupData;
+import org.eclipse.osee.account.rest.model.SubscriptionGroupId;
+import org.eclipse.osee.framework.core.data.TokenFactory;
import org.junit.Test;
import org.mockito.Mockito;
/**
* Test Case for {@link AccountDataUtil}
- *
+ *
* @author Roberto E. Escobar
*/
public class AccountDataUtilTest {
@@ -51,7 +53,7 @@ public class AccountDataUtilTest {
AccountSessionData actual = AccountDataUtil.asSessionData(access);
- assertEquals(123L, actual.getAccountId());
+ assertEquals((Long) 123L, actual.getAccountId());
assertEquals("t1", actual.getToken());
}
@@ -60,8 +62,8 @@ public class AccountDataUtilTest {
Subscription subscription = Mockito.mock(Subscription.class);
when(subscription.getGuid()).thenReturn("ABCDE");
when(subscription.getName()).thenReturn("group-1");
- when(subscription.getGroupId()).thenReturn(98765L);
- when(subscription.getAccountId()).thenReturn(123145L);
+ when(subscription.getGroupId()).thenReturn(new SubscriptionGroupId(98765L));
+ when(subscription.getAccountId()).thenReturn(TokenFactory.createArtifactId(123145L));
when(subscription.getAccountName()).thenReturn("account-1");
when(subscription.isActive()).thenReturn(true);
@@ -81,13 +83,13 @@ public class AccountDataUtilTest {
SubscriptionGroup group = Mockito.mock(SubscriptionGroup.class);
when(group.getGuid()).thenReturn("ABCDE");
when(group.getName()).thenReturn("group-1");
- when(group.getId()).thenReturn(98765L);
+ when(group.getId()).thenReturn(new SubscriptionGroupId(98765L));
SubscriptionGroupData actual = AccountDataUtil.asSubscriptionGroupData(group);
assertEquals("ABCDE", actual.getGuid());
assertEquals("group-1", actual.getName());
- assertEquals(98765L, actual.getId());
+ assertEquals((Long) 98765L, actual.getSubscriptionGroupId().getUuid());
assertEquals(true, actual.matches(group));
assertEquals(true, actual.equals(group));
@@ -108,7 +110,7 @@ public class AccountDataUtilTest {
return access;
}
- private static void assertAccess(AccountSessionDetailsData actual, long id, Date created, Date accessed, String accessFrom, String accessDetails) {
+ private static void assertAccess(AccountSessionDetailsData actual, Long id, Date created, Date accessed, String accessFrom, String accessDetails) {
assertEquals(accessDetails, actual.getAccessDetails());
assertEquals(accessFrom, actual.getAccessedFrom());
assertEquals(id, actual.getAccountId());
diff --git a/plugins/org.eclipse.osee.account.rest.test/src/org/eclipse/osee/account/rest/internal/AccountOpsTest.java b/plugins/org.eclipse.osee.account.rest.test/src/org/eclipse/osee/account/rest/internal/AccountOpsTest.java
index 77c6db2d8d1..059d7de5197 100644
--- a/plugins/org.eclipse.osee.account.rest.test/src/org/eclipse/osee/account/rest/internal/AccountOpsTest.java
+++ b/plugins/org.eclipse.osee.account.rest.test/src/org/eclipse/osee/account/rest/internal/AccountOpsTest.java
@@ -40,7 +40,8 @@ import org.eclipse.osee.account.rest.model.AccountPreferencesData;
import org.eclipse.osee.account.rest.model.AccountPreferencesInput;
import org.eclipse.osee.account.rest.model.AccountSessionData;
import org.eclipse.osee.account.rest.model.AccountSessionDetailsData;
-import org.eclipse.osee.framework.jdk.core.type.Identifiable;
+import org.eclipse.osee.framework.core.data.ArtifactId;
+import org.eclipse.osee.framework.core.data.TokenFactory;
import org.eclipse.osee.framework.jdk.core.type.ResultSet;
import org.eclipse.osee.framework.jdk.core.type.ResultSets;
import org.eclipse.osee.framework.jdk.core.util.GUID;
@@ -58,7 +59,7 @@ import org.mockito.MockitoAnnotations;
*/
public class AccountOpsTest {
- private static final String ACCOUNT_UID = "hello@hello.com";
+ private static final ArtifactId ACCOUNT_UID = TokenFactory.createArtifactId(235622L);
//@formatter:off
@Mock private AccountAdmin accountAdmin;
@@ -95,26 +96,22 @@ public class AccountOpsTest {
ArgumentCaptor<CreateAccountRequest> captor = ArgumentCaptor.forClass(CreateAccountRequest.class);
- @SuppressWarnings("unchecked")
- Identifiable<String> id = mock(Identifiable.class);
- when(id.getGuid()).thenReturn(guid);
+ ArtifactId newAccountId = TokenFactory.createArtifactId(235151L);
- when(accountAdmin.createAccount(any(CreateAccountRequest.class))).thenReturn(id);
+ when(accountAdmin.createAccount(any(CreateAccountRequest.class))).thenReturn(newAccountId);
- long accountId = 1982671L;
- Account account = mockAccount(accountId, guid, name, email, username, active);
+ Account account = mockAccount(newAccountId, guid, name, email, username, active);
ResultSet<Account> result = ResultSets.singleton(account);
- when(accountAdmin.getAccountByGuid(guid)).thenReturn(result);
+ when(accountAdmin.getAccountById(newAccountId)).thenReturn(result);
AccountInfoData actual = ops.createAccount(username, input);
verify(accountAdmin).createAccount(captor.capture());
CreateAccountRequest request = captor.getValue();
assertNotNull(request);
- assertAccount(actual, accountId, guid, name, email, username, active);
+ assertAccount(actual, newAccountId, guid, name, email, username, active);
assertEquals(name, request.getDisplayName());
assertEquals(email, request.getEmail());
- assertEquals(username, request.getUserName());
assertEquals(active, request.isActive());
assertEquals(map, request.getPreferences());
}
@@ -150,7 +147,7 @@ public class AccountOpsTest {
AccountLoginRequest request = captor.getValue();
AccessDetails details = request.getDetails();
assertNotNull(details);
- assertEquals(789L, actual.getAccountId());
+ assertEquals((Long) 789L, actual.getAccountId());
assertEquals("t3", actual.getToken());
assertEquals(scheme, request.getScheme());
@@ -212,7 +209,7 @@ public class AccountOpsTest {
AccountSession access3 = mockAccess(789L, "t3", d5, d6, "f3", "d3");
ResultSet<AccountSession> result = ResultSets.newResultSet(access1, access2, access3);
- when(accountAdmin.getAccountSessionByUniqueField(ACCOUNT_UID)).thenReturn(result);
+ when(accountAdmin.getAccountSessionById(ACCOUNT_UID)).thenReturn(result);
List<AccountSessionDetailsData> actual = ops.getAccountSessionById(ACCOUNT_UID);
@@ -222,24 +219,24 @@ public class AccountOpsTest {
assertAccess(iterator.next(), 456L, d3, d4, "f2", "d2");
assertAccess(iterator.next(), 789L, d5, d6, "f3", "d3");
- verify(accountAdmin).getAccountSessionByUniqueField(ACCOUNT_UID);
+ verify(accountAdmin).getAccountSessionById(ACCOUNT_UID);
}
@Test
public void testGetAccountData() {
- Account account = mockAccount(456L, "DEF", "acc2", "acc2@email.com", "u2", true);
+ Account account = mockAccount(TokenFactory.createArtifactId(456L), "DEF", "acc2", "acc2@email.com", "u2", true);
ResultSet<Account> accounts = ResultSets.singleton(account);
- when(accountAdmin.getAccountByUniqueField(ACCOUNT_UID)).thenReturn(accounts);
+ when(accountAdmin.getAccountById(ACCOUNT_UID)).thenReturn(accounts);
AccountInfoData actual = ops.getAccountData(ACCOUNT_UID);
- assertAccount(actual, 456L, "DEF", "acc2", "acc2@email.com", "u2", true);
- verify(accountAdmin).getAccountByUniqueField(ACCOUNT_UID);
+ assertAccount(actual, TokenFactory.createArtifactId(456L), "DEF", "acc2", "acc2@email.com", "u2", true);
+ verify(accountAdmin).getAccountById(ACCOUNT_UID);
}
@Test
public void testGetAccountDetailsData() {
- Account account = mockAccount(789L, "GHI", "acc3", "acc3@email.com", "u3", true);
+ Account account = mockAccount(TokenFactory.createArtifactId(789L), "GHI", "acc3", "acc3@email.com", "u3", true);
Map<String, String> map = new HashMap<>();
map.put("a", "1");
map.put("b", "2");
@@ -251,21 +248,21 @@ public class AccountOpsTest {
when(account.getPreferences()).thenReturn(preferences);
ResultSet<Account> accounts = ResultSets.singleton(account);
- when(accountAdmin.getAccountByUniqueField(ACCOUNT_UID)).thenReturn(accounts);
+ when(accountAdmin.getAccountById(ACCOUNT_UID)).thenReturn(accounts);
AccountDetailsData actual = ops.getAccountDetailsData(ACCOUNT_UID);
- assertAccount(actual, 789L, "GHI", "acc3", "acc3@email.com", "u3", true);
+ assertAccount(actual, TokenFactory.createArtifactId(789L), "GHI", "acc3", "acc3@email.com", "u3", true);
AccountPreferencesData actualPrefs = actual.getPreferences();
Map<String, String> actualMap = actualPrefs.getMap();
- assertEquals(789L, actualPrefs.getId());
+ assertEquals((Long) 789L, actualPrefs.getId());
assertEquals(3, actualMap.size());
assertEquals("1", actualMap.get("a"));
assertEquals("2", actualMap.get("b"));
assertEquals("3", actualMap.get("c"));
- verify(accountAdmin).getAccountByUniqueField(ACCOUNT_UID);
+ verify(accountAdmin).getAccountById(ACCOUNT_UID);
}
@Test
@@ -283,10 +280,10 @@ public class AccountOpsTest {
when(account.getPreferences()).thenReturn(preferences);
ResultSet<Account> accounts = ResultSets.singleton(account);
- when(accountAdmin.getAccountByUniqueField(ACCOUNT_UID)).thenReturn(accounts);
+ when(accountAdmin.getAccountById(ACCOUNT_UID)).thenReturn(accounts);
- AccountPreferencesData actual = ops.getAccountPreferencesData(ACCOUNT_UID);
- assertEquals(123L, actual.getId());
+ AccountPreferencesData actual = ops.getAccountPreferencesDataById(ACCOUNT_UID);
+ assertEquals((Long) 123L, actual.getId());
Map<String, String> actualPrefs = actual.getMap();
assertEquals(3, actualPrefs.size());
@@ -294,14 +291,14 @@ public class AccountOpsTest {
assertEquals("2", actualPrefs.get("b"));
assertEquals("3", actualPrefs.get("c"));
- verify(accountAdmin).getAccountByUniqueField(ACCOUNT_UID);
+ verify(accountAdmin).getAccountById(ACCOUNT_UID);
}
@Test
public void testGetAllAccounts() {
- Account account1 = mockAccount(123L, "ABC", "acc1", "acc1@email.com", "u1", true);
- Account account2 = mockAccount(456L, "DEF", "acc2", "acc2@email.com", "u2", false);
- Account account3 = mockAccount(789L, "GHI", "acc3", "acc3@email.com", "u3", true);
+ Account account1 = mockAccount(TokenFactory.createArtifactId(123L), "ABC", "acc1", "acc1@email.com", "u1", true);
+ Account account2 = mockAccount(TokenFactory.createArtifactId(456L), "DEF", "acc2", "acc2@email.com", "u2", false);
+ Account account3 = mockAccount(TokenFactory.createArtifactId(789L), "GHI", "acc3", "acc3@email.com", "u3", true);
ResultSet<Account> accounts = ResultSets.newResultSet(account1, account2, account3);
@@ -312,9 +309,9 @@ public class AccountOpsTest {
assertEquals(3, actual.size());
Iterator<AccountInfoData> iterator = actual.iterator();
- assertAccount(iterator.next(), 123L, "ABC", "acc1", "acc1@email.com", "u1", true);
- assertAccount(iterator.next(), 456L, "DEF", "acc2", "acc2@email.com", "u2", false);
- assertAccount(iterator.next(), 789L, "GHI", "acc3", "acc3@email.com", "u3", true);
+ assertAccount(iterator.next(), TokenFactory.createArtifactId(123L), "ABC", "acc1", "acc1@email.com", "u1", true);
+ assertAccount(iterator.next(), TokenFactory.createArtifactId(456L), "DEF", "acc2", "acc2@email.com", "u2", false);
+ assertAccount(iterator.next(), TokenFactory.createArtifactId(789L), "GHI", "acc3", "acc3@email.com", "u3", true);
verify(accountAdmin).getAllAccounts();
}
@@ -322,22 +319,22 @@ public class AccountOpsTest {
@Test
public void testIsActive() {
String guid = GUID.create();
- long accountId = 23127916023214L;
+ ArtifactId accountId = TokenFactory.createArtifactId(23127916023214L);
Account account = mock(Account.class);
ResultSet<Account> result = ResultSets.singleton(account);
when(account.getGuid()).thenReturn(guid);
- when(account.getId()).thenReturn(accountId);
+ when(account.getId()).thenReturn(accountId.getUuid());
when(account.isActive()).thenReturn(true);
- when(accountAdmin.getAccountByUniqueField(ACCOUNT_UID)).thenReturn(result);
+ when(accountAdmin.getAccountById(ACCOUNT_UID)).thenReturn(result);
AccountActiveData actual = ops.isActive(ACCOUNT_UID);
- assertEquals(accountId, actual.getAccountId());
+ assertEquals(accountId.getUuid(), actual.getAccountId());
assertEquals(guid, actual.getGuid());
assertEquals(true, actual.isActive());
- verify(accountAdmin).getAccountByUniqueField(ACCOUNT_UID);
+ verify(accountAdmin).getAccountById(ACCOUNT_UID);
}
@Test
@@ -382,7 +379,7 @@ public class AccountOpsTest {
return access;
}
- private static void assertAccess(AccountSessionDetailsData actual, long id, Date created, Date accessed, String accessFrom, String accessDetails) {
+ private static void assertAccess(AccountSessionDetailsData actual, Long id, Date created, Date accessed, String accessFrom, String accessDetails) {
assertEquals(accessDetails, actual.getAccessDetails());
assertEquals(accessFrom, actual.getAccessedFrom());
assertEquals(id, actual.getAccountId());
@@ -390,9 +387,9 @@ public class AccountOpsTest {
assertEquals(accessed, actual.getLastAccessedOn());
}
- private static Account mockAccount(long id, String uuid, String name, String email, String username, boolean active) {
+ private static Account mockAccount(ArtifactId id, String uuid, String name, String email, String username, boolean active) {
Account account = Mockito.mock(Account.class);
- when(account.getId()).thenReturn(id);
+ when(account.getId()).thenReturn(id.getUuid());
when(account.getGuid()).thenReturn(uuid);
when(account.getName()).thenReturn(name);
when(account.getEmail()).thenReturn(email);
@@ -401,8 +398,8 @@ public class AccountOpsTest {
return account;
}
- private static void assertAccount(AccountInfoData data, long id, String uuid, String name, String email, String username, boolean active) {
- assertEquals(id, data.getAccountId());
+ private static void assertAccount(AccountInfoData data, ArtifactId id, String uuid, String name, String email, String username, boolean active) {
+ assertEquals(id.getUuid(), data.getAccountId());
assertEquals(uuid, data.getGuid());
assertEquals(name, data.getName());
assertEquals(email, data.getEmail());
diff --git a/plugins/org.eclipse.osee.account.rest.test/src/org/eclipse/osee/account/rest/internal/AccountPreferencesResourceTest.java b/plugins/org.eclipse.osee.account.rest.test/src/org/eclipse/osee/account/rest/internal/AccountPreferencesResourceTest.java
index e6a40bca39a..71c7fead703 100644
--- a/plugins/org.eclipse.osee.account.rest.test/src/org/eclipse/osee/account/rest/internal/AccountPreferencesResourceTest.java
+++ b/plugins/org.eclipse.osee.account.rest.test/src/org/eclipse/osee/account/rest/internal/AccountPreferencesResourceTest.java
@@ -20,18 +20,20 @@ import javax.ws.rs.core.Response;
import javax.ws.rs.core.Response.Status;
import org.eclipse.osee.account.rest.model.AccountPreferencesData;
import org.eclipse.osee.account.rest.model.AccountPreferencesInput;
+import org.eclipse.osee.framework.core.data.ArtifactId;
+import org.eclipse.osee.framework.core.data.TokenFactory;
import org.junit.Before;
import org.junit.Test;
import org.mockito.Mock;
/**
* Test Case for {@link AccountPreferencesResource}
- *
+ *
* @author Roberto E. Escobar
*/
public class AccountPreferencesResourceTest {
- private static final String ACCOUNT_ID = "hello@hello.com";
+ private static final ArtifactId ACCOUNT_ID = TokenFactory.createArtifactId(134522L);
//@formatter:off
@Mock private AccountOps accountOps;
@@ -50,12 +52,12 @@ public class AccountPreferencesResourceTest {
@Test
public void testGetAccountPreferences() {
- when(accountOps.getAccountPreferencesData(ACCOUNT_ID)).thenReturn(preferences);
+ when(accountOps.getAccountPreferencesDataById(ACCOUNT_ID)).thenReturn(preferences);
AccountPreferencesData actual = resource.getAccountPreferences();
assertEquals(preferences, actual);
- verify(accountOps).getAccountPreferencesData(ACCOUNT_ID);
+ verify(accountOps).getAccountPreferencesDataById(ACCOUNT_ID);
}
@Test
diff --git a/plugins/org.eclipse.osee.account.rest.test/src/org/eclipse/osee/account/rest/internal/AccountResourceTest.java b/plugins/org.eclipse.osee.account.rest.test/src/org/eclipse/osee/account/rest/internal/AccountResourceTest.java
index 42c13d59afb..5a041b52c67 100644
--- a/plugins/org.eclipse.osee.account.rest.test/src/org/eclipse/osee/account/rest/internal/AccountResourceTest.java
+++ b/plugins/org.eclipse.osee.account.rest.test/src/org/eclipse/osee/account/rest/internal/AccountResourceTest.java
@@ -24,25 +24,28 @@ import javax.ws.rs.core.UriInfo;
import org.eclipse.osee.account.rest.model.AccountDetailsData;
import org.eclipse.osee.account.rest.model.AccountInfoData;
import org.eclipse.osee.account.rest.model.AccountInput;
+import org.eclipse.osee.framework.core.data.ArtifactId;
+import org.eclipse.osee.framework.core.data.TokenFactory;
import org.junit.Before;
import org.junit.Test;
import org.mockito.Mock;
/**
* Test Case for {@link AccountResource}
- *
+ *
* @author Roberto E. Escobar
*/
public class AccountResourceTest {
- private static final String ACCOUNT_ID = "hello@hello.com";
+ private static final String NEW_USERNAME = "helloWorld";
+ private static final ArtifactId ACCOUNT_ID = TokenFactory.createArtifactId(93253L);
//@formatter:off
@Mock private AccountOps accountOps;
@Mock private AccountInput accountInput;
@Mock private AccountInfoData accountInfoData;
@Mock private AccountDetailsData details;
-
+
@Mock private UriInfo uriInfo;
//@formatter:on
@@ -56,16 +59,6 @@ public class AccountResourceTest {
}
@Test
- public void testCreateAccount() {
- when(accountOps.createAccount(ACCOUNT_ID, accountInput)).thenReturn(accountInfoData);
-
- AccountInfoData actual = resource.createAccount(accountInput);
- assertEquals(accountInfoData, actual);
-
- verify(accountOps).createAccount(ACCOUNT_ID, accountInput);
- }
-
- @Test
public void testDeleteAccount() {
when(accountOps.deleteAccount(ACCOUNT_ID)).thenReturn(true);
@@ -102,7 +95,7 @@ public class AccountResourceTest {
// Ensure resource constructed correctly;
actual.getAccountPreferences();
- verify(accountOps).getAccountPreferencesData(ACCOUNT_ID);
+ verify(accountOps).getAccountPreferencesDataById(ACCOUNT_ID);
}
@Test
@@ -127,8 +120,8 @@ public class AccountResourceTest {
@Test
public void testGetSubscriptions() {
- URI uri =
- UriBuilder.fromPath("http://localhost:8089/oseex/accounts/{account-id}/subscriptions").build(ACCOUNT_ID);
+ URI uri = UriBuilder.fromPath("http://localhost:8089/oseex/accounts/{account-id}/subscriptions").build(
+ ACCOUNT_ID.getUuid());
when(uriInfo.getRequestUri()).thenReturn(uri);
Response response = resource.getSubscriptions(uriInfo);
@@ -139,7 +132,7 @@ public class AccountResourceTest {
URI location = (URI) response.getMetadata().getFirst(HttpHeaders.LOCATION);
URI expectedLocation =
UriBuilder.fromUri(uri).path("..").path("..").path("..").path("subscriptions").path("for-account").path(
- "{account-id}").build(ACCOUNT_ID);
+ "{account-id}").build(ACCOUNT_ID.getUuid());
assertEquals(expectedLocation, location);
}
diff --git a/plugins/org.eclipse.osee.account.rest.test/src/org/eclipse/osee/account/rest/internal/AccountSessionsResourceTest.java b/plugins/org.eclipse.osee.account.rest.test/src/org/eclipse/osee/account/rest/internal/AccountSessionsResourceTest.java
index 93ce04f5b87..42486f48852 100644
--- a/plugins/org.eclipse.osee.account.rest.test/src/org/eclipse/osee/account/rest/internal/AccountSessionsResourceTest.java
+++ b/plugins/org.eclipse.osee.account.rest.test/src/org/eclipse/osee/account/rest/internal/AccountSessionsResourceTest.java
@@ -17,18 +17,20 @@ import static org.mockito.MockitoAnnotations.initMocks;
import java.util.ArrayList;
import java.util.List;
import org.eclipse.osee.account.rest.model.AccountSessionDetailsData;
+import org.eclipse.osee.framework.core.data.ArtifactId;
+import org.eclipse.osee.framework.core.data.TokenFactory;
import org.junit.Before;
import org.junit.Test;
import org.mockito.Mock;
/**
* Test Case for {@link AccountSessionsResource}
- *
+ *
* @author Roberto E. Escobar
*/
public class AccountSessionsResourceTest {
- private static final String ACCOUNT_ID = "hello@hello.com";
+ private static final ArtifactId ACCOUNT_ID = TokenFactory.createArtifactId(823952L);
//@formatter:off
@Mock private AccountOps accountOps;
diff --git a/plugins/org.eclipse.osee.account.rest.test/src/org/eclipse/osee/account/rest/internal/AccountsResourceTest.java b/plugins/org.eclipse.osee.account.rest.test/src/org/eclipse/osee/account/rest/internal/AccountsResourceTest.java
index 37c2ad9a949..6a5fffb7e88 100644
--- a/plugins/org.eclipse.osee.account.rest.test/src/org/eclipse/osee/account/rest/internal/AccountsResourceTest.java
+++ b/plugins/org.eclipse.osee.account.rest.test/src/org/eclipse/osee/account/rest/internal/AccountsResourceTest.java
@@ -11,7 +11,7 @@
package org.eclipse.osee.account.rest.internal;
import static org.junit.Assert.assertArrayEquals;
-import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertEquals;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import static org.mockito.MockitoAnnotations.initMocks;
@@ -19,18 +19,21 @@ import java.util.ArrayList;
import java.util.List;
import org.eclipse.osee.account.rest.model.AccountInfoData;
import org.eclipse.osee.account.rest.model.AccountInput;
+import org.eclipse.osee.framework.core.data.ArtifactId;
+import org.eclipse.osee.framework.core.data.TokenFactory;
import org.junit.Before;
import org.junit.Test;
import org.mockito.Mock;
/**
* Test Case for {@link AccountsResource}
- *
+ *
* @author Roberto E. Escobar
*/
public class AccountsResourceTest {
- private static final String ACCOUNT_ID = "hello@hello.com";
+ private static final String NEW_USERNAME = "helloWorld";
+ private static final ArtifactId ACCOUNT_ID = TokenFactory.createArtifactId(93253L);
//@formatter:off
@Mock private AccountOps accountOps;
@@ -48,6 +51,16 @@ public class AccountsResourceTest {
}
@Test
+ public void testCreateAccount() {
+ when(accountOps.createAccount(NEW_USERNAME, input)).thenReturn(account);
+
+ AccountInfoData actual = resource.createAccount(NEW_USERNAME, input);
+ assertEquals(account, actual);
+
+ verify(accountOps).createAccount(NEW_USERNAME, input);
+ }
+
+ @Test
public void testGetAccounts() {
List<AccountInfoData> accesses = new ArrayList<>();
accesses.add(account);
@@ -59,21 +72,4 @@ public class AccountsResourceTest {
assertArrayEquals(expected, actual);
verify(accountOps).getAllAccounts();
}
-
- @Test
- public void testGetAccount() {
- AccountResource actual = resource.getAccount(ACCOUNT_ID);
- assertNotNull(actual);
-
- // Ensure resource constructed correctly;
- actual.createAccount(input);
- verify(accountOps).createAccount(ACCOUNT_ID, input);
- }
-
- @Test
- public void testGetLoginResource() {
- AccountLoginResource actual = resource.getLoginResource();
- assertNotNull(actual);
- }
-
}
diff --git a/plugins/org.eclipse.osee.account.rest.test/src/org/eclipse/osee/account/rest/internal/SubscriptionsResourceTest.java b/plugins/org.eclipse.osee.account.rest.test/src/org/eclipse/osee/account/rest/internal/SubscriptionsResourceTest.java
index bc48349337b..b2c4d641a3c 100644
--- a/plugins/org.eclipse.osee.account.rest.test/src/org/eclipse/osee/account/rest/internal/SubscriptionsResourceTest.java
+++ b/plugins/org.eclipse.osee.account.rest.test/src/org/eclipse/osee/account/rest/internal/SubscriptionsResourceTest.java
@@ -23,6 +23,9 @@ import org.eclipse.osee.account.admin.SubscriptionGroup;
import org.eclipse.osee.account.rest.model.AccountInfoData;
import org.eclipse.osee.account.rest.model.SubscriptionData;
import org.eclipse.osee.account.rest.model.SubscriptionGroupData;
+import org.eclipse.osee.account.rest.model.SubscriptionGroupId;
+import org.eclipse.osee.framework.core.data.ArtifactId;
+import org.eclipse.osee.framework.core.data.TokenFactory;
import org.eclipse.osee.framework.jdk.core.type.ResultSet;
import org.eclipse.osee.framework.jdk.core.type.ResultSets;
import org.junit.Before;
@@ -33,31 +36,32 @@ import org.mockito.Mock;
/**
* Test Case for {@link SubscriptionsResource}
- *
+ *
* @author Roberto E. Escobar
*/
public class SubscriptionsResourceTest {
- private static final String SUBSCRIPTION_UUID = "D_UhOLi6D7q_MbOiUYny75bUWxYdlHI9yCLyosilpDMYxRhasnqYvwCOlNEPgvrk";
+ private static final String SUBSCRIPTION_ENCODED =
+ "D_UhOLi6D7q_MbOiUYny75bUWxYdlHI9yCLyosilpDMYxRhasnqYvwCOlNEPgvrk";
private static final boolean SUBSCRIPTION_IS_ACTIVE = true;
private static final String ACCOUNT_UUID = "asdksa";
private static final String ACCOUNT_NAME = "account-1";
- private static final long ACCOUNT_ID = 3129303L;
+ private static final ArtifactId ACCOUNT_ID = TokenFactory.createArtifactId(3129303L);
private static final String ACCOUNT_USERNAME = "sadfaa";
private static final String ACCOUNT_EMAIL = "hello@hello.com";
private static final boolean ACCOUNT_IS_ACTIVE = true;
private static final String GROUP_UUID = "sadjha322";
private static final String GROUP_NAME = "group-1";
- private static final long GROUP_ID = 37219891L;
+ private static final SubscriptionGroupId GROUP_ID = new SubscriptionGroupId(37219891L);
@Rule
public ExpectedException thrown = ExpectedException.none();
//@formatter:off
@Mock private SubscriptionAdmin manager;
-
+
@Mock private Subscription subscription;
@Mock private SubscriptionGroup group;
@Mock private Account account;
@@ -71,6 +75,7 @@ public class SubscriptionsResourceTest {
resource = new SubscriptionsResource(manager);
+ when(subscription.getGroupId()).thenReturn(GROUP_ID);
when(subscription.getGuid()).thenReturn(GROUP_UUID);
when(subscription.getName()).thenReturn(GROUP_NAME);
when(subscription.getAccountName()).thenReturn(ACCOUNT_NAME);
@@ -82,7 +87,7 @@ public class SubscriptionsResourceTest {
when(account.getGuid()).thenReturn(ACCOUNT_UUID);
when(account.getName()).thenReturn(ACCOUNT_NAME);
- when(account.getId()).thenReturn(ACCOUNT_ID);
+ when(account.getId()).thenReturn(ACCOUNT_ID.getUuid());
when(account.getUserName()).thenReturn(ACCOUNT_USERNAME);
when(account.getEmail()).thenReturn(ACCOUNT_EMAIL);
when(account.isActive()).thenReturn(ACCOUNT_IS_ACTIVE);
@@ -91,70 +96,85 @@ public class SubscriptionsResourceTest {
@Test
public void testGetSubscriptions() {
ResultSet<Subscription> results = ResultSets.singleton(subscription);
- when(manager.getSubscriptionsByAccountUniqueField(ACCOUNT_UUID)).thenReturn(results);
+ when(manager.getSubscriptionsByAccountId(ACCOUNT_ID)).thenReturn(results);
- SubscriptionData[] actual = resource.getSubscriptions(ACCOUNT_UUID);
+ SubscriptionData[] actual = resource.getSubscriptions(ACCOUNT_ID.getUuid());
assertEquals(1, actual.length);
SubscriptionData data = actual[0];
checkSubscription(data, GROUP_UUID, GROUP_NAME, ACCOUNT_NAME, SUBSCRIPTION_IS_ACTIVE);
- verify(manager).getSubscriptionsByAccountUniqueField(ACCOUNT_UUID);
+ verify(manager).getSubscriptionsByAccountId(ACCOUNT_ID);
+ }
+
+ @Test
+ public void testGetSubscriptionEncoded() {
+ when(manager.getSubscriptionsByEncodedId(SUBSCRIPTION_ENCODED)).thenReturn(subscription);
+
+ SubscriptionData actual = resource.getSubscriptionByEncoded(SUBSCRIPTION_ENCODED);
+
+ checkSubscription(actual, GROUP_UUID, GROUP_NAME, ACCOUNT_NAME, SUBSCRIPTION_IS_ACTIVE);
+ verify(manager).getSubscriptionsByEncodedId(SUBSCRIPTION_ENCODED);
}
@Test
public void testGetSubscription() {
- when(manager.getSubscription(SUBSCRIPTION_UUID)).thenReturn(subscription);
+ when(manager.getSubscriptionsByEncodedId(SUBSCRIPTION_ENCODED)).thenReturn(subscription);
- SubscriptionData actual = resource.getSubscription(SUBSCRIPTION_UUID);
+ SubscriptionData actual = resource.getSubscriptionByEncoded(SUBSCRIPTION_ENCODED);
checkSubscription(actual, GROUP_UUID, GROUP_NAME, ACCOUNT_NAME, SUBSCRIPTION_IS_ACTIVE);
- verify(manager).getSubscription(SUBSCRIPTION_UUID);
+ verify(manager).getSubscriptionsByEncodedId(SUBSCRIPTION_ENCODED);
}
@Test
public void testSetSubscriptionActiveOk() {
- when(manager.setSubscriptionActive(SUBSCRIPTION_UUID, true)).thenReturn(true);
+ when(manager.getSubscriptionsByEncodedId(SUBSCRIPTION_ENCODED)).thenReturn(subscription);
+ when(manager.setSubscriptionActive(subscription, true)).thenReturn(true);
- Response response = resource.setSubscriptionActive(SUBSCRIPTION_UUID);
+ Response response = resource.setSubscriptionActive(SUBSCRIPTION_ENCODED);
assertEquals(Status.OK.getStatusCode(), response.getStatus());
- verify(manager).setSubscriptionActive(SUBSCRIPTION_UUID, true);
+ verify(manager).setSubscriptionActive(subscription, true);
}
@Test
public void testSetSubscriptionActiveNotModified() {
- when(manager.setSubscriptionActive(SUBSCRIPTION_UUID, true)).thenReturn(false);
+ when(manager.getSubscriptionsByEncodedId(SUBSCRIPTION_ENCODED)).thenReturn(subscription);
+ when(manager.setSubscriptionActive(subscription, true)).thenReturn(false);
- Response response = resource.setSubscriptionActive(SUBSCRIPTION_UUID);
+ Response response = resource.setSubscriptionActive(SUBSCRIPTION_ENCODED);
assertEquals(Status.NOT_MODIFIED.getStatusCode(), response.getStatus());
- verify(manager).setSubscriptionActive(SUBSCRIPTION_UUID, true);
+ verify(manager).setSubscriptionActive(subscription, true);
}
@Test
public void testSetSubscriptionInactiveOk() {
- when(manager.setSubscriptionActive(SUBSCRIPTION_UUID, false)).thenReturn(true);
+ when(manager.getSubscriptionsByEncodedId(SUBSCRIPTION_ENCODED)).thenReturn(subscription);
+ when(manager.setSubscriptionActive(subscription, false)).thenReturn(true);
- Response response = resource.setSubscriptionInactive(SUBSCRIPTION_UUID);
+ Response response = resource.setSubscriptionInactive(SUBSCRIPTION_ENCODED);
assertEquals(Status.OK.getStatusCode(), response.getStatus());
- verify(manager).setSubscriptionActive(SUBSCRIPTION_UUID, false);
+ verify(manager).setSubscriptionActive(subscription, false);
}
@Test
public void testSetSubscriptionInactiveMotModified() {
- when(manager.setSubscriptionActive(SUBSCRIPTION_UUID, false)).thenReturn(false);
+ when(manager.getSubscriptionsByEncodedId(SUBSCRIPTION_ENCODED)).thenReturn(subscription);
+ when(manager.setSubscriptionActive(subscription, false)).thenReturn(false);
- Response response = resource.setSubscriptionInactive(SUBSCRIPTION_UUID);
+ Response response = resource.setSubscriptionInactive(SUBSCRIPTION_ENCODED);
assertEquals(Status.NOT_MODIFIED.getStatusCode(), response.getStatus());
- verify(manager).setSubscriptionActive(SUBSCRIPTION_UUID, false);
+ verify(manager).setSubscriptionActive(subscription, false);
}
@Test
public void testGetSubscriptionGroups() {
ResultSet<SubscriptionGroup> results = ResultSets.singleton(group);
when(manager.getSubscriptionGroups()).thenReturn(results);
+ when(manager.getSubscriptionGroupById(GROUP_ID)).thenReturn(group);
SubscriptionGroupData[] actual = resource.getSubscriptionGroups();
@@ -165,19 +185,9 @@ public class SubscriptionsResourceTest {
}
@Test
- public void testGetSubscriptionGroup() {
- ResultSet<SubscriptionGroup> results = ResultSets.singleton(group);
- when(manager.getSubscriptionGroupByUniqueField(GROUP_UUID)).thenReturn(results);
-
- SubscriptionGroupData actual = resource.getSubscriptionGroup(GROUP_UUID);
-
- checkSubscriptionGroup(actual, GROUP_UUID, GROUP_NAME, GROUP_ID);
- verify(manager).getSubscriptionGroupByUniqueField(GROUP_UUID);
- }
-
- @Test
public void testCreateSubscriptionGroup() {
- when(manager.createSubscriptionGroup(GROUP_NAME)).thenReturn(group);
+ when(manager.createSubscriptionGroup(GROUP_NAME)).thenReturn(GROUP_ID);
+ when(manager.getSubscriptionGroupById(GROUP_ID)).thenReturn(group);
SubscriptionGroupData actual = resource.createSubscriptionGroup(GROUP_NAME);
@@ -187,35 +197,25 @@ public class SubscriptionsResourceTest {
@Test
public void testDeleteSubscriptionGroup() {
- when(manager.deleteSubscriptionGroupByUniqueField(GROUP_UUID)).thenReturn(true);
+ when(manager.deleteSubscriptionById(GROUP_ID)).thenReturn(true);
- Response actual = resource.deleteSubscriptionGroup(GROUP_UUID);
+ Response actual = resource.deleteSubscriptionGroup(GROUP_ID.getUuid());
assertEquals(Status.OK.getStatusCode(), actual.getStatus());
- verify(manager).deleteSubscriptionGroupByUniqueField(GROUP_UUID);
- }
-
- @Test
- public void testDeleteSubscriptionGroupNotModified() {
- when(manager.deleteSubscriptionGroupByUniqueField(GROUP_UUID)).thenReturn(false);
-
- Response actual = resource.deleteSubscriptionGroup(GROUP_UUID);
- assertEquals(Status.NOT_MODIFIED.getStatusCode(), actual.getStatus());
-
- verify(manager).deleteSubscriptionGroupByUniqueField(GROUP_UUID);
+ verify(manager).deleteSubscriptionById(GROUP_ID);
}
@Test
public void testGetSubscriptionGroupMembers() {
ResultSet<Account> results = ResultSets.singleton(account);
- when(manager.getSubscriptionGroupMembersByUniqueField(GROUP_UUID)).thenReturn(results);
+ when(manager.getSubscriptionMembersOfSubscriptionById(GROUP_ID)).thenReturn(results);
- AccountInfoData[] actual = resource.getSubscriptionGroupMembers(GROUP_UUID);
+ AccountInfoData[] actual = resource.getSubscriptionGroupMembers(GROUP_ID.getUuid());
assertEquals(1, actual.length);
AccountInfoData data = actual[0];
checkAccount(data, ACCOUNT_UUID, ACCOUNT_NAME, ACCOUNT_ID, ACCOUNT_USERNAME, ACCOUNT_EMAIL, ACCOUNT_IS_ACTIVE);
- verify(manager).getSubscriptionGroupMembersByUniqueField(GROUP_UUID);
+ verify(manager).getSubscriptionMembersOfSubscriptionById(GROUP_ID);
}
private static void checkSubscription(SubscriptionData actual, String guid, String name, String accountName, boolean active) {
@@ -225,16 +225,16 @@ public class SubscriptionsResourceTest {
assertEquals(active, actual.isActive());
}
- private static void checkSubscriptionGroup(SubscriptionGroupData actual, String guid, String name, long groupId) {
+ private static void checkSubscriptionGroup(SubscriptionGroupData actual, String guid, String name, SubscriptionGroupId groupId) {
assertEquals(guid, actual.getGuid());
assertEquals(name, actual.getName());
- assertEquals(groupId, actual.getId());
+ assertEquals(groupId, actual.getSubscriptionGroupId());
}
- private static void checkAccount(AccountInfoData actual, String guid, String name, long accountId, String username, String email, boolean active) {
+ private static void checkAccount(AccountInfoData actual, String guid, String name, ArtifactId accountId, String username, String email, boolean active) {
assertEquals(guid, actual.getGuid());
assertEquals(name, actual.getName());
- assertEquals(accountId, actual.getAccountId());
+ assertEquals(accountId.getUuid(), actual.getAccountId());
assertEquals(username, actual.getUserName());
assertEquals(email, actual.getEmail());
assertEquals(active, actual.isActive());
diff --git a/plugins/org.eclipse.osee.account.rest.test/src/org/eclipse/osee/account/rest/internal/UnsubscribeResourceTest.java b/plugins/org.eclipse.osee.account.rest.test/src/org/eclipse/osee/account/rest/internal/UnsubscribeResourceTest.java
index c2a111bf335..43c011fc638 100644
--- a/plugins/org.eclipse.osee.account.rest.test/src/org/eclipse/osee/account/rest/internal/UnsubscribeResourceTest.java
+++ b/plugins/org.eclipse.osee.account.rest.test/src/org/eclipse/osee/account/rest/internal/UnsubscribeResourceTest.java
@@ -24,6 +24,9 @@ import java.net.URI;
import javax.ws.rs.core.UriBuilder;
import org.eclipse.osee.account.admin.Subscription;
import org.eclipse.osee.account.admin.SubscriptionAdmin;
+import org.eclipse.osee.account.rest.model.SubscriptionGroupId;
+import org.eclipse.osee.framework.core.data.ArtifactId;
+import org.eclipse.osee.framework.core.data.TokenFactory;
import org.eclipse.osee.framework.jdk.core.type.ViewModel;
import org.junit.Before;
import org.junit.Test;
@@ -31,7 +34,7 @@ import org.mockito.Mock;
/**
* Test Case for {@link UnsubscribeResource}
- *
+ *
* @author Roberto E. Escobar
*/
public class UnsubscribeResourceTest {
@@ -39,9 +42,9 @@ public class UnsubscribeResourceTest {
private static final String SUBSCRIPTION_UUID = "D_UhOLi6D7q_MbOiUYny75bUWxYdlHI9yCLyosilpDMYxRhasnqYvwCOlNEPgvrk";
private static final String GROUP_UUID = "sadjha322";
- private static final long GROUP_ID = 37219891L;
+ private static final SubscriptionGroupId GROUP_ID = new SubscriptionGroupId(37219891L);
private static final String GROUP_NAME = "group-1";
- private static final long ACCOUNT_ID = 3129303L;
+ private static final ArtifactId ACCOUNT_ID = TokenFactory.createArtifactId(3129303L);
private static final String ACCOUNT_NAME = "account-1";
//@formatter:off
@@ -66,7 +69,7 @@ public class UnsubscribeResourceTest {
@Test
public void testGetUnsubscribePageActiveSubscription() {
- when(manager.getSubscription(SUBSCRIPTION_UUID)).thenReturn(subscription);
+ when(manager.getSubscriptionsByEncodedId(SUBSCRIPTION_UUID)).thenReturn(subscription);
when(subscription.isActive()).thenReturn(true);
when(subscription.getGuid()).thenReturn(SUBSCRIPTION_UUID);
@@ -74,7 +77,7 @@ public class UnsubscribeResourceTest {
ViewModel actual = resource.getUnsubscribePage(SUBSCRIPTION_UUID);
- verify(manager).getSubscription(SUBSCRIPTION_UUID);
+ verify(manager).getSubscriptionsByEncodedId(SUBSCRIPTION_UUID);
verify(subscription).isActive();
verify(subscription).getGuid();
@@ -86,12 +89,12 @@ public class UnsubscribeResourceTest {
@Test
public void testGetUnsubscribePageInActiveSubscription() {
- when(manager.getSubscription(SUBSCRIPTION_UUID)).thenReturn(subscription);
+ when(manager.getSubscriptionsByEncodedId(SUBSCRIPTION_UUID)).thenReturn(subscription);
when(subscription.isActive()).thenReturn(false);
ViewModel actual = resource.getUnsubscribePage(SUBSCRIPTION_UUID);
- verify(manager).getSubscription(SUBSCRIPTION_UUID);
+ verify(manager).getSubscriptionsByEncodedId(SUBSCRIPTION_UUID);
verify(subscription).isActive();
verify(subscription, times(0)).getGuid();
@@ -102,12 +105,12 @@ public class UnsubscribeResourceTest {
@Test
public void testProcessUnsubscribePageSubscriptionRemoved() {
- when(manager.getSubscription(SUBSCRIPTION_UUID)).thenReturn(subscription);
+ when(manager.getSubscriptionsByEncodedId(SUBSCRIPTION_UUID)).thenReturn(subscription);
when(manager.setSubscriptionActive(subscription, false)).thenReturn(true);
ViewModel actual = resource.processUnsubscribePage(SUBSCRIPTION_UUID);
- verify(manager).getSubscription(SUBSCRIPTION_UUID);
+ verify(manager).getSubscriptionsByEncodedId(SUBSCRIPTION_UUID);
verify(manager).setSubscriptionActive(subscription, false);
assertEquals(UnsubscribeResource.UNSUBSCRIBE_SUCCESS_TEMPLATE, actual.getViewId());
@@ -117,12 +120,12 @@ public class UnsubscribeResourceTest {
@Test
public void testProcessUnsubscribePageSubscriptionNoChange() {
- when(manager.getSubscription(SUBSCRIPTION_UUID)).thenReturn(subscription);
+ when(manager.getSubscriptionsByEncodedId(SUBSCRIPTION_UUID)).thenReturn(subscription);
when(manager.setSubscriptionActive(subscription, false)).thenReturn(false);
ViewModel actual = resource.processUnsubscribePage(SUBSCRIPTION_UUID);
- verify(manager).getSubscription(SUBSCRIPTION_UUID);
+ verify(manager).getSubscriptionsByEncodedId(SUBSCRIPTION_UUID);
verify(manager).setSubscriptionActive(subscription, false);
assertEquals(UNSUBSCRIBE_NO_SUBSCRIPTION_TEMPLATE, actual.getViewId());

Back to the top