This commit is contained in:
hxy1991 2018-12-10 19:53:15 +08:00
parent 2f630b0be6
commit 97743685ac
20 changed files with 915 additions and 929 deletions

View File

@ -24,6 +24,7 @@ import javax.servlet.ServletContext;
/**
* Running config
*
* @author <a href="mailto:zpf.073@gmail.com">nkorange</a>
*/
@Component

View File

@ -42,7 +42,6 @@ import com.alibaba.nacos.config.server.service.DataSourceService;
@WebAppConfiguration
public class HealthControllerUnitTest {
@InjectMocks
HealthController healthController;
@ -50,6 +49,7 @@ public class HealthControllerUnitTest {
DataSourceService dataSourceService;
private MockMvc mockmvc;
@Before
public void setUp() throws Exception {
mockmvc = MockMvcBuilders.standaloneSetup(healthController).build();

View File

@ -15,18 +15,16 @@
*/
package com.alibaba.nacos.config.server.service;
import java.util.ArrayList;
import java.util.List;
import static org.junit.Assert.assertEquals;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.context.web.WebAppConfiguration;
import com.alibaba.nacos.config.server.service.AggrWhitelist;
import java.util.ArrayList;
import java.util.List;
import static org.junit.Assert.assertEquals;
@RunWith(SpringJUnit4ClassRunner.class)
@WebAppConfiguration

View File

@ -15,19 +15,14 @@
*/
package com.alibaba.nacos.config.server.service;
import com.alibaba.nacos.config.server.utils.GroupKey2;
import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.context.web.WebAppConfiguration;
import com.alibaba.nacos.config.server.service.ClientTrackService;
import com.alibaba.nacos.config.server.service.ConfigService;
import com.alibaba.nacos.config.server.utils.GroupKey2;
@RunWith(SpringJUnit4ClassRunner.class)
@WebAppConfiguration
public class ClientTrackServiceTest {

View File

@ -17,21 +17,17 @@ package com.alibaba.nacos.config.server.service;
import org.junit.After;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.context.web.WebAppConfiguration;
import com.alibaba.nacos.config.server.service.DiskUtil;
import javax.servlet.ServletContext;
import static org.junit.Assert.assertEquals;
import java.io.File;
import java.io.IOException;
import static org.junit.Assert.assertEquals;
@RunWith(SpringJUnit4ClassRunner.class)
@WebAppConfiguration
public class DiskServiceUnitTest {

View File

@ -59,7 +59,6 @@ public class GroupKeyTest {
System.out.println(e.toString());
}
key = "11111%25+222";
String[] pair = GroupKey2.parseKey(key);
Assert.assertEquals("11111%", pair[0]);

View File

@ -24,7 +24,6 @@ import org.springframework.test.context.web.WebAppConfiguration;
import com.alibaba.nacos.config.server.utils.SimpleReadWriteLock;
@RunWith(SpringJUnit4ClassRunner.class)
@WebAppConfiguration
public class SimpleReadWriteLockTest {

View File

@ -32,7 +32,6 @@ import java.util.concurrent.CountDownLatch;
import static org.junit.Assert.assertEquals;
@RunWith(SpringJUnit4ClassRunner.class)
@WebAppConfiguration
public class EventDispatcherTest {
@ -78,7 +77,6 @@ public class EventDispatcherTest {
}
}
class MockEvent implements Event {
}