Commit 7cd335b1 authored by nobodyiam's avatar nobodyiam

version to 1.2.0-SNAPSHOT

parent a196fee1
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<parent> <parent>
<groupId>com.ctrip.framework.apollo</groupId> <groupId>com.ctrip.framework.apollo</groupId>
<artifactId>apollo</artifactId> <artifactId>apollo</artifactId>
<version>1.1.1</version> <version>1.2.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
FROM openjdk:8-jre-alpine FROM openjdk:8-jre-alpine
MAINTAINER ameizi <sxyx2008@163.com> MAINTAINER ameizi <sxyx2008@163.com>
ENV VERSION 1.1.1 ENV VERSION 1.2.0-SNAPSHOT
RUN echo "http://mirrors.aliyun.com/alpine/v3.8/main" > /etc/apk/repositories \ RUN echo "http://mirrors.aliyun.com/alpine/v3.8/main" > /etc/apk/repositories \
&& echo "http://mirrors.aliyun.com/alpine/v3.8/community" >> /etc/apk/repositories \ && echo "http://mirrors.aliyun.com/alpine/v3.8/community" >> /etc/apk/repositories \
......
...@@ -60,7 +60,7 @@ public class ClusterController { ...@@ -60,7 +60,7 @@ public class ClusterController {
} }
if(ConfigConsts.CLUSTER_NAME_DEFAULT.equals(entity.getName())){ if(ConfigConsts.CLUSTER_NAME_DEFAULT.equals(entity.getName())){
throw new BadRequestException("default cluster can not be delete."); throw new BadRequestException("can not delete default cluster!");
} }
clusterService.delete(entity.getId(), operator); clusterService.delete(entity.getId(), operator);
......
package com.ctrip.framework.apollo.adminservice.controller; package com.ctrip.framework.apollo.adminservice.controller;
import static org.mockito.Matchers.any;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import com.ctrip.framework.apollo.biz.entity.Cluster; import com.ctrip.framework.apollo.biz.entity.Cluster;
import com.ctrip.framework.apollo.biz.service.ClusterService; import com.ctrip.framework.apollo.biz.service.ClusterService;
import com.ctrip.framework.apollo.common.exception.BadRequestException; import com.ctrip.framework.apollo.common.exception.BadRequestException;
import com.ctrip.framework.apollo.core.ConfigConsts; import com.ctrip.framework.apollo.core.ConfigConsts;
import org.junit.Before; import org.junit.Before;
import org.junit.Test; import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock; import org.mockito.Mock;
import org.mockito.MockitoAnnotations; import org.mockito.MockitoAnnotations;
import org.mockito.runners.MockitoJUnitRunner;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
import org.springframework.test.util.ReflectionTestUtils; import org.springframework.test.util.ReflectionTestUtils;
import static org.junit.Assert.*; public class ClusterControllerTest {
import static org.mockito.Matchers.any; private ClusterController clusterController;
import static org.mockito.Mockito.when;
@Mock
public class ClusterControllerTest{ private ClusterService clusterService;
ClusterController clusterController=new ClusterController(); @Before
@Mock public void setUp() {
ClusterService clusterService; clusterController = new ClusterController();
MockitoAnnotations.initMocks(this);
@Before
public void setUp() { ReflectionTestUtils.setField(clusterController, "clusterService", clusterService);
MockitoAnnotations.initMocks(this); }
ReflectionTestUtils.setField(clusterController, "clusterService", clusterService);
} @Test(expected = BadRequestException.class)
public void testDeleteDefaultFail() {
Cluster cluster = new Cluster();
@Test(expected = BadRequestException.class) cluster.setName(ConfigConsts.CLUSTER_NAME_DEFAULT);
public void testDeleteDefaultFail() { when(clusterService.findOne(any(String.class), any(String.class))).thenReturn(cluster);
Cluster cluster=new Cluster(); clusterController.delete("1", "2", "d");
cluster.setName(ConfigConsts.CLUSTER_NAME_DEFAULT); }
when(clusterService.findOne(any(String.class), any(String.class))).thenReturn(cluster);
clusterController.delete("1","2","d"); @Test
} public void testDeleteSuccess() {
Cluster cluster = new Cluster();
@Test() when(clusterService.findOne(any(String.class), any(String.class))).thenReturn(cluster);
public void testDeleteSuccess() { clusterController.delete("1", "2", "d");
Cluster cluster=new Cluster(); verify(clusterService, times(1)).findOne("1", "2");
when(clusterService.findOne(any(String.class), any(String.class))).thenReturn(cluster); }
clusterController.delete("1","2","d"); }
}
}
\ No newline at end of file
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<parent> <parent>
<groupId>com.ctrip.framework.apollo</groupId> <groupId>com.ctrip.framework.apollo</groupId>
<artifactId>apollo</artifactId> <artifactId>apollo</artifactId>
<version>1.1.1</version> <version>1.2.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<parent> <parent>
<groupId>com.ctrip.framework.apollo</groupId> <groupId>com.ctrip.framework.apollo</groupId>
<artifactId>apollo</artifactId> <artifactId>apollo</artifactId>
<version>1.1.1</version> <version>1.2.0-SNAPSHOT</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>apollo-biz</artifactId> <artifactId>apollo-biz</artifactId>
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<parent> <parent>
<groupId>com.ctrip.framework.apollo</groupId> <groupId>com.ctrip.framework.apollo</groupId>
<artifactId>apollo</artifactId> <artifactId>apollo</artifactId>
<version>1.1.1</version> <version>1.2.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
......
...@@ -88,7 +88,7 @@ If you need this functionality, you could specify the cluster as follows: ...@@ -88,7 +88,7 @@ If you need this functionality, you could specify the cluster as follows:
<dependency> <dependency>
<groupId>com.ctrip.framework.apollo</groupId> <groupId>com.ctrip.framework.apollo</groupId>
<artifactId>apollo-client</artifactId> <artifactId>apollo-client</artifactId>
<version>1.1.1</version> <version>1.2.0-SNAPSHOT</version>
</dependency> </dependency>
## III. Client Usage ## III. Client Usage
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<parent> <parent>
<groupId>com.ctrip.framework.apollo</groupId> <groupId>com.ctrip.framework.apollo</groupId>
<artifactId>apollo</artifactId> <artifactId>apollo</artifactId>
<version>1.1.1</version> <version>1.2.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<parent> <parent>
<groupId>com.ctrip.framework.apollo</groupId> <groupId>com.ctrip.framework.apollo</groupId>
<artifactId>apollo</artifactId> <artifactId>apollo</artifactId>
<version>1.1.1</version> <version>1.2.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<parent> <parent>
<groupId>com.ctrip.framework.apollo</groupId> <groupId>com.ctrip.framework.apollo</groupId>
<artifactId>apollo</artifactId> <artifactId>apollo</artifactId>
<version>1.1.1</version> <version>1.2.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
FROM openjdk:8-jre-alpine FROM openjdk:8-jre-alpine
MAINTAINER ameizi <sxyx2008@163.com> MAINTAINER ameizi <sxyx2008@163.com>
ENV VERSION 1.1.1 ENV VERSION 1.2.0-SNAPSHOT
RUN echo "http://mirrors.aliyun.com/alpine/v3.8/main" > /etc/apk/repositories \ RUN echo "http://mirrors.aliyun.com/alpine/v3.8/main" > /etc/apk/repositories \
&& echo "http://mirrors.aliyun.com/alpine/v3.8/community" >> /etc/apk/repositories \ && echo "http://mirrors.aliyun.com/alpine/v3.8/community" >> /etc/apk/repositories \
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<parent> <parent>
<groupId>com.ctrip.framework.apollo</groupId> <groupId>com.ctrip.framework.apollo</groupId>
<artifactId>apollo</artifactId> <artifactId>apollo</artifactId>
<version>1.1.1</version> <version>1.2.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<parent> <parent>
<artifactId>apollo</artifactId> <artifactId>apollo</artifactId>
<groupId>com.ctrip.framework.apollo</groupId> <groupId>com.ctrip.framework.apollo</groupId>
<version>1.1.1</version> <version>1.2.0-SNAPSHOT</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>apollo-demo</artifactId> <artifactId>apollo-demo</artifactId>
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<parent> <parent>
<artifactId>apollo</artifactId> <artifactId>apollo</artifactId>
<groupId>com.ctrip.framework.apollo</groupId> <groupId>com.ctrip.framework.apollo</groupId>
<version>1.1.1</version> <version>1.2.0-SNAPSHOT</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<parent> <parent>
<artifactId>apollo</artifactId> <artifactId>apollo</artifactId>
<groupId>com.ctrip.framework.apollo</groupId> <groupId>com.ctrip.framework.apollo</groupId>
<version>1.1.1</version> <version>1.2.0-SNAPSHOT</version>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<parent> <parent>
<groupId>com.ctrip.framework.apollo</groupId> <groupId>com.ctrip.framework.apollo</groupId>
<artifactId>apollo</artifactId> <artifactId>apollo</artifactId>
<version>1.1.1</version> <version>1.2.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath> <relativePath>../pom.xml</relativePath>
</parent> </parent>
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
FROM openjdk:8-jre-alpine FROM openjdk:8-jre-alpine
MAINTAINER ameizi <sxyx2008@163.com> MAINTAINER ameizi <sxyx2008@163.com>
ENV VERSION 1.1.1 ENV VERSION 1.2.0-SNAPSHOT
RUN echo "http://mirrors.aliyun.com/alpine/v3.8/main" > /etc/apk/repositories \ RUN echo "http://mirrors.aliyun.com/alpine/v3.8/main" > /etc/apk/repositories \
&& echo "http://mirrors.aliyun.com/alpine/v3.8/community" >> /etc/apk/repositories \ && echo "http://mirrors.aliyun.com/alpine/v3.8/community" >> /etc/apk/repositories \
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
<groupId>com.ctrip.framework.apollo</groupId> <groupId>com.ctrip.framework.apollo</groupId>
<artifactId>apollo</artifactId> <artifactId>apollo</artifactId>
<version>1.1.1</version> <version>1.2.0-SNAPSHOT</version>
<name>Apollo</name> <name>Apollo</name>
<packaging>pom</packaging> <packaging>pom</packaging>
<description>Ctrip Configuration Center</description> <description>Ctrip Configuration Center</description>
......
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