-
Notifications
You must be signed in to change notification settings - Fork 269
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a transactional parameter to @action
This also removes inner transactions on some Registrar methods with some resultant refactoring.
- Loading branch information
Showing
15 changed files
with
264 additions
and
117 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -69,7 +69,7 @@ private void runAction() { | |
action.gSuiteDomainName = "domain-registry.example"; | ||
action.response = response; | ||
action.retrier = new Retrier(new FakeSleeper(new FakeClock()), 3); | ||
action.run(); | ||
tm().transact(action::run); | ||
} | ||
|
||
@Test | ||
|
@@ -182,7 +182,11 @@ void test_doPost_addsAndRemovesContacts_acrossMultipleRegistrars() throws Except | |
"[email protected]", | ||
Role.MEMBER); | ||
verify(response).setStatus(SC_OK); | ||
assertThat(Iterables.filter(Registrar.loadAll(), Registrar::getContactsRequireSyncing)) | ||
assertThat( | ||
tm().transact( | ||
() -> | ||
Iterables.filter( | ||
Registrar.loadAll(), Registrar::getContactsRequireSyncing))) | ||
.isEmpty(); | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,6 +18,7 @@ | |
import static google.registry.persistence.transaction.JpaTransactionManagerExtension.makeRegistrar2; | ||
import static google.registry.persistence.transaction.JpaTransactionManagerExtension.makeRegistrarContact2; | ||
import static google.registry.persistence.transaction.JpaTransactionManagerExtension.makeRegistrarContact3; | ||
import static google.registry.persistence.transaction.TransactionManagerFactory.tm; | ||
import static google.registry.server.Fixture.BASIC; | ||
import static google.registry.server.Route.route; | ||
import static google.registry.testing.DatabaseHelper.createTld; | ||
|
@@ -172,13 +173,15 @@ void settingsContactEdit_setRegistryLockPassword() throws Throwable { | |
driver.diffPage("contact_view"); | ||
|
||
RegistrarPoc contact = | ||
loadRegistrar("TheRegistrar").getContacts().stream() | ||
.filter(c -> "[email protected]".equals(c.getEmailAddress())) | ||
.findFirst() | ||
.get(); | ||
assertThat(contact.verifyRegistryLockPassword("password")).isTrue(); | ||
assertThat(contact.getRegistryLockEmailAddress()) | ||
.isEqualTo(Optional.of("[email protected]")); | ||
tm().transact( | ||
() -> | ||
loadRegistrar("TheRegistrar").getContacts().stream() | ||
.filter(c -> "[email protected]".equals(c.getEmailAddress())) | ||
.findFirst() | ||
.get()); | ||
assertThat(contact.verifyRegistryLockPassword("password")).isTrue(); | ||
assertThat(contact.getRegistryLockEmailAddress()) | ||
.isEqualTo(Optional.of("[email protected]")); | ||
} | ||
|
||
@RetryingTest(3) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.