diff --git a/spring-cloud-alicloud-context/src/test/java/org/springframework/cloud/alicloud/acm/AcmAutoConfiguration.java b/spring-cloud-alicloud-context/src/test/java/org/springframework/cloud/alicloud/acm/AcmAutoConfiguration.java deleted file mode 100644 index 1ecff17f8..000000000 --- a/spring-cloud-alicloud-context/src/test/java/org/springframework/cloud/alicloud/acm/AcmAutoConfiguration.java +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (C) 2018 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.springframework.cloud.alicloud.acm; - -/** - * @author xiaolongzuo - */ -public class AcmAutoConfiguration { -} diff --git a/spring-cloud-alicloud-context/src/test/java/org/springframework/cloud/alicloud/ans/AnsAutoConfiguration.java b/spring-cloud-alicloud-context/src/test/java/org/springframework/cloud/alicloud/ans/AnsAutoConfiguration.java deleted file mode 100644 index 1f15f8827..000000000 --- a/spring-cloud-alicloud-context/src/test/java/org/springframework/cloud/alicloud/ans/AnsAutoConfiguration.java +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (C) 2018 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.springframework.cloud.alicloud.ans; - -/** - * @author xiaolongzuo - */ -public class AnsAutoConfiguration { -} diff --git a/spring-cloud-alicloud-context/src/test/java/org/springframework/cloud/alicloud/context/AliCloudPropertiesTests.java b/spring-cloud-alicloud-context/src/test/java/org/springframework/cloud/alicloud/context/AliCloudPropertiesTests.java deleted file mode 100644 index 9ac0eb019..000000000 --- a/spring-cloud-alicloud-context/src/test/java/org/springframework/cloud/alicloud/context/AliCloudPropertiesTests.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (C) 2018 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.springframework.cloud.alicloud.context; - -/** - * @author xiaolongzuo - */ -// @RunWith(SpringRunner.class) -// @SpringBootTest(properties = { "spring.cloud.alicloud.access-key=123", -// "spring.cloud.alicloud.secret-key=123456" }) -public class AliCloudPropertiesTests { - - // @Test - // public void testConfigurationValueDefaultsAreAsExpected() { - // assertThat(config.getAccessKey()).isNull(); - // assertThat(config.getSecretKey()).isNull(); - // } - // - // @Test - // public void testConfigurationValuesAreCorrectlyLoaded() { - // assertThat(config.getAccessKey()).isEqualTo("123"); - // assertThat(config.getSecretKey()).isEqualTo("123456"); - // } - -} diff --git a/spring-cloud-alicloud-context/src/test/java/org/springframework/cloud/alicloud/context/AliCloudSpringApplicationTests.java b/spring-cloud-alicloud-context/src/test/java/org/springframework/cloud/alicloud/context/AliCloudSpringApplicationTests.java deleted file mode 100644 index d10f7037a..000000000 --- a/spring-cloud-alicloud-context/src/test/java/org/springframework/cloud/alicloud/context/AliCloudSpringApplicationTests.java +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (C) 2018 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.springframework.cloud.alicloud.context; - -/** - * @author xiaolongzuo - */ -// @RunWith(SpringRunner.class) -// @SpringBootTest(classes = AliCloudSpringApplicationTests.AliCloudDisabledApp.class, -// properties = { -// "spring.application.name=myapp", -// "spring.cloud.alicloud.edas.application.name=myapp", -// "spring.cloud.alicloud.access-key=ak", "spring.cloud.alicloud.secret-key=sk", -// "spring.cloud.alicloud.oss.endpoint=test" }, webEnvironment = RANDOM_PORT) -// @DirtiesContext -public class AliCloudSpringApplicationTests { - - // @Test - // public void contextLoads() { - // System.out.println("Context load..."); - // } - // - // @SpringBootApplication - // public static class AliCloudDisabledApp { - // - // } - -} diff --git a/spring-cloud-alicloud-context/src/test/java/org/springframework/cloud/alicloud/context/acm/AcmPropertiesTests.java b/spring-cloud-alicloud-context/src/test/java/org/springframework/cloud/alicloud/context/acm/AcmPropertiesTests.java deleted file mode 100644 index 364624057..000000000 --- a/spring-cloud-alicloud-context/src/test/java/org/springframework/cloud/alicloud/context/acm/AcmPropertiesTests.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (C) 2018 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.springframework.cloud.alicloud.context.acm; - -/** - * @author xiaolongzuo - */ -public class AcmPropertiesTests { - - // private ApplicationContextRunner contextRunner = new ApplicationContextRunner() - // .withConfiguration( - // AutoConfigurations.of(AcmContextBootstrapConfiguration.class, - // EdasContextAutoConfiguration.class, - // AliCloudContextAutoConfiguration.class)); - // - // @Test - // public void testConfigurationValueDefaultsAreAsExpected() { - // this.contextRunner.withPropertyValues().run(context -> { - // AcmProperties config = context.getBean(AcmProperties.class); - // assertThat(config.getServerMode()).isEqualTo(AliCloudServerMode.LOCAL); - // assertThat(config.getServerList()).isEqualTo("127.0.0.1"); - // assertThat(config.getServerPort()).isEqualTo("8080"); - // assertThat(config.getEndpoint()).isNull(); - // assertThat(config.getFileExtension()).isEqualTo("properties"); - // assertThat(config.getGroup()).isEqualTo("DEFAULT_GROUP"); - // assertThat(config.getNamespace()).isNull(); - // assertThat(config.getRamRoleName()).isNull(); - // assertThat(config.getTimeout()).isEqualTo(3000); - // }); - // } - // - // @Test - // public void testConfigurationValuesAreCorrectlyLoaded() { - // this.contextRunner.withPropertyValues("spring.cloud.alicloud.access-key=ak", - // "spring.cloud.alicloud.secret-key=sk", - // "spring.cloud.alicloud.acm.server-mode=EDAS", - // "spring.cloud.alicloud.acm.server-port=11111", - // "spring.cloud.alicloud.acm.server-list=10.10.10.10", - // "spring.cloud.alicloud.acm.namespace=testNamespace", - // "spring.cloud.alicloud.acm.endpoint=testDomain", - // "spring.cloud.alicloud.acm.group=testGroup", - // "spring.cloud.alicloud.acm.file-extension=yaml").run(context -> { - // AcmProperties config = context.getBean(AcmProperties.class); - // assertThat(config.getServerMode()).isEqualTo(AliCloudServerMode.EDAS); - // assertThat(config.getServerList()).isEqualTo("10.10.10.10"); - // assertThat(config.getServerPort()).isEqualTo("11111"); - // assertThat(config.getEndpoint()).isEqualTo("testDomain"); - // assertThat(config.getGroup()).isEqualTo("testGroup"); - // assertThat(config.getFileExtension()).isEqualTo("yaml"); - // assertThat(config.getNamespace()).isEqualTo("testNamespace"); - // }); - // } - -} diff --git a/spring-cloud-alicloud-context/src/test/java/org/springframework/cloud/alicloud/context/ans/AnsPropertiesTests.java b/spring-cloud-alicloud-context/src/test/java/org/springframework/cloud/alicloud/context/ans/AnsPropertiesTests.java deleted file mode 100644 index 99d244925..000000000 --- a/spring-cloud-alicloud-context/src/test/java/org/springframework/cloud/alicloud/context/ans/AnsPropertiesTests.java +++ /dev/null @@ -1,91 +0,0 @@ -/* - * Copyright (C) 2018 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.springframework.cloud.alicloud.context.ans; - -/** - * @author xiaolongzuo - */ -public class AnsPropertiesTests { - - // private ApplicationContextRunner contextRunner = new ApplicationContextRunner() - // .withConfiguration(AutoConfigurations.of(AnsContextAutoConfiguration.class, - // EdasContextAutoConfiguration.class, - // AliCloudContextAutoConfiguration.class)); - // - // @Test - // public void testConfigurationValueDefaultsAreAsExpected() - // throws ClassNotFoundException { - // this.contextRunner.withPropertyValues().run(context -> { - // AnsProperties config = context.getBean(AnsProperties.class); - // assertThat(config.getServerMode()).isEqualTo(AliCloudServerMode.LOCAL); - // assertThat(config.getServerList()).isEqualTo("127.0.0.1"); - // assertThat(config.getServerPort()).isEqualTo("8080"); - // assertThat(config.getClientDomains()).isEqualTo(""); - // assertThat(config.getClientWeight()).isEqualTo(1.0F); - // assertThat(config.getClientWeights().size()).isEqualTo(0); - // assertThat(config.getClientTokens().size()).isEqualTo(0); - // assertThat(config.getClientMetadata().size()).isEqualTo(0); - // assertThat(config.getClientToken()).isNull(); - // assertThat(config.getClientCluster()).isEqualTo("DEFAULT"); - // assertThat(config.isRegisterEnabled()).isTrue(); - // assertThat(config.getClientInterfaceName()).isNull(); - // assertThat(config.getClientPort()).isEqualTo(-1); - // assertThat(config.getEnv()).isEqualTo("DEFAULT"); - // assertThat(config.isSecure()).isFalse(); - // assertThat(config.getTags().size()).isEqualTo(1); - // assertThat(config.getTags().keySet().iterator().next()) - // .isEqualTo("ANS_SERVICE_TYPE"); - // assertThat(config.getTags().get("ANS_SERVICE_TYPE")) - // .isEqualTo("SPRING_CLOUD"); - // }); - // } - // - // @Test - // public void testConfigurationValuesAreCorrectlyLoaded() { - // this.contextRunner - // .withPropertyValues("spring.cloud.alicloud.ans.server-mode=EDAS", - // "spring.cloud.alicloud.ans.server-port=11111", - // "spring.cloud.alicloud.ans.server-list=10.10.10.10", - // "spring.cloud.alicloud.ans.client-domains=testDomain", - // "spring.cloud.alicloud.ans.client-weight=0.9", - // "spring.cloud.alicloud.ans.client-weights.testDomain=0.9") - // .run(context -> { - // AnsProperties config = context.getBean(AnsProperties.class); - // assertThat(config.getServerMode()).isEqualTo(AliCloudServerMode.EDAS); - // assertThat(config.getServerList()).isEqualTo("10.10.10.10"); - // assertThat(config.getServerPort()).isEqualTo("11111"); - // assertThat(config.getClientDomains()).isEqualTo("testDomain"); - // assertThat(config.getClientWeight()).isEqualTo(0.9F); - // assertThat(config.getClientWeights().size()).isEqualTo(1); - // assertThat(config.getClientTokens().size()).isEqualTo(0); - // assertThat(config.getClientMetadata().size()).isEqualTo(0); - // assertThat(config.getClientToken()).isNull(); - // assertThat(config.getClientCluster()).isEqualTo("DEFAULT"); - // assertThat(config.isRegisterEnabled()).isTrue(); - // assertThat(config.getClientInterfaceName()).isNull(); - // assertThat(config.getClientPort()).isEqualTo(-1); - // assertThat(config.getEnv()).isEqualTo("DEFAULT"); - // assertThat(config.isSecure()).isFalse(); - // assertThat(config.getTags().size()).isEqualTo(1); - // assertThat(config.getTags().keySet().iterator().next()) - // .isEqualTo("ANS_SERVICE_TYPE"); - // assertThat(config.getTags().get("ANS_SERVICE_TYPE")) - // .isEqualTo("SPRING_CLOUD"); - // }); - // } - -} diff --git a/spring-cloud-alicloud-context/src/test/java/org/springframework/cloud/alicloud/context/edas/EdasPropertiesTests.java b/spring-cloud-alicloud-context/src/test/java/org/springframework/cloud/alicloud/context/edas/EdasPropertiesTests.java deleted file mode 100644 index abdcf4c13..000000000 --- a/spring-cloud-alicloud-context/src/test/java/org/springframework/cloud/alicloud/context/edas/EdasPropertiesTests.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright (C) 2018 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.springframework.cloud.alicloud.context.edas; - -/** - * @author xiaolongzuo - */ -public class EdasPropertiesTests { - - // private ApplicationContextRunner contextRunner = new ApplicationContextRunner() - // .withConfiguration(AutoConfigurations.of(EdasContextAutoConfiguration.class, - // AliCloudContextAutoConfiguration.class)); - // - // @Test - // public void testConfigurationValueDefaultsAreAsExpected() { - // this.contextRunner.withPropertyValues().run(context -> { - // EdasProperties config = context.getBean(EdasProperties.class); - // assertThat(config.getNamespace()).isNull(); - // assertThat(config.isApplicationNameValid()).isFalse(); - // }); - // } - // - // @Test - // public void testConfigurationValuesAreCorrectlyLoaded1() { - // this.contextRunner - // .withPropertyValues("spring.cloud.alicloud.edas.namespace=testns", - // "spring.application.name=myapps") - // .run(context -> { - // EdasProperties config = context.getBean(EdasProperties.class); - // assertThat(config.getNamespace()).isEqualTo("testns"); - // assertThat(config.getApplicationName()).isEqualTo("myapps"); - // }); - // } - // - // @Test - // public void testConfigurationValuesAreCorrectlyLoaded2() { - // this.contextRunner - // .withPropertyValues("spring.cloud.alicloud.edas.namespace=testns", - // "spring.cloud.alicloud.edas.application.name=myapps") - // .run(context -> { - // EdasProperties config = context.getBean(EdasProperties.class); - // assertThat(config.getNamespace()).isEqualTo("testns"); - // assertThat(config.getApplicationName()).isEqualTo("myapps"); - // }); - // } - -} diff --git a/spring-cloud-alicloud-context/src/test/java/org/springframework/cloud/alicloud/context/oss/OssAutoConfigurationTests.java b/spring-cloud-alicloud-context/src/test/java/org/springframework/cloud/alicloud/context/oss/OssAutoConfigurationTests.java deleted file mode 100644 index 2e71995c6..000000000 --- a/spring-cloud-alicloud-context/src/test/java/org/springframework/cloud/alicloud/context/oss/OssAutoConfigurationTests.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright (C) 2018 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.springframework.cloud.alicloud.context.oss; - -import com.aliyun.oss.OSS; - -/** - * {@link OSS} {@link OssProperties} Test - * - * @author Jim - */ -public class OssAutoConfigurationTests { - - // private ApplicationContextRunner contextRunner = new ApplicationContextRunner() - // .withConfiguration(AutoConfigurations.of(OssContextAutoConfiguration.class)) - // .withPropertyValues("spring.cloud.alicloud.accessKey=your-ak") - // .withPropertyValues("spring.cloud.alicloud.secretKey=your-sk") - // .withPropertyValues( - // "spring.cloud.alicloud.oss.endpoint=http://oss-cn-beijing.aliyuncs.com") - // .withPropertyValues("spring.cloud.alicloud.oss.config.userAgent=alibaba"); - // - // @Test - // public void testOSSProperties() { - // this.contextRunner.run(context -> { - // assertThat(context.getBeansOfType(OssProperties.class).size() == 1).isTrue(); - // AliCloudProperties aliCloudProperties = context - // .getBean(AliCloudProperties.class); - // OssProperties ossProperties = context.getBean(OssProperties.class); - // assertThat(aliCloudProperties.getAccessKey()).isEqualTo("your-ak"); - // assertThat(aliCloudProperties.getSecretKey()).isEqualTo("your-sk"); - // assertThat(ossProperties.getEndpoint()) - // .isEqualTo("http://oss-cn-beijing.aliyuncs.com"); - // assertThat(ossProperties.getConfig().getUserAgent()).isEqualTo("alibaba"); - // }); - // } - // - // @Test - // public void testOSSClient() { - // this.contextRunner.run(context -> { - // assertThat(context.getBeansOfType(OSS.class).size() == 1).isTrue(); - // assertThat(context.getBeanNamesForType(OSS.class)[0]).isEqualTo("ossClient"); - // OSSClient ossClient = (OSSClient) context.getBean(OSS.class); - // assertThat(ossClient.getEndpoint().toString()) - // .isEqualTo("http://oss-cn-beijing.aliyuncs.com"); - // assertThat(ossClient.getClientConfiguration().getUserAgent()) - // .isEqualTo("alibaba"); - // assertThat( - // ossClient.getCredentialsProvider().getCredentials().getAccessKeyId()) - // .isEqualTo("your-ak"); - // assertThat(ossClient.getCredentialsProvider().getCredentials() - // .getSecretAccessKey()).isEqualTo("your-sk"); - // }); - // } - -} diff --git a/spring-cloud-alicloud-context/src/test/java/org/springframework/cloud/alicloud/oss/OssAutoConfiguration.java b/spring-cloud-alicloud-context/src/test/java/org/springframework/cloud/alicloud/oss/OssAutoConfiguration.java deleted file mode 100644 index 2f6961c6d..000000000 --- a/spring-cloud-alicloud-context/src/test/java/org/springframework/cloud/alicloud/oss/OssAutoConfiguration.java +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (C) 2018 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.springframework.cloud.alicloud.oss; - -/** - * @author xiaolongzuo - */ -public class OssAutoConfiguration { -}