Skip to content

Commit

Permalink
fix: remove useless test method of NacosConfigurationLoaderTest
Browse files Browse the repository at this point in the history
  • Loading branch information
jarvisxiong committed Dec 8, 2023
1 parent 81c9507 commit 830c4a7
Showing 1 changed file with 0 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mockito;
import org.powermock.api.mockito.PowerMockito;
import org.powermock.core.classloader.annotations.PowerMockIgnore;
import org.powermock.core.classloader.annotations.PrepareForTest;
import org.powermock.modules.junit4.PowerMockRunner;
Expand Down Expand Up @@ -190,22 +189,6 @@ public void testGetValue() throws NacosException {
Assert.assertEquals(configProperties.getValue(key2, APP_GROUP), "value2");
}

@Test
public void testParallelGetValue() throws Exception {
String key = "example.config.name";
Mockito.when(configService.getConfig(DEFAULT_DATA_ID, DEFAULT_GROUP, TIMEOUT)).thenReturn(YAML_EXAMPLE);
NacosConfigurationLoader loader = PowerMockito.spy(configYaml);

Thread thread1 = new Thread(() -> loader.getValue(key, DEFAULT_GROUP));
Thread thread2 = new Thread(() -> loader.getValue(key, DEFAULT_GROUP));
thread1.start();
thread2.start();
thread1.join();
thread2.join();
PowerMockito.verifyPrivate(loader, Mockito.times(1))
.invoke("registerListenerToGroupDataId", DEFAULT_GROUP, DEFAULT_DATA_ID);
}

@Test
@SuppressWarnings({"rawtypes", "unchecked"})
public void testGroupDataIdCaches() throws NacosException, IllegalAccessException {
Expand Down

0 comments on commit 830c4a7

Please sign in to comment.