mirror of
https://github.com/signalapp/Signal-Server
synced 2026-04-21 22:28:03 +01:00
Only notify CDS if an account attribute change actually changes an account's discoverability.
This commit is contained in:
committed by
Jon Chambers
parent
2f5d6e16a6
commit
474b879b16
@@ -1170,7 +1170,7 @@ public class AccountControllerTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSetAccountAttributes() {
|
||||
public void testSetAccountAttributesNoDiscoverabilityChange() {
|
||||
Response response =
|
||||
resources.getJerseyTest()
|
||||
.target("/v1/accounts/attributes/")
|
||||
@@ -1178,6 +1178,32 @@ public class AccountControllerTest {
|
||||
.header("Authorization", AuthHelper.getAuthHeader(AuthHelper.VALID_NUMBER, AuthHelper.VALID_PASSWORD))
|
||||
.put(Entity.json(new AccountAttributes("keykeykeykey", false, 2222, null, null, null, null, true, null)));
|
||||
|
||||
assertThat(response.getStatus()).isEqualTo(204);
|
||||
verify(directoryQueue, never()).refreshRegisteredUser(any());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSetAccountAttributesEnableDiscovery() {
|
||||
Response response =
|
||||
resources.getJerseyTest()
|
||||
.target("/v1/accounts/attributes/")
|
||||
.request()
|
||||
.header("Authorization", AuthHelper.getAuthHeader(AuthHelper.UNDISCOVERABLE_NUMBER, AuthHelper.UNDISCOVERABLE_PASSWORD))
|
||||
.put(Entity.json(new AccountAttributes("keykeykeykey", false, 2222, null, null, null, null, true, null)));
|
||||
|
||||
assertThat(response.getStatus()).isEqualTo(204);
|
||||
verify(directoryQueue, times(1)).refreshRegisteredUser(AuthHelper.UNDISCOVERABLE_ACCOUNT);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSetAccountAttributesDisableDiscovery() {
|
||||
Response response =
|
||||
resources.getJerseyTest()
|
||||
.target("/v1/accounts/attributes/")
|
||||
.request()
|
||||
.header("Authorization", AuthHelper.getAuthHeader(AuthHelper.VALID_NUMBER, AuthHelper.VALID_PASSWORD))
|
||||
.put(Entity.json(new AccountAttributes("keykeykeykey", false, 2222, null, null, null, null, false, null)));
|
||||
|
||||
assertThat(response.getStatus()).isEqualTo(204);
|
||||
verify(directoryQueue, times(1)).refreshRegisteredUser(AuthHelper.VALID_ACCOUNT);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user