diff --git a/README.md b/README.md index 68974e8..d608db6 100644 --- a/README.md +++ b/README.md @@ -10,10 +10,10 @@ Provide an additional toolkit library for spring framework. - reverse converter with `.reverse()` method - functional converter, used for java `stream` mapping - instance of spring converter -- JUnit 4 `@IfProfileValue` profile source enhancement +- ~~JUnit 4 `@IfProfileValue` profile source enhancement~~ Moved to https://jitpack.io/#ahunigel/spring-test-toolkit - `@ProfileValueSourceConfiguration(EnvironmentProfileValueSource.class)`, use environment as profile value source - `@ProfileValueSourceConfiguration(MergedSystemEnvAndPropertyProfileValueSource.class)`, use environment and system properties as profile value source -- JUnit 4 `@RunTestOnWindowsOnly` annotation, restrict JUnit 4 tests running only on windows operation system +- ~~JUnit 4 `@RunTestOnWindowsOnly` annotation, restrict JUnit 4 tests running only on windows operation system~~ Moved to https://jitpack.io/#ahunigel/spring-test-toolkit ## How to use @@ -44,6 +44,7 @@ public class FooApplication {} class FooConverter extends ReversibleConverter {} ``` +~~All the following testing features are moved to https://jitpack.io/#ahunigel/spring-test-toolkit~~ ```java @ProfileValueSourceConfiguration(EnvironmentProfileValueSource.class) public class FooTest { @@ -64,6 +65,7 @@ public class FooTest {} - [Using YAML Instead of Properties](https://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#boot-features-external-config-yaml) - [Spring @PropertySource using YAML](https://stackoverflow.com/questions/21271468/spring-propertysource-using-yaml) - [Spring YAML Configuration](https://www.baeldung.com/spring-yaml) +- [spring-test-toolkit](https://jitpack.io/#ahunigel/spring-test-toolkit) ## TODOs diff --git a/src/main/java/com/github/ahunigel/test/EnvironmentProfileValueSource.java b/src/main/java/com/github/ahunigel/test/EnvironmentProfileValueSource.java deleted file mode 100644 index 07ce911..0000000 --- a/src/main/java/com/github/ahunigel/test/EnvironmentProfileValueSource.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.github.ahunigel.test; - -import org.springframework.test.annotation.ProfileValueSource; - -/** - * Use environment as profile value source - *

- * Created by Nigel.Zheng on 2019/5/14. - * - * @author Nigel.Zheng - */ -public class EnvironmentProfileValueSource implements ProfileValueSource { - - @Override - public String get(String key) { - return System.getenv(key); - } -} diff --git a/src/main/java/com/github/ahunigel/test/MergedSystemEnvAndPropertyProfileValueSource.java b/src/main/java/com/github/ahunigel/test/MergedSystemEnvAndPropertyProfileValueSource.java deleted file mode 100644 index 97ca252..0000000 --- a/src/main/java/com/github/ahunigel/test/MergedSystemEnvAndPropertyProfileValueSource.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.github.ahunigel.test; - -import org.springframework.test.annotation.ProfileValueSource; - -/** - * Merge environment and system properties as profile value source - *

- * Created by Nigel.Zheng on 2019/5/14. - * - * @author Nigel.Zheng - */ -public class MergedSystemEnvAndPropertyProfileValueSource implements ProfileValueSource { - - @Override - public String get(String key) { - return System.getenv(key) != null ? System.getenv(key) : System.getProperty(key); - } -} diff --git a/src/main/java/com/github/ahunigel/test/RunTestOnWindowsOnly.java b/src/main/java/com/github/ahunigel/test/RunTestOnWindowsOnly.java deleted file mode 100644 index f25f07c..0000000 --- a/src/main/java/com/github/ahunigel/test/RunTestOnWindowsOnly.java +++ /dev/null @@ -1,22 +0,0 @@ -package com.github.ahunigel.test; - -import org.springframework.test.annotation.IfProfileValue; -import org.springframework.test.annotation.ProfileValueSourceConfiguration; - -import java.lang.annotation.*; - -/** - * Run JUnit 4 tests only on windows operation system - *

- * Created by Nigel.Zheng on 2019/5/20. - * - * @author Nigel.Zheng - */ -@Target(ElementType.TYPE) -@Retention(RetentionPolicy.RUNTIME) -@Documented -@Inherited -@ProfileValueSourceConfiguration(EnvironmentProfileValueSource.class) -@IfProfileValue(name = "OS", values = {"Windows_NT"}) -public @interface RunTestOnWindowsOnly { -}