Migrate MessageSenderTest to JUnit 5
This commit is contained in:
parent
e08c5a412e
commit
aeb9f67266
|
@ -20,8 +20,8 @@ import static org.mockito.Mockito.when;
|
|||
import com.google.protobuf.ByteString;
|
||||
import java.util.UUID;
|
||||
import org.apache.commons.lang3.RandomStringUtils;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.junit.jupiter.api.BeforeEach;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.mockito.ArgumentCaptor;
|
||||
import org.whispersystems.textsecuregcm.entities.MessageProtos;
|
||||
import org.whispersystems.textsecuregcm.metrics.PushLatencyManager;
|
||||
|
@ -29,7 +29,7 @@ import org.whispersystems.textsecuregcm.storage.Account;
|
|||
import org.whispersystems.textsecuregcm.storage.Device;
|
||||
import org.whispersystems.textsecuregcm.storage.MessagesManager;
|
||||
|
||||
public class MessageSenderTest {
|
||||
class MessageSenderTest {
|
||||
|
||||
private Account account;
|
||||
private Device device;
|
||||
|
@ -44,8 +44,8 @@ public class MessageSenderTest {
|
|||
private static final UUID ACCOUNT_UUID = UUID.randomUUID();
|
||||
private static final long DEVICE_ID = 1L;
|
||||
|
||||
@Before
|
||||
public void setUp() {
|
||||
@BeforeEach
|
||||
void setUp() {
|
||||
|
||||
account = mock(Account.class);
|
||||
device = mock(Device.class);
|
||||
|
@ -67,7 +67,7 @@ public class MessageSenderTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testSendOnlineMessageClientPresent() throws Exception {
|
||||
void testSendOnlineMessageClientPresent() throws Exception {
|
||||
when(clientPresenceManager.isPresent(ACCOUNT_UUID, DEVICE_ID)).thenReturn(true);
|
||||
when(device.getGcmId()).thenReturn("gcm-id");
|
||||
|
||||
|
@ -85,7 +85,7 @@ public class MessageSenderTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testSendOnlineMessageClientNotPresent() throws Exception {
|
||||
void testSendOnlineMessageClientNotPresent() throws Exception {
|
||||
when(clientPresenceManager.isPresent(ACCOUNT_UUID, DEVICE_ID)).thenReturn(false);
|
||||
when(device.getGcmId()).thenReturn("gcm-id");
|
||||
|
||||
|
@ -97,7 +97,7 @@ public class MessageSenderTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testSendMessageClientPresent() throws Exception {
|
||||
void testSendMessageClientPresent() throws Exception {
|
||||
when(clientPresenceManager.isPresent(ACCOUNT_UUID, DEVICE_ID)).thenReturn(true);
|
||||
when(device.getGcmId()).thenReturn("gcm-id");
|
||||
|
||||
|
@ -115,7 +115,7 @@ public class MessageSenderTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testSendMessageGcmClientNotPresent() throws Exception {
|
||||
void testSendMessageGcmClientNotPresent() throws Exception {
|
||||
when(clientPresenceManager.isPresent(ACCOUNT_UUID, DEVICE_ID)).thenReturn(false);
|
||||
when(device.getGcmId()).thenReturn("gcm-id");
|
||||
|
||||
|
@ -127,7 +127,7 @@ public class MessageSenderTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testSendMessageApnClientNotPresent() throws Exception {
|
||||
void testSendMessageApnClientNotPresent() throws Exception {
|
||||
when(clientPresenceManager.isPresent(ACCOUNT_UUID, DEVICE_ID)).thenReturn(false);
|
||||
when(device.getApnId()).thenReturn("apn-id");
|
||||
|
||||
|
@ -139,7 +139,7 @@ public class MessageSenderTest {
|
|||
}
|
||||
|
||||
@Test
|
||||
public void testSendMessageFetchClientNotPresent() throws Exception {
|
||||
void testSendMessageFetchClientNotPresent() throws Exception {
|
||||
when(clientPresenceManager.isPresent(ACCOUNT_UUID, DEVICE_ID)).thenReturn(false);
|
||||
when(device.getFetchesMessages()).thenReturn(true);
|
||||
|
||||
|
|
Loading…
Reference in New Issue