use of com.alibaba.nacos.config.server.service.repository.PersistService in project nacos by alibaba.
the class ConfigDerbyRaft_DITCase method test_c_publish_config.
@Test
public void test_c_publish_config() throws Exception {
ThreadUtils.sleep(5000);
boolean result = iconfig9.publishConfig("raft_test", "cluster_test_2", "this.is.raft_cluster=lessspring_9");
Assert.assertTrue(result);
ThreadUtils.sleep(5000);
ConfigurableApplicationContext context7 = applications.get("8847");
ConfigurableApplicationContext context8 = applications.get("8848");
ConfigurableApplicationContext context9 = applications.get("8849");
PersistService operate7 = context7.getBean(EmbeddedStoragePersistServiceImpl.class);
PersistService operate8 = context8.getBean(EmbeddedStoragePersistServiceImpl.class);
PersistService operate9 = context9.getBean(EmbeddedStoragePersistServiceImpl.class);
String s7 = operate7.findConfigInfo("raft_test", "cluster_test_2", "").getContent();
String s8 = operate8.findConfigInfo("raft_test", "cluster_test_2", "").getContent();
String s9 = operate9.findConfigInfo("raft_test", "cluster_test_2", "").getContent();
Assert.assertArrayEquals("The three nodes must have consistent data", new String[] { s7, s8, s9 }, new String[] { "this.is.raft_cluster=lessspring_9", "this.is.raft_cluster=lessspring_9", "this.is.raft_cluster=lessspring_9" });
}
Aggregations