mirror of
https://github.com/signalapp/Signal-Server
synced 2026-04-21 13:38:04 +01:00
Drop the non-normalized account crawler
This commit is contained in:
committed by
Jon Chambers
parent
09f6d60ae9
commit
0e0cb4d422
@@ -1,39 +0,0 @@
|
||||
/*
|
||||
* Copyright 2013-2021 Signal Messenger, LLC
|
||||
* SPDX-License-Identifier: AGPL-3.0-only
|
||||
*/
|
||||
|
||||
package org.whispersystems.textsecuregcm.storage;
|
||||
|
||||
import org.junit.jupiter.params.ParameterizedTest;
|
||||
import org.junit.jupiter.params.provider.Arguments;
|
||||
import org.junit.jupiter.params.provider.MethodSource;
|
||||
|
||||
import java.util.UUID;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.*;
|
||||
import static org.mockito.Mockito.mock;
|
||||
import static org.mockito.Mockito.when;
|
||||
|
||||
class NonNormalizedAccountCrawlerListenerTest {
|
||||
|
||||
@ParameterizedTest
|
||||
@MethodSource
|
||||
void hasNumberNormalized(final String number, final boolean expectNormalized) {
|
||||
final Account account = mock(Account.class);
|
||||
when(account.getUuid()).thenReturn(UUID.randomUUID());
|
||||
when(account.getNumber()).thenReturn(number);
|
||||
|
||||
assertEquals(expectNormalized, NonNormalizedAccountCrawlerListener.hasNumberNormalized(account));
|
||||
}
|
||||
|
||||
private static Stream<Arguments> hasNumberNormalized() {
|
||||
return Stream.of(
|
||||
Arguments.of("+447700900111", true),
|
||||
Arguments.of("+4407700900111", false),
|
||||
Arguments.of("Not a real phone number", false),
|
||||
Arguments.of(null, false)
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user