|
|
@@ -1,10 +1,31 @@
|
|
|
package seecoder.devcloud.web;
|
|
|
|
|
|
-import org.junit.jupiter.api.Test;
|
|
|
+import com.fasterxml.jackson.core.JsonProcessingException;
|
|
|
+import com.fasterxml.jackson.databind.ObjectMapper;
|
|
|
+import org.junit.Test;
|
|
|
+import org.junit.runner.RunWith;
|
|
|
+import org.mybatis.spring.annotation.MapperScan;
|
|
|
import org.springframework.boot.test.context.SpringBootTest;
|
|
|
+import org.springframework.test.context.junit4.SpringRunner;
|
|
|
+import seecoder.devcloud.web.model.enums.PriorityEnum;
|
|
|
|
|
|
+@RunWith(SpringRunner.class)
|
|
|
@SpringBootTest
|
|
|
-class DevcloudWebApplicationTests {
|
|
|
+@MapperScan(basePackages = {"seecoder.devcloud.web.dao"})
|
|
|
+public class DevcloudWebApplicationTests {
|
|
|
|
|
|
|
|
|
+ @Test
|
|
|
+ public void testEnum(){
|
|
|
+
|
|
|
+ ObjectMapper mapper = new ObjectMapper();
|
|
|
+ try {
|
|
|
+ String s = mapper.writeValueAsString(PriorityEnum.HIGH);
|
|
|
+ System.out.println(s);
|
|
|
+ System.out.println(mapper.readValue(s,PriorityEnum.class));
|
|
|
+ } catch (JsonProcessingException e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
}
|