mirror of
https://github.com/google/nomulus
synced 2026-09-02 22:27:07 +00:00
Maintain only one row in the TmchCrl table at all times (#869)
* Maintain only one row in the TmchCrl table at all times
This commit is contained in:
@@ -47,6 +47,23 @@ public class TmchCrlTest extends EntityTestCase {
|
||||
assertThat(loadFromSql()).isEqualTo(expected);
|
||||
}
|
||||
|
||||
@Test
|
||||
void testMultipleWrites() {
|
||||
TmchCrl.set("first", "https://first.cat");
|
||||
assertThat(TmchCrl.get().get().getCrl()).isEqualTo("first");
|
||||
TmchCrl.set("second", "https://second.cat");
|
||||
assertThat(TmchCrl.get().get().getCrl()).isEqualTo("second");
|
||||
jpaTm()
|
||||
.transact(
|
||||
() ->
|
||||
assertThat(
|
||||
jpaTm()
|
||||
.getEntityManager()
|
||||
.createQuery("SELECT COUNT(*) FROM TmchCrl", Long.class)
|
||||
.getSingleResult())
|
||||
.isEqualTo(1L));
|
||||
}
|
||||
|
||||
private static TmchCrl loadFromSql() {
|
||||
return jpaTm()
|
||||
.transact(
|
||||
|
||||
Reference in New Issue
Block a user