NacosRepository implements ConfigurationRepository { @Override public void persist(final String key, final String value) { try { String dataId = pathToKey(key); String group = nacosProperties.getValue(NacosPropertyKey.GROUP); configService.publishConfig(dataId, group, value); } catch (final NacosException ex) { log.debug("Nacos persist config exception for: {}", ex.toString()); } }  @Override void init(final String name, final GovernanceCenterConfiguration config); @Override String get(final String key); @Override List<String> getChildrenKeys(final String key); @Override void persist(final String key, final String value); @Override void watch(final String key, final DataChangedEventListener listener); @Override void delete(final String key); @Override void close(); @Override String getType();  }
@Test public void assertPersist() throws NacosException { String value = "value"; REPOSITORY.persist("/sharding/test", value); verify(configService).publishConfig("sharding.test", group, value); }
@Test public void assertUpdate() throws NacosException { String updatedValue = "newValue"; REPOSITORY.persist("/sharding/test", updatedValue); verify(configService).publishConfig("sharding.test", group, updatedValue); }