Skip to content

Commit

Permalink
test: support Redis integration testing
Browse files Browse the repository at this point in the history
  • Loading branch information
funky-eyes committed Apr 7, 2024
1 parent a0cc3af commit 347a613
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,13 @@ void addConfigListener() throws InterruptedException {
fileConfig.addConfigListener(dataId, (CachedConfigurationChangeListener)event -> {
Assertions.assertEquals(Boolean.parseBoolean(event.getNewValue()),
!Boolean.parseBoolean(event.getOldValue()));
System.out.println("oldValue:" + event.getOldValue() + ",newValue:" + event.getNewValue());
countDownLatch.countDown();
});
System.setProperty(dataId, String.valueOf(!value));
countDownLatch.await(10, TimeUnit.SECONDS);
System.out.println(fileConfig.getBoolean(dataId));
System.out.println(value);
Assertions.assertNotEquals(fileConfig.getBoolean(dataId), value);
//wait for loop safety, loop time is LISTENER_CONFIG_INTERVAL=1s
CountDownLatch countDownLatch2 = new CountDownLatch(1);
Expand Down

0 comments on commit 347a613

Please sign in to comment.