Commit 7cd335b1 authored by nobodyiam's avatar nobodyiam

version to 1.2.0-SNAPSHOT

parent a196fee1
......@@ -4,7 +4,7 @@
<parent>
<groupId>com.ctrip.framework.apollo</groupId>
<artifactId>apollo</artifactId>
<version>1.1.1</version>
<version>1.2.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
......
......@@ -7,7 +7,7 @@
FROM openjdk:8-jre-alpine
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 \
&& echo "http://mirrors.aliyun.com/alpine/v3.8/community" >> /etc/apk/repositories \
......
......@@ -60,7 +60,7 @@ public class ClusterController {
}
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);
......
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.service.ClusterService;
import com.ctrip.framework.apollo.common.exception.BadRequestException;
import com.ctrip.framework.apollo.core.ConfigConsts;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
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 static org.junit.Assert.*;
import static org.mockito.Matchers.any;
import static org.mockito.Mockito.when;
public class ClusterControllerTest{
public class ClusterControllerTest {
private ClusterController clusterController;
ClusterController clusterController=new ClusterController();
@Mock
ClusterService clusterService;
private ClusterService clusterService;
@Before
public void setUp() {
clusterController = new ClusterController();
MockitoAnnotations.initMocks(this);
ReflectionTestUtils.setField(clusterController, "clusterService", clusterService);
......@@ -35,16 +32,17 @@ public class ClusterControllerTest{
@Test(expected = BadRequestException.class)
public void testDeleteDefaultFail() {
Cluster cluster=new Cluster();
Cluster cluster = new Cluster();
cluster.setName(ConfigConsts.CLUSTER_NAME_DEFAULT);
when(clusterService.findOne(any(String.class), any(String.class))).thenReturn(cluster);
clusterController.delete("1","2","d");
clusterController.delete("1", "2", "d");
}
@Test()
@Test
public void testDeleteSuccess() {
Cluster cluster=new Cluster();
Cluster cluster = new Cluster();
when(clusterService.findOne(any(String.class), any(String.class))).thenReturn(cluster);
clusterController.delete("1","2","d");
clusterController.delete("1", "2", "d");
verify(clusterService, times(1)).findOne("1", "2");
}
}
......@@ -4,7 +4,7 @@
<parent>
<groupId>com.ctrip.framework.apollo</groupId>
<artifactId>apollo</artifactId>
<version>1.1.1</version>
<version>1.2.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
......
......@@ -4,7 +4,7 @@
<parent>
<groupId>com.ctrip.framework.apollo</groupId>
<artifactId>apollo</artifactId>
<version>1.1.1</version>
<version>1.2.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>apollo-biz</artifactId>
......
......@@ -4,7 +4,7 @@
<parent>
<groupId>com.ctrip.framework.apollo</groupId>
<artifactId>apollo</artifactId>
<version>1.1.1</version>
<version>1.2.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
......
......@@ -88,7 +88,7 @@ If you need this functionality, you could specify the cluster as follows:
<dependency>
<groupId>com.ctrip.framework.apollo</groupId>
<artifactId>apollo-client</artifactId>
<version>1.1.1</version>
<version>1.2.0-SNAPSHOT</version>
</dependency>
## III. Client Usage
......
......@@ -4,7 +4,7 @@
<parent>
<groupId>com.ctrip.framework.apollo</groupId>
<artifactId>apollo</artifactId>
<version>1.1.1</version>
<version>1.2.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
......
......@@ -4,7 +4,7 @@
<parent>
<groupId>com.ctrip.framework.apollo</groupId>
<artifactId>apollo</artifactId>
<version>1.1.1</version>
<version>1.2.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
......
......@@ -4,7 +4,7 @@
<parent>
<groupId>com.ctrip.framework.apollo</groupId>
<artifactId>apollo</artifactId>
<version>1.1.1</version>
<version>1.2.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
......
......@@ -7,7 +7,7 @@
FROM openjdk:8-jre-alpine
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 \
&& echo "http://mirrors.aliyun.com/alpine/v3.8/community" >> /etc/apk/repositories \
......
......@@ -4,7 +4,7 @@
<parent>
<groupId>com.ctrip.framework.apollo</groupId>
<artifactId>apollo</artifactId>
<version>1.1.1</version>
<version>1.2.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
......
......@@ -4,7 +4,7 @@
<parent>
<artifactId>apollo</artifactId>
<groupId>com.ctrip.framework.apollo</groupId>
<version>1.1.1</version>
<version>1.2.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>apollo-demo</artifactId>
......
......@@ -5,7 +5,7 @@
<parent>
<artifactId>apollo</artifactId>
<groupId>com.ctrip.framework.apollo</groupId>
<version>1.1.1</version>
<version>1.2.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
......
......@@ -5,7 +5,7 @@
<parent>
<artifactId>apollo</artifactId>
<groupId>com.ctrip.framework.apollo</groupId>
<version>1.1.1</version>
<version>1.2.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
......
......@@ -4,7 +4,7 @@
<parent>
<groupId>com.ctrip.framework.apollo</groupId>
<artifactId>apollo</artifactId>
<version>1.1.1</version>
<version>1.2.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
......
......@@ -7,7 +7,7 @@
FROM openjdk:8-jre-alpine
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 \
&& echo "http://mirrors.aliyun.com/alpine/v3.8/community" >> /etc/apk/repositories \
......
......@@ -5,7 +5,7 @@
<groupId>com.ctrip.framework.apollo</groupId>
<artifactId>apollo</artifactId>
<version>1.1.1</version>
<version>1.2.0-SNAPSHOT</version>
<name>Apollo</name>
<packaging>pom</packaging>
<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