Commit 3a2f6f72 authored by Yiming Liu's avatar Yiming Liu

Integrate all server side components into one application

parent 2e76a342
package com.ctrip.apollo;
package com.ctrip.apollo.adminservice;
import org.springframework.boot.actuate.system.ApplicationPidFileWriter;
import org.springframework.boot.actuate.system.EmbeddedServerPortFileWriter;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import org.springframework.context.annotation.PropertySource;
@SpringBootApplication
@EnableEurekaClient
@EnableAspectJAutoProxy
@EnableEurekaClient
@Configuration
@PropertySource(value = {"classpath:adminservice.properties"})
@EnableAutoConfiguration
@ComponentScan(basePackageClasses = {com.ctrip.apollo.common.ApolloCommonConfig.class,
com.ctrip.apollo.biz.ApolloBizConfig.class,
com.ctrip.apollo.adminservice.AdminServiceApplication.class})
public class AdminServiceApplication {
public static void main(String[] args) {
ConfigurableApplicationContext context = new SpringApplicationBuilder(AdminServiceApplication.class).run(args);
ConfigurableApplicationContext context =
new SpringApplicationBuilder(AdminServiceApplication.class).run(args);
context.addApplicationListener(new ApplicationPidFileWriter());
context.addApplicationListener(new EmbeddedServerPortFileWriter());
}
......
package com.ctrip.apollo.adminservice.controller;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Pageable;
import org.springframework.security.core.userdetails.UserDetails;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
......
spring.application.name= apollo-adminservice
ctrip.appid= 100003172
server.port= 8090
logging.file= /opt/logs/100003172/apollo-adminservice.log
\ No newline at end of file
spring:
application:
name: apollo-adminservice
profiles:
active: ctrip
server:
port: ${port:8090}
logging:
level:
org.springframework.cloud: 'DEBUG'
file: /opt/logs/${ctrip.appid}/apollo-adminservice.log
ctrip:
appid: 100003172
......@@ -8,6 +8,8 @@ import org.springframework.context.annotation.ComponentScan.Filter;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.FilterType;
import com.ctrip.apollo.adminservice.AdminServiceApplication;
@Configuration
@ComponentScan(excludeFilters = {@Filter(type = FilterType.ASSIGNABLE_TYPE, value = {
SampleAdminServiceApplication.class, AdminServiceApplication.class,
......
package com.ctrip.apollo.adminservice.controller;
import com.ctrip.apollo.AdminServiceTestConfiguration;
import javax.annotation.PostConstruct;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.autoconfigure.web.HttpMessageConverters;
import org.springframework.boot.test.SpringApplicationConfiguration;
import org.springframework.boot.test.TestRestTemplate;
import org.springframework.boot.test.WebIntegrationTest;
......@@ -11,18 +13,22 @@ import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.web.client.DefaultResponseErrorHandler;
import org.springframework.web.client.RestTemplate;
import javax.annotation.PostConstruct;
import com.ctrip.apollo.AdminServiceTestConfiguration;
@RunWith(SpringJUnit4ClassRunner.class)
@SpringApplicationConfiguration(classes = AdminServiceTestConfiguration.class)
@WebIntegrationTest(randomPort = true)
public abstract class AbstractControllerTest {
@Autowired
private HttpMessageConverters httpMessageConverters;
RestTemplate restTemplate = new TestRestTemplate("apollo", "");
@PostConstruct
private void postConstruct() {
restTemplate.setErrorHandler(new DefaultResponseErrorHandler());
restTemplate.setMessageConverters(httpMessageConverters.getConverters());
}
@Value("${local.server.port}")
......
......@@ -10,6 +10,7 @@ import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.test.context.jdbc.Sql;
import org.springframework.test.context.jdbc.Sql.ExecutionPhase;
import org.springframework.web.client.RestTemplate;
import com.ctrip.apollo.biz.entity.Item;
import com.ctrip.apollo.biz.repository.ItemRepository;
......@@ -45,8 +46,9 @@ public class ItemSetControllerTest extends AbstractControllerTest {
Assert.assertEquals("application", namespace.getNamespaceName());
ItemChangeSets itemSet = new ItemChangeSets();
restTemplate = new TestRestTemplate("created", "");
RestTemplate createdTemplate = new TestRestTemplate("created", "");
createdTemplate.setMessageConverters(restTemplate.getMessageConverters());
int createdSize = 3;
for (int i = 0; i < createdSize; i++) {
ItemDTO item = new ItemDTO();
......@@ -57,7 +59,7 @@ public class ItemSetControllerTest extends AbstractControllerTest {
}
ResponseEntity<Void> response =
restTemplate.postForEntity(
createdTemplate.postForEntity(
"http://localhost:" + port + "/apps/" + app.getAppId() + "/clusters/"
+ cluster.getName() + "/namespaces/" + namespace.getNamespaceName() + "/itemset",
itemSet, Void.class);
......@@ -92,7 +94,8 @@ public class ItemSetControllerTest extends AbstractControllerTest {
Assert.assertEquals("application", namespace.getNamespaceName());
ItemChangeSets createChangeSet = new ItemChangeSets();
restTemplate = new TestRestTemplate("created", "");
RestTemplate createdRestTemplate = new TestRestTemplate("created", "");
createdRestTemplate.setMessageConverters(restTemplate.getMessageConverters());
int createdSize = 3;
for (int i = 0; i < createdSize; i++) {
......@@ -103,20 +106,21 @@ public class ItemSetControllerTest extends AbstractControllerTest {
createChangeSet.addCreateItem(item);
}
ResponseEntity<Void> response = restTemplate.postForEntity(
ResponseEntity<Void> response = createdRestTemplate.postForEntity(
"http://localhost:" + port + "/apps/" + app.getAppId() + "/clusters/" + cluster.getName()
+ "/namespaces/" + namespace.getNamespaceName() + "/itemset",
createChangeSet, Void.class);
Assert.assertEquals(HttpStatus.OK, response.getStatusCode());
ItemDTO[] items =
restTemplate.getForObject(
createdRestTemplate.getForObject(
"http://localhost:" + port + "/apps/" + app.getAppId() + "/clusters/"
+ cluster.getName() + "/namespaces/" + namespace.getNamespaceName() + "/items",
ItemDTO[].class);
ItemChangeSets udpateChangeSet = new ItemChangeSets();
restTemplate = new TestRestTemplate("updated", "");
RestTemplate updatedRestTemplate = new TestRestTemplate("updated", "");
updatedRestTemplate.setMessageConverters(restTemplate.getMessageConverters());
int updatedSize = 2;
for (int i = 0; i < updatedSize; i++) {
......@@ -124,7 +128,7 @@ public class ItemSetControllerTest extends AbstractControllerTest {
udpateChangeSet.addUpdateItem(items[i]);
}
response = restTemplate.postForEntity(
response = updatedRestTemplate.postForEntity(
"http://localhost:" + port + "/apps/" + app.getAppId() + "/clusters/" + cluster.getName()
+ "/namespaces/" + namespace.getNamespaceName() + "/itemset",
udpateChangeSet, Void.class);
......@@ -161,7 +165,8 @@ public class ItemSetControllerTest extends AbstractControllerTest {
Assert.assertEquals("application", namespace.getNamespaceName());
ItemChangeSets createChangeSet = new ItemChangeSets();
restTemplate = new TestRestTemplate("created", "");
RestTemplate createdTemplate = new TestRestTemplate("created", "");
createdTemplate.setMessageConverters(restTemplate.getMessageConverters());
int createdSize = 3;
for (int i = 0; i < createdSize; i++) {
......@@ -172,7 +177,7 @@ public class ItemSetControllerTest extends AbstractControllerTest {
createChangeSet.addCreateItem(item);
}
ResponseEntity<Void> response = restTemplate.postForEntity(
ResponseEntity<Void> response = createdTemplate.postForEntity(
"http://localhost:" + port + "/apps/" + app.getAppId() + "/clusters/" + cluster.getName()
+ "/namespaces/" + namespace.getNamespaceName() + "/itemset",
createChangeSet, Void.class);
......@@ -185,7 +190,8 @@ public class ItemSetControllerTest extends AbstractControllerTest {
ItemDTO[].class);
ItemChangeSets deleteChangeSet = new ItemChangeSets();
restTemplate = new TestRestTemplate("deleted", "");
RestTemplate deletedTemplate = new TestRestTemplate("deleted", "");
deletedTemplate.setMessageConverters(restTemplate.getMessageConverters());
int deletedSize = 1;
for (int i = 0; i < deletedSize; i++) {
......@@ -193,7 +199,7 @@ public class ItemSetControllerTest extends AbstractControllerTest {
deleteChangeSet.addDeleteItem(items[i]);
}
response = restTemplate.postForEntity(
response = deletedTemplate.postForEntity(
"http://localhost:" + port + "/apps/" + app.getAppId() + "/clusters/" + cluster.getName()
+ "/namespaces/" + namespace.getNamespaceName() + "/itemset",
deleteChangeSet, Void.class);
......
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<parent>
<groupId>com.ctrip.apollo</groupId>
<artifactId>apollo</artifactId>
<version>0.0.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>apollo-assembly</artifactId>
<name>Apollo Assembly</name>
<properties>
<github.path>${project.artifactId}</github.path>
</properties>
<dependencies>
<!-- apollo -->
<dependency>
<groupId>com.ctrip.apollo</groupId>
<artifactId>apollo-configservice</artifactId>
</dependency>
<dependency>
<groupId>com.ctrip.apollo</groupId>
<artifactId>apollo-adminservice</artifactId>
</dependency>
<dependency>
<groupId>com.ctrip.apollo</groupId>
<artifactId>apollo-portal</artifactId>
</dependency>
<dependency>
<groupId>com.h2database</groupId>
<artifactId>h2</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<executable>true</executable>
</configuration>
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<finalName>${project.artifactId}-${project.version}-${package.environment}</finalName>
<appendAssemblyId>false</appendAssemblyId>
<descriptors>
<descriptor>src/assembly/assembly-descriptor.xml</descriptor>
</descriptors>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
package com.ctrip.apollo.assembly;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.actuate.system.ApplicationPidFileWriter;
import org.springframework.boot.actuate.system.EmbeddedServerPortFileWriter;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.cloud.context.scope.refresh.RefreshScope;
import org.springframework.context.ConfigurableApplicationContext;
import com.ctrip.apollo.adminservice.AdminServiceApplication;
import com.ctrip.apollo.configservice.ConfigServiceApplication;
import com.ctrip.apollo.portal.PortalApplication;
@SpringBootApplication(exclude = {DataSourceAutoConfiguration.class,
HibernateJpaAutoConfiguration.class})
public class ApolloApplication {
private static final Logger logger = LoggerFactory.getLogger(ApolloApplication.class);
public static void main(String[] args) throws Exception {
/**
* Common
*/
ConfigurableApplicationContext commonContext =
new SpringApplicationBuilder(ApolloApplication.class).web(false).run(args);
commonContext.addApplicationListener(new ApplicationPidFileWriter());
logger.info(commonContext.getId() + " isActive: " + commonContext.isActive());
/**
* ConfigService
*/
if (commonContext.getEnvironment().containsProperty("configservice")) {
ConfigurableApplicationContext configContext =
new SpringApplicationBuilder(ConfigServiceApplication.class).parent(commonContext)
.sources(RefreshScope.class).run(args);
logger.info(configContext.getId() + " isActive: " + configContext.isActive());
}
/**
* AdminService
*/
if (commonContext.getEnvironment().containsProperty("adminservice")) {
ConfigurableApplicationContext adminContext =
new SpringApplicationBuilder(AdminServiceApplication.class).parent(commonContext)
.sources(RefreshScope.class).run(args);
logger.info(adminContext.getId() + " isActive: " + adminContext.isActive());
}
/**
* Portal
*/
if (commonContext.getEnvironment().containsProperty("portal")) {
ConfigurableApplicationContext portalContext =
new SpringApplicationBuilder(PortalApplication.class).parent(commonContext).run(args);
logger.info(portalContext.getId() + " isActive: " + portalContext.isActive());
}
}
}
spring:
application:
name: apollo-configservice
profiles:
active: ctrip
server:
port: ${port:8080}
logging:
level:
org.springframework.cloud: 'DEBUG'
file: /opt/logs/${ctrip.appid}/apollo-configservice.log
ctrip:
appid: 100003171
\ No newline at end of file
file: /opt/logs/100003171/apollo-assembly.log
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<include resource="org/springframework/boot/logging/logback/defaults.xml" />
<property name="LOG_FILE"
value="${LOG_FILE:-${LOG_PATH:-${LOG_TEMP:-${java.io.tmpdir:-/tmp}}/}apollo-assembly.log}" />
<include resource="org/springframework/boot/logging/logback/file-appender.xml" />
<root level="INFO">
<appender-ref ref="FILE" />
</root>
</configuration>
\ No newline at end of file
package com.ctrip.apollo.biz;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
@EnableAutoConfiguration
@Configuration
@ComponentScan(basePackageClasses = com.ctrip.apollo.biz.ApolloBizConfig.class)
public class ApolloBizConfig {
}
......@@ -8,6 +8,7 @@ import com.ctrip.apollo.biz.repository.ServerConfigRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cloud.netflix.eureka.EurekaClientConfigBean;
import org.springframework.context.annotation.Primary;
import org.springframework.core.env.Environment;
import org.springframework.stereotype.Component;
......@@ -15,6 +16,7 @@ import java.util.List;
import java.util.Objects;
@Component
@Primary
public class ApolloEurekaClientConfig extends EurekaClientConfigBean {
static final String EUREKA_URL_CONFIG = "eureka.service.url";
private static final Splitter URL_SPLITTER = Splitter.on(",").omitEmptyStrings();
......
package com.ctrip.apollo.common;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
@EnableAutoConfiguration
@Configuration
@ComponentScan(basePackageClasses = com.ctrip.apollo.common.ApolloCommonConfig.class)
public class ApolloCommonConfig {
}
package com.ctrip.apollo;
package com.ctrip.apollo.configservice;
import org.springframework.boot.actuate.system.ApplicationPidFileWriter;
import org.springframework.boot.actuate.system.EmbeddedServerPortFileWriter;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.cloud.netflix.eureka.server.EnableEurekaServer;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.EnableAspectJAutoProxy;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;
/**
* Spring boot application entry point
*
* @author Jason Song(song_s@ctrip.com)
*/
@SpringBootApplication
@EnableEurekaServer
@EnableAspectJAutoProxy
@EnableAutoConfiguration//(exclude = EurekaClientConfigBean.class)
@Configuration
@PropertySource(value = {"classpath:configservice.properties"})
@ComponentScan(basePackageClasses = {com.ctrip.apollo.common.ApolloCommonConfig.class,
com.ctrip.apollo.biz.ApolloBizConfig.class,
com.ctrip.apollo.configservice.ConfigServiceApplication.class})
public class ConfigServiceApplication {
public static void main(String[] args) throws Exception {
......
package com.ctrip.apollo;
package com.ctrip.apollo.configservice;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.context.web.SpringBootServletInitializer;
......
spring.application.name= apollo-configservice
ctrip.appid= 100003171
server.port= 8080
logging.file= /opt/logs/100003171/apollo-configservice.log
\ No newline at end of file
package com.ctrip.apollo;
import com.ctrip.apollo.common.controller.WebSecurityConfig;
import com.ctrip.apollo.configservice.ConfigServiceApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.context.annotation.ComponentScan;
......
package com.ctrip.apollo;
package com.ctrip.apollo.portal;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.actuate.system.ApplicationPidFileWriter;
import org.springframework.boot.actuate.system.EmbeddedServerPortFileWriter;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.PropertySource;
@SpringBootApplication
@EnableAutoConfiguration
@Configuration
@PropertySource(value = {"classpath:portal.properties"})
@ComponentScan(basePackageClasses = {com.ctrip.apollo.common.ApolloCommonConfig.class,
com.ctrip.apollo.portal.PortalApplication.class})
public class PortalApplication {
public static void main(String[] args) throws Exception {
......
......@@ -18,16 +18,16 @@ import com.ctrip.apollo.core.exception.BadRequestException;
import com.ctrip.apollo.core.utils.StringUtils;
import com.ctrip.apollo.portal.PortalSettings;
import com.ctrip.apollo.portal.entity.EnvClusterInfo;
import com.ctrip.apollo.portal.service.AppService;
import com.ctrip.apollo.portal.service.PortalAppService;
import java.util.List;
@RestController
@RequestMapping("/apps")
public class AppController {
public class PortalAppController {
@Autowired
private AppService appService;
private PortalAppService appService;
@Autowired
private PortalSettings portalSettings;
......
......@@ -10,7 +10,7 @@ import com.ctrip.apollo.portal.entity.ItemDiffs;
import com.ctrip.apollo.portal.entity.form.NamespaceSyncModel;
import com.ctrip.apollo.portal.entity.form.NamespaceTextModel;
import com.ctrip.apollo.portal.entity.form.NamespaceReleaseModel;
import com.ctrip.apollo.portal.service.ConfigService;
import com.ctrip.apollo.portal.service.PortalConfigService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
......@@ -25,10 +25,10 @@ import java.util.List;
@RestController
@RequestMapping("")
public class ConfigController {
public class PortalConfigController {
@Autowired
private ConfigService configService;
private PortalConfigService configService;
@RequestMapping(value = "/apps/{appId}/env/{env}/clusters/{clusterName}/namespaces/{namespaceName}/items", method = RequestMethod.PUT, consumes = {
"application/json"})
......
......@@ -12,7 +12,7 @@ import java.util.List;
@RestController
@RequestMapping("/envs")
public class EnvController {
public class PortalEnvController {
@Autowired
private PortalSettings portalSettings;
......
......@@ -6,7 +6,7 @@ import com.ctrip.apollo.core.enums.Env;
import com.ctrip.apollo.core.exception.BadRequestException;
import com.ctrip.apollo.core.utils.StringUtils;
import com.ctrip.apollo.portal.entity.NamespaceVO;
import com.ctrip.apollo.portal.service.NamespaceService;
import com.ctrip.apollo.portal.service.PortalNamespaceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
......@@ -18,10 +18,10 @@ import org.springframework.web.bind.annotation.RestController;
import java.util.List;
@RestController
public class NamespaceController {
public class PortalNamespaceController {
@Autowired
private NamespaceService namespaceService;
private PortalNamespaceService namespaceService;
@RequestMapping("/appnamespaces/public")
public List<AppNamespaceDTO> findPublicAppNamespaces(){
......
......@@ -20,9 +20,12 @@ import com.ctrip.apollo.portal.api.AdminServiceAPI;
import com.ctrip.apollo.portal.entity.EnvClusterInfo;
@Service
public class AppService {
public class PortalAppService {
private Logger logger = LoggerFactory.getLogger(AppService.class);
private Logger logger = LoggerFactory.getLogger(PortalAppService.class);
@Autowired
private PortalClusterService clusterService;
@Autowired
private PortalSettings portalSettings;
......@@ -30,8 +33,6 @@ public class AppService {
@Autowired
private AdminServiceAPI.AppAPI appAPI;
@Autowired ClusterService clusterService;
public List<AppDTO> findAll(Env env) {
return appAPI.findApps(env);
}
......
......@@ -10,7 +10,7 @@ import org.springframework.stereotype.Service;
import java.util.List;
@Service
public class ClusterService {
public class PortalClusterService {
@Autowired
private AdminServiceAPI.ClusterAPI clusterAPI;
......
......@@ -36,9 +36,9 @@ import java.util.List;
import java.util.Map;
@Service
public class ConfigService {
public class PortalConfigService {
private Logger logger = LoggerFactory.getLogger(ConfigService.class);
private Logger logger = LoggerFactory.getLogger(PortalConfigService.class);
@Autowired
private AdminServiceAPI.NamespaceAPI namespaceAPI;
......
......@@ -28,9 +28,9 @@ import java.util.List;
import java.util.Map;
@Service
public class NamespaceService {
public class PortalNamespaceService {
private Logger logger = LoggerFactory.getLogger(NamespaceService.class);
private Logger logger = LoggerFactory.getLogger(PortalNamespaceService.class);
@Autowired
private AdminServiceAPI.ItemAPI itemAPI;
......
server:
port: 8070
spring:
application:
name: apollo-portal
profiles:
active: ctrip
logging:
level:
org.springframework.cloud: 'DEBUG'
file: /opt/logs/${ctrip.appid}/apollo-portal.log
ctrip:
appid: 100003173
apollo:
portal:
env: dev,fat,uat
spring.application.name= apollo-portal
apollo.portal.env= dev,fat,uat
ctrip.appid= 100003173
server.port= 8070
logging.file= /opt/logs/100003173/apollo-portal.log
\ No newline at end of file
package com.ctrip.apollo.portal;
import com.ctrip.apollo.PortalApplication;
import com.ctrip.apollo.portal.PortalApplication;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Value;
......
......@@ -9,7 +9,7 @@ import com.ctrip.apollo.portal.api.AdminServiceAPI;
import com.ctrip.apollo.portal.entity.ItemDiffs;
import com.ctrip.apollo.portal.entity.NamespaceIdentifer;
import com.ctrip.apollo.portal.entity.form.NamespaceTextModel;
import com.ctrip.apollo.portal.service.ConfigService;
import com.ctrip.apollo.portal.service.PortalConfigService;
import com.ctrip.apollo.portal.service.txtresolver.PropertyResolver;
import org.junit.Assert;
......@@ -39,7 +39,7 @@ public class ConfigServiceTest {
private PropertyResolver resolver;
@InjectMocks
private ConfigService configService;
private PortalConfigService configService;
@Before
public void setup() {
......
......@@ -6,7 +6,7 @@ import com.ctrip.apollo.core.dto.ReleaseDTO;
import com.ctrip.apollo.core.enums.Env;
import com.ctrip.apollo.portal.api.AdminServiceAPI;
import com.ctrip.apollo.portal.entity.NamespaceVO;
import com.ctrip.apollo.portal.service.NamespaceService;
import com.ctrip.apollo.portal.service.PortalNamespaceService;
import com.ctrip.apollo.portal.service.txtresolver.PropertyResolver;
import org.junit.Before;
......@@ -35,7 +35,7 @@ public class NamespaceServiceTest {
private PropertyResolver resolver;
@InjectMocks
private NamespaceService namespaceService;
private PortalNamespaceService namespaceService;
@Before
public void setup() {
......
......@@ -26,13 +26,13 @@ import com.ctrip.apollo.core.dto.AppDTO;
import com.ctrip.apollo.core.enums.Env;
import com.ctrip.apollo.core.exception.ServiceException;
import com.ctrip.apollo.portal.api.AdminServiceAPI;
import com.ctrip.apollo.portal.service.AppService;
import com.ctrip.apollo.portal.service.PortalAppService;
import com.google.gson.Gson;
public class ServiceExceptionTest extends AbstractPortalTest {
@Autowired
private AppService appService;
private PortalAppService appService;
@Mock
private AdminServiceAPI.AppAPI appAPI;
......
......@@ -95,6 +95,7 @@
<module>apollo-configservice</module>
<module>apollo-adminservice</module>
<module>apollo-portal</module>
<module>apollo-assembly</module>
<module>apollo-demo</module>
</modules>
......@@ -120,6 +121,21 @@
<artifactId>apollo-buildtools</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.ctrip.apollo</groupId>
<artifactId>apollo-configservice</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.ctrip.apollo</groupId>
<artifactId>apollo-adminservice</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.ctrip.apollo</groupId>
<artifactId>apollo-portal</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.ctrip.framework</groupId>
<artifactId>framework-foundation</artifactId>
......@@ -234,7 +250,7 @@
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<version>1.3.3.RELEASE</version>
<version>1.3.4.RELEASE</version>
<executions>
<execution>
<goals>
......@@ -259,7 +275,7 @@
<dependency>
<groupId>com.puppycrawl.tools</groupId>
<artifactId>checkstyle</artifactId>
<version>6.17</version>
<version>6.18</version>
</dependency>
<dependency>
<groupId>com.ctrip.apollo</groupId>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment