Clean up any invalid group V1 ids in database.

This commit is contained in:
Alan Evans
2020-11-25 14:21:33 -04:00
parent e1bf23251f
commit 6cbd68fe9f
6 changed files with 71 additions and 20 deletions

View File

@@ -273,7 +273,7 @@ public final class GroupIdTest {
@Test(expected = BadGroupIdException.class)
public void cannot_create_v1_with_wrong_length() throws IOException, BadGroupIdException {
GroupId.v1Exact(Hex.fromStringCondensed("000102030405060708090a0b0c0d0e"));
GroupId.v1(Hex.fromStringCondensed("000102030405060708090a0b0c0d0e"));
}
@Test
@@ -302,7 +302,7 @@ public final class GroupIdTest {
@Test
public void v1Exact_static_factory() throws BadGroupIdException {
GroupId.V1 v1 = GroupId.v1Exact(new byte[]{ 9, 10, 11, 12, 13, 14, 15, 0, 1, 2, 3, 4, 5, 6, 7, 8 });
GroupId.V1 v1 = GroupId.v1(new byte[]{9, 10, 11, 12, 13, 14, 15, 0, 1, 2, 3, 4, 5, 6, 7, 8});
assertEquals("__textsecure_group__!090a0b0c0d0e0f000102030405060708", v1.toString());
assertTrue(v1.isV1());