refactoring: use constants for header names

This commit is contained in:
Sergey Skrobotov
2022-11-15 10:33:30 -08:00
parent 7fb7abb593
commit c32067759c
29 changed files with 166 additions and 163 deletions

View File

@@ -24,6 +24,7 @@ import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import static org.whispersystems.textsecuregcm.entities.MessageProtos.Envelope;
import com.google.common.net.HttpHeaders;
import com.google.protobuf.ByteString;
import com.google.protobuf.InvalidProtocolBufferException;
import io.dropwizard.auth.basic.BasicCredentials;
@@ -170,7 +171,7 @@ class WebSocketConnectionTest {
when(accountsManager.getByE164("sender1")).thenReturn(Optional.of(sender1));
when(accountsManager.getByE164("sender2")).thenReturn(Optional.empty());
String userAgent = "user-agent";
String userAgent = HttpHeaders.USER_AGENT;
when(storedMessages.getMessagesForDeviceReactive(account.getUuid(), device.getId(), false))
.thenReturn(Flux.fromIterable(outgoingMessages));
@@ -318,7 +319,7 @@ class WebSocketConnectionTest {
when(accountsManager.getByE164("sender1")).thenReturn(Optional.of(sender1));
when(accountsManager.getByE164("sender2")).thenReturn(Optional.empty());
String userAgent = "user-agent";
String userAgent = HttpHeaders.USER_AGENT;
when(storedMessages.getMessagesForDeviceReactive(account.getUuid(), device.getId(), false))
.thenReturn(Flux.fromIterable(pendingMessages));