mirror of
https://github.com/signalapp/Signal-Server
synced 2026-04-22 08:18:00 +01:00
Remove single URL in favor of density based sprite sheets
This commit is contained in:
@@ -13,8 +13,6 @@ import static org.mockito.Mockito.doReturn;
|
||||
import static org.mockito.Mockito.mock;
|
||||
import static org.mockito.Mockito.when;
|
||||
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URL;
|
||||
import java.time.Clock;
|
||||
import java.time.Instant;
|
||||
import java.util.ArrayList;
|
||||
@@ -56,14 +54,6 @@ public class ConfiguredProfileBadgeConverterTest {
|
||||
return "Badge-" + i;
|
||||
}
|
||||
|
||||
private static URL imageUrlFor(int i) {
|
||||
try {
|
||||
return new URL("https://example.com/badge/" + i);
|
||||
} catch (MalformedURLException e) {
|
||||
throw new AssertionError(e);
|
||||
}
|
||||
}
|
||||
|
||||
private static String nameFor(int i) {
|
||||
return "TRANSLATED NAME " + i;
|
||||
}
|
||||
@@ -73,7 +63,7 @@ public class ConfiguredProfileBadgeConverterTest {
|
||||
}
|
||||
|
||||
private static BadgeConfiguration newBadge(int i) {
|
||||
return new BadgeConfiguration(idFor(i), imageUrlFor(i), "other");
|
||||
return new BadgeConfiguration(idFor(i), "other", "l", "m", "h", "x", "xx", "xxx");
|
||||
}
|
||||
|
||||
private BadgesConfiguration createBadges(int count) {
|
||||
@@ -143,15 +133,15 @@ public class ConfiguredProfileBadgeConverterTest {
|
||||
arguments(idFor(0), expired, false, false, null),
|
||||
arguments(idFor(0), notExpired, false, false, null),
|
||||
arguments(idFor(0), expired, true, false, null),
|
||||
arguments(idFor(0), notExpired, true, false, new Badge(idFor(0), "other", imageUrlFor(0), nameFor(0), desriptionFor(0))),
|
||||
arguments(idFor(0), notExpired, true, false, new Badge(idFor(0), "other", nameFor(0), desriptionFor(0), "l", "m", "h", "x", "xx", "xxx")),
|
||||
arguments(idFor(1), expired, false, false, null),
|
||||
arguments(idFor(1), notExpired, false, false, null),
|
||||
arguments(idFor(1), expired, true, false, null),
|
||||
arguments(idFor(1), notExpired, true, false, null),
|
||||
arguments(idFor(0), expired, false, true, null),
|
||||
arguments(idFor(0), notExpired, false, true, new SelfBadge(idFor(0), "other", imageUrlFor(0), nameFor(0), desriptionFor(0), notExpired, false)),
|
||||
arguments(idFor(0), notExpired, false, true, new SelfBadge(idFor(0), "other", nameFor(0), desriptionFor(0), "l", "m", "h", "x", "xx", "xxx", notExpired, false)),
|
||||
arguments(idFor(0), expired, true, true, null),
|
||||
arguments(idFor(0), notExpired, true, true, new SelfBadge(idFor(0), "other", imageUrlFor(0), nameFor(0), desriptionFor(0), notExpired, true)),
|
||||
arguments(idFor(0), notExpired, true, true, new SelfBadge(idFor(0), "other", nameFor(0), desriptionFor(0), "l", "m", "h", "x", "xx", "xxx", notExpired, true)),
|
||||
arguments(idFor(1), expired, false, true, null),
|
||||
arguments(idFor(1), notExpired, false, true, null),
|
||||
arguments(idFor(1), expired, true, true, null),
|
||||
|
||||
@@ -22,8 +22,6 @@ import com.google.common.collect.ImmutableSet;
|
||||
import io.dropwizard.auth.PolymorphicAuthValueFactoryProvider;
|
||||
import io.dropwizard.testing.junit5.DropwizardExtensionsSupport;
|
||||
import io.dropwizard.testing.junit5.ResourceExtension;
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URL;
|
||||
import java.time.Clock;
|
||||
import java.time.Instant;
|
||||
import java.util.Collections;
|
||||
@@ -96,14 +94,6 @@ class ProfileControllerTest {
|
||||
|
||||
private Account profileAccount;
|
||||
|
||||
private static URL makeURL(String url) {
|
||||
try {
|
||||
return new URL(url);
|
||||
} catch (MalformedURLException e) {
|
||||
throw new AssertionError(e);
|
||||
}
|
||||
}
|
||||
|
||||
private static final ResourceExtension resources = ResourceExtension.builder()
|
||||
.addProvider(AuthHelper.getAuthFilter())
|
||||
.addProvider(new PolymorphicAuthValueFactoryProvider.Binder<>(
|
||||
@@ -118,13 +108,13 @@ class ProfileControllerTest {
|
||||
usernamesManager,
|
||||
dynamicConfigurationManager,
|
||||
(acceptableLanguages, accountBadges, isSelf) -> List.of(
|
||||
new Badge("TEST", "other", makeURL("https://example.com/badge/test"), "Test Badge", "This badge is in unit tests.")
|
||||
new Badge("TEST", "other", "Test Badge", "This badge is in unit tests.", "l", "m", "h", "x", "xx", "xxx")
|
||||
),
|
||||
new BadgesConfiguration(List.of(
|
||||
new BadgeConfiguration("TEST", makeURL("https://example.com/badge/test"), "other"),
|
||||
new BadgeConfiguration("TEST1", makeURL("https://example.com/badge/1"), "testing"),
|
||||
new BadgeConfiguration("TEST2", makeURL("https://example.com/badge/2"), "testing"),
|
||||
new BadgeConfiguration("TEST3", makeURL("https://example.com/badge/3"), "testing")
|
||||
new BadgeConfiguration("TEST", "other", "l", "m", "h", "x", "xx", "xxx"),
|
||||
new BadgeConfiguration("TEST1", "testing", "l", "m", "h", "x", "xx", "xxx"),
|
||||
new BadgeConfiguration("TEST2", "testing", "l", "m", "h", "x", "xx", "xxx"),
|
||||
new BadgeConfiguration("TEST3", "testing", "l", "m", "h", "x", "xx", "xxx")
|
||||
), List.of("TEST1")),
|
||||
s3client,
|
||||
postPolicyGenerator,
|
||||
|
||||
Reference in New Issue
Block a user