style(api): The revised code is in compliance with the specification

This commit is contained in:
chuntaojun 2019-04-30 19:27:06 +08:00
parent 1b76780cd1
commit 320aca4d90
2 changed files with 27 additions and 21 deletions

View File

@ -31,6 +31,7 @@ import java.util.Map;
public interface MaintainService {
/**
* query service
*
* @param serviceName
* @return
@ -39,6 +40,7 @@ public interface MaintainService {
Service selectOneService(String serviceName) throws NacosException;
/**
* query service
*
* @param serviceName
* @param groupName

View File

@ -11,7 +11,9 @@ import com.alibaba.nacos.api.selector.ExpressionSelector;
import com.alibaba.nacos.api.selector.NoneSelector;
import org.junit.Assert;
import org.junit.Before;
import org.junit.FixMethodOrder;
import org.junit.Test;
import org.junit.runners.MethodSorters;
import java.util.HashMap;
import java.util.Map;
@ -20,6 +22,7 @@ import java.util.Properties;
import static com.alibaba.nacos.client.utils.LogUtils.NAMING_LOGGER;
import static org.junit.Assert.*;
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
public class NacosMaintainServiceTest {
private MaintainService maintainService;
@ -33,17 +36,7 @@ public class NacosMaintainServiceTest {
}
@Test
public void selectOneService() {
try {
Service service = maintainService.selectOneService("nacos-api");
NAMING_LOGGER.info("service : {}", service.toString());
} catch (NacosException e) {
NAMING_LOGGER.error(e.getErrMsg());
}
}
@Test
public void createService() {
public void test1createService() {
Service service = new Service();
service.setName("nacos-api");
service.setGroupName(Constants.DEFAULT_GROUP);
@ -63,16 +56,7 @@ public class NacosMaintainServiceTest {
}
@Test
public void deleteService() {
try {
Assert.assertTrue(maintainService.deleteService("nacos-api"));
} catch (NacosException e) {
NAMING_LOGGER.error(e.getErrMsg());
}
}
@Test
public void updateService() {
public void test2updateService() {
Service service = new Service();
service.setName("nacos-api");
service.setGroupName(Constants.DEFAULT_GROUP);
@ -87,4 +71,24 @@ public class NacosMaintainServiceTest {
NAMING_LOGGER.error(e.getErrMsg());
}
}
@Test
public void test3selectOneService() {
try {
Service service = maintainService.selectOneService("nacos-api");
System.out.println("service : " + service.toString());
} catch (NacosException e) {
NAMING_LOGGER.error(e.getErrMsg());
}
}
@Test
public void test4deleteService() {
try {
Assert.assertTrue(maintainService.deleteService("nacos-api"));
} catch (NacosException e) {
NAMING_LOGGER.error(e.getErrMsg());
}
}
}