From 36813e93cc16bf6acc1f63c6ace441295d15da6e Mon Sep 17 00:00:00 2001 From: xonix Date: Wed, 5 Apr 2023 15:05:46 +0300 Subject: [PATCH] Extract demo-related code to own sub-package #92 --- .../com/cmlteam/cmltemplate/Application.java | 3 +- .../cmlteam/cmltemplate/config/AppConfig.java | 7 ++--- .../cmltemplate/config/LiquibaseConfig.java | 3 +- .../MainController.java => demo/DemoApi.java} | 14 ++++------ .../DemoService.java} | 9 +++--- .../TestWsUser.java => demo/DemoWsUser.java} | 4 +-- .../validation/UserApi.java | 2 +- .../validation/UserReq.java | 2 +- .../validation/UserResp.java | 2 +- .../cmltemplate/services/AwsS3Props.java | 3 +- .../cmltemplate/services/AwsS3Service.java | 15 +++++----- .../cmltemplate/services/EmailService.java | 5 ++-- .../cmltemplate/services/RabbitService.java | 3 +- .../cmlteam/cmltemplate/util/JsonUtil.java | 3 +- .../com/cmlteam/cmltemplate/CorsOffTest.java | 8 +++--- .../com/cmlteam/cmltemplate/CorsOnTest.java | 8 +++--- .../DemoApiTest.java} | 28 +++++++++---------- .../validation}/BadRequestTests.java | 7 ++--- .../cmltemplate/util/JsonUtilTest.java | 11 ++++---- 19 files changed, 61 insertions(+), 76 deletions(-) rename src/main/java/com/cmlteam/cmltemplate/{controllers/MainController.java => demo/DemoApi.java} (80%) rename src/main/java/com/cmlteam/cmltemplate/{services/SampleService.java => demo/DemoService.java} (85%) rename src/main/java/com/cmlteam/cmltemplate/{model/TestWsUser.java => demo/DemoWsUser.java} (84%) rename src/main/java/com/cmlteam/cmltemplate/{controllers => demo}/validation/UserApi.java (90%) rename src/main/java/com/cmlteam/cmltemplate/{controllers => demo}/validation/UserReq.java (86%) rename src/main/java/com/cmlteam/cmltemplate/{controllers => demo}/validation/UserResp.java (73%) rename src/test/java/com/cmlteam/cmltemplate/{MainControllerTest.java => demo/DemoApiTest.java} (85%) rename src/test/java/com/cmlteam/cmltemplate/{ => demo/validation}/BadRequestTests.java (90%) diff --git a/src/main/java/com/cmlteam/cmltemplate/Application.java b/src/main/java/com/cmlteam/cmltemplate/Application.java index 391f2a1..5cf89ee 100644 --- a/src/main/java/com/cmlteam/cmltemplate/Application.java +++ b/src/main/java/com/cmlteam/cmltemplate/Application.java @@ -1,11 +1,10 @@ package com.cmlteam.cmltemplate; +import javax.annotation.PostConstruct; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.context.annotation.ComponentScan; -import javax.annotation.PostConstruct; - @SpringBootApplication @ComponentScan(basePackages = "com.cmlteam") public class Application { diff --git a/src/main/java/com/cmlteam/cmltemplate/config/AppConfig.java b/src/main/java/com/cmlteam/cmltemplate/config/AppConfig.java index dbc1252..38403d9 100644 --- a/src/main/java/com/cmlteam/cmltemplate/config/AppConfig.java +++ b/src/main/java/com/cmlteam/cmltemplate/config/AppConfig.java @@ -1,5 +1,8 @@ package com.cmlteam.cmltemplate.config; +import java.util.concurrent.Executor; +import java.util.concurrent.Executors; +import javax.sql.DataSource; import org.springframework.aop.interceptor.AsyncUncaughtExceptionHandler; import org.springframework.aop.interceptor.SimpleAsyncUncaughtExceptionHandler; import org.springframework.boot.autoconfigure.EnableAutoConfiguration; @@ -16,10 +19,6 @@ import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; import org.springframework.scheduling.config.ScheduledTaskRegistrar; -import javax.sql.DataSource; -import java.util.concurrent.Executor; -import java.util.concurrent.Executors; - @Configuration @EnableAutoConfiguration(exclude = {JacksonAutoConfiguration.class}) @ConfigurationPropertiesScan(basePackages = "com.cmlteam") diff --git a/src/main/java/com/cmlteam/cmltemplate/config/LiquibaseConfig.java b/src/main/java/com/cmlteam/cmltemplate/config/LiquibaseConfig.java index c4cd2ed..8d8c058 100644 --- a/src/main/java/com/cmlteam/cmltemplate/config/LiquibaseConfig.java +++ b/src/main/java/com/cmlteam/cmltemplate/config/LiquibaseConfig.java @@ -1,5 +1,6 @@ package com.cmlteam.cmltemplate.config; +import javax.sql.DataSource; import liquibase.integration.spring.SpringLiquibase; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; @@ -9,8 +10,6 @@ import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.DependsOn; -import javax.sql.DataSource; - /** The purpose here is to make Liquibase run AFTER Hibernate's hbm2ddl */ @Configuration @ConditionalOnProperty("liquibase.manual") diff --git a/src/main/java/com/cmlteam/cmltemplate/controllers/MainController.java b/src/main/java/com/cmlteam/cmltemplate/demo/DemoApi.java similarity index 80% rename from src/main/java/com/cmlteam/cmltemplate/controllers/MainController.java rename to src/main/java/com/cmlteam/cmltemplate/demo/DemoApi.java index 8f38c0b..62e90fd 100644 --- a/src/main/java/com/cmlteam/cmltemplate/controllers/MainController.java +++ b/src/main/java/com/cmlteam/cmltemplate/demo/DemoApi.java @@ -1,7 +1,5 @@ -package com.cmlteam.cmltemplate.controllers; +package com.cmlteam.cmltemplate.demo; -import com.cmlteam.cmltemplate.model.TestWsUser; -import com.cmlteam.cmltemplate.services.SampleService; import io.swagger.annotations.ApiOperation; import java.util.HashMap; import java.util.Map; @@ -17,9 +15,9 @@ @Slf4j @RequiredArgsConstructor @RestController -public class MainController { +public class DemoApi { - private final SampleService sampleService; + private final DemoService demoService; @ApiOperation(value = "Test GET endpoint") @GetMapping(value = "test") @@ -30,17 +28,17 @@ public String test() { @GetMapping(value = "testws") public String testws() { RestTemplate template = new RestTemplate(); - TestWsUser status = + DemoWsUser status = Objects.requireNonNull( template.getForObject( - "https://jsonplaceholder.typicode.com/users/1", TestWsUser.class)); + "https://jsonplaceholder.typicode.com/users/1", DemoWsUser.class)); return "" + status.getId(); } @ApiOperation(value = "Show the DB version") @GetMapping(value = "testdb") public String testdb() { - return sampleService.getDbVersion(); + return demoService.getDbVersion(); } @ApiOperation(value = "Test POST endpoint") diff --git a/src/main/java/com/cmlteam/cmltemplate/services/SampleService.java b/src/main/java/com/cmlteam/cmltemplate/demo/DemoService.java similarity index 85% rename from src/main/java/com/cmlteam/cmltemplate/services/SampleService.java rename to src/main/java/com/cmlteam/cmltemplate/demo/DemoService.java index 7db8953..d59521b 100644 --- a/src/main/java/com/cmlteam/cmltemplate/services/SampleService.java +++ b/src/main/java/com/cmlteam/cmltemplate/demo/DemoService.java @@ -1,20 +1,19 @@ -package com.cmlteam.cmltemplate.services; +package com.cmlteam.cmltemplate.demo; +import javax.annotation.PostConstruct; import org.bson.Document; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.data.mongodb.core.MongoTemplate; import org.springframework.jdbc.core.JdbcTemplate; import org.springframework.stereotype.Service; -import javax.annotation.PostConstruct; - @Service -public class SampleService { +public class DemoService { private final JdbcTemplate jdbcTemplate; private final MongoTemplate mongoTemplate; @Autowired - public SampleService(JdbcTemplate jdbcTemplate, MongoTemplate mongoTemplate) { + public DemoService(JdbcTemplate jdbcTemplate, MongoTemplate mongoTemplate) { this.jdbcTemplate = jdbcTemplate; this.mongoTemplate = mongoTemplate; } diff --git a/src/main/java/com/cmlteam/cmltemplate/model/TestWsUser.java b/src/main/java/com/cmlteam/cmltemplate/demo/DemoWsUser.java similarity index 84% rename from src/main/java/com/cmlteam/cmltemplate/model/TestWsUser.java rename to src/main/java/com/cmlteam/cmltemplate/demo/DemoWsUser.java index c993d9f..2cedfab 100644 --- a/src/main/java/com/cmlteam/cmltemplate/model/TestWsUser.java +++ b/src/main/java/com/cmlteam/cmltemplate/demo/DemoWsUser.java @@ -1,4 +1,4 @@ -package com.cmlteam.cmltemplate.model; +package com.cmlteam.cmltemplate.demo; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import lombok.AllArgsConstructor; @@ -11,7 +11,7 @@ @Setter @AllArgsConstructor @NoArgsConstructor -public class TestWsUser { +public class DemoWsUser { private int id; private String name; private String email; diff --git a/src/main/java/com/cmlteam/cmltemplate/controllers/validation/UserApi.java b/src/main/java/com/cmlteam/cmltemplate/demo/validation/UserApi.java similarity index 90% rename from src/main/java/com/cmlteam/cmltemplate/controllers/validation/UserApi.java rename to src/main/java/com/cmlteam/cmltemplate/demo/validation/UserApi.java index 4baa9ac..ca02ca3 100644 --- a/src/main/java/com/cmlteam/cmltemplate/controllers/validation/UserApi.java +++ b/src/main/java/com/cmlteam/cmltemplate/demo/validation/UserApi.java @@ -1,4 +1,4 @@ -package com.cmlteam.cmltemplate.controllers.validation; +package com.cmlteam.cmltemplate.demo.validation; import io.swagger.annotations.ApiOperation; import jakarta.validation.Valid; diff --git a/src/main/java/com/cmlteam/cmltemplate/controllers/validation/UserReq.java b/src/main/java/com/cmlteam/cmltemplate/demo/validation/UserReq.java similarity index 86% rename from src/main/java/com/cmlteam/cmltemplate/controllers/validation/UserReq.java rename to src/main/java/com/cmlteam/cmltemplate/demo/validation/UserReq.java index f6d128e..49d1f90 100644 --- a/src/main/java/com/cmlteam/cmltemplate/controllers/validation/UserReq.java +++ b/src/main/java/com/cmlteam/cmltemplate/demo/validation/UserReq.java @@ -1,4 +1,4 @@ -package com.cmlteam.cmltemplate.controllers.validation; +package com.cmlteam.cmltemplate.demo.validation; import jakarta.validation.constraints.NotBlank; import jakarta.validation.constraints.Positive; diff --git a/src/main/java/com/cmlteam/cmltemplate/controllers/validation/UserResp.java b/src/main/java/com/cmlteam/cmltemplate/demo/validation/UserResp.java similarity index 73% rename from src/main/java/com/cmlteam/cmltemplate/controllers/validation/UserResp.java rename to src/main/java/com/cmlteam/cmltemplate/demo/validation/UserResp.java index 89bf4a4..e696ad3 100644 --- a/src/main/java/com/cmlteam/cmltemplate/controllers/validation/UserResp.java +++ b/src/main/java/com/cmlteam/cmltemplate/demo/validation/UserResp.java @@ -1,4 +1,4 @@ -package com.cmlteam.cmltemplate.controllers.validation; +package com.cmlteam.cmltemplate.demo.validation; import lombok.Getter; import lombok.RequiredArgsConstructor; diff --git a/src/main/java/com/cmlteam/cmltemplate/services/AwsS3Props.java b/src/main/java/com/cmlteam/cmltemplate/services/AwsS3Props.java index 7b26539..906104d 100644 --- a/src/main/java/com/cmlteam/cmltemplate/services/AwsS3Props.java +++ b/src/main/java/com/cmlteam/cmltemplate/services/AwsS3Props.java @@ -1,5 +1,6 @@ package com.cmlteam.cmltemplate.services; +import jakarta.validation.constraints.NotBlank; import lombok.Getter; import lombok.Setter; import lombok.ToString; @@ -8,8 +9,6 @@ import org.springframework.stereotype.Component; import org.springframework.validation.annotation.Validated; -import jakarta.validation.constraints.NotBlank; - @Component @ConfigurationProperties(prefix = "s3") @ConditionalOnProperty({"s3.enabled"}) diff --git a/src/main/java/com/cmlteam/cmltemplate/services/AwsS3Service.java b/src/main/java/com/cmlteam/cmltemplate/services/AwsS3Service.java index 5bb9593..f09a18f 100644 --- a/src/main/java/com/cmlteam/cmltemplate/services/AwsS3Service.java +++ b/src/main/java/com/cmlteam/cmltemplate/services/AwsS3Service.java @@ -1,5 +1,7 @@ package com.cmlteam.cmltemplate.services; +import static java.nio.charset.StandardCharsets.UTF_8; + import com.amazonaws.HttpMethod; import com.amazonaws.SdkClientException; import com.amazonaws.auth.AWSStaticCredentialsProvider; @@ -10,12 +12,6 @@ import com.amazonaws.services.s3.model.*; import com.cmlteam.cmltemplate.util.FileName; import com.cmlteam.util.Util; -import lombok.extern.slf4j.Slf4j; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; -import org.springframework.stereotype.Service; -import org.springframework.web.multipart.MultipartFile; - import java.io.IOException; import java.io.InputStream; import java.net.URL; @@ -26,8 +22,11 @@ import java.util.Date; import java.util.Objects; import java.util.UUID; - -import static java.nio.charset.StandardCharsets.UTF_8; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; +import org.springframework.stereotype.Service; +import org.springframework.web.multipart.MultipartFile; @Service @Slf4j diff --git a/src/main/java/com/cmlteam/cmltemplate/services/EmailService.java b/src/main/java/com/cmlteam/cmltemplate/services/EmailService.java index 431dda7..6957ff1 100644 --- a/src/main/java/com/cmlteam/cmltemplate/services/EmailService.java +++ b/src/main/java/com/cmlteam/cmltemplate/services/EmailService.java @@ -1,5 +1,7 @@ package com.cmlteam.cmltemplate.services; +import jakarta.mail.internet.MimeMessage; +import java.io.File; import lombok.RequiredArgsConstructor; import lombok.SneakyThrows; import lombok.extern.slf4j.Slf4j; @@ -7,9 +9,6 @@ import org.springframework.mail.javamail.MimeMessageHelper; import org.springframework.stereotype.Service; -import jakarta.mail.internet.MimeMessage; -import java.io.File; - @Service @RequiredArgsConstructor @Slf4j diff --git a/src/main/java/com/cmlteam/cmltemplate/services/RabbitService.java b/src/main/java/com/cmlteam/cmltemplate/services/RabbitService.java index bd15aa8..b88e92a 100644 --- a/src/main/java/com/cmlteam/cmltemplate/services/RabbitService.java +++ b/src/main/java/com/cmlteam/cmltemplate/services/RabbitService.java @@ -1,6 +1,7 @@ package com.cmlteam.cmltemplate.services; import com.cmlteam.cmltemplate.config.RabbitConfig; +import javax.annotation.PostConstruct; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.amqp.rabbit.annotation.RabbitListener; @@ -8,8 +9,6 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.stereotype.Service; -import javax.annotation.PostConstruct; - /** Sample service to demo RabbitMQ. */ @Service @RequiredArgsConstructor diff --git a/src/main/java/com/cmlteam/cmltemplate/util/JsonUtil.java b/src/main/java/com/cmlteam/cmltemplate/util/JsonUtil.java index 1490b18..ee48910 100644 --- a/src/main/java/com/cmlteam/cmltemplate/util/JsonUtil.java +++ b/src/main/java/com/cmlteam/cmltemplate/util/JsonUtil.java @@ -3,14 +3,13 @@ import com.fasterxml.jackson.databind.DeserializationFeature; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule; -import lombok.extern.slf4j.Slf4j; - import java.io.IOException; import java.text.SimpleDateFormat; import java.util.LinkedHashMap; import java.util.List; import java.util.Map; import java.util.TimeZone; +import lombok.extern.slf4j.Slf4j; @Slf4j public final class JsonUtil { diff --git a/src/test/java/com/cmlteam/cmltemplate/CorsOffTest.java b/src/test/java/com/cmlteam/cmltemplate/CorsOffTest.java index c145540..4bebc7a 100644 --- a/src/test/java/com/cmlteam/cmltemplate/CorsOffTest.java +++ b/src/test/java/com/cmlteam/cmltemplate/CorsOffTest.java @@ -1,5 +1,9 @@ package com.cmlteam.cmltemplate; +import static org.hamcrest.CoreMatchers.equalTo; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.*; + import com.cmlteam.cmltemplate.config.GlobalCorsConfig; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; @@ -9,10 +13,6 @@ import org.springframework.test.context.junit.jupiter.SpringExtension; import org.springframework.test.web.servlet.MockMvc; -import static org.hamcrest.CoreMatchers.equalTo; -import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.*; - @ExtendWith(SpringExtension.class) @WebMvcTest() @ContextConfiguration(classes = {TestController.class, GlobalCorsConfig.class}) diff --git a/src/test/java/com/cmlteam/cmltemplate/CorsOnTest.java b/src/test/java/com/cmlteam/cmltemplate/CorsOnTest.java index 5fa4693..3f90cbc 100644 --- a/src/test/java/com/cmlteam/cmltemplate/CorsOnTest.java +++ b/src/test/java/com/cmlteam/cmltemplate/CorsOnTest.java @@ -1,5 +1,9 @@ package com.cmlteam.cmltemplate; +import static org.hamcrest.CoreMatchers.equalTo; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.*; + import com.cmlteam.cmltemplate.config.GlobalCorsConfig; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; @@ -9,10 +13,6 @@ import org.springframework.test.context.junit.jupiter.SpringExtension; import org.springframework.test.web.servlet.MockMvc; -import static org.hamcrest.CoreMatchers.equalTo; -import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.*; - @ExtendWith(SpringExtension.class) @WebMvcTest(properties = {"cors.enabled=true"}) @ContextConfiguration(classes = {TestController.class, GlobalCorsConfig.class}) diff --git a/src/test/java/com/cmlteam/cmltemplate/MainControllerTest.java b/src/test/java/com/cmlteam/cmltemplate/demo/DemoApiTest.java similarity index 85% rename from src/test/java/com/cmlteam/cmltemplate/MainControllerTest.java rename to src/test/java/com/cmlteam/cmltemplate/demo/DemoApiTest.java index 1d4fe38..94d4119 100644 --- a/src/test/java/com/cmlteam/cmltemplate/MainControllerTest.java +++ b/src/test/java/com/cmlteam/cmltemplate/demo/DemoApiTest.java @@ -1,7 +1,13 @@ -package com.cmlteam.cmltemplate; +package com.cmlteam.cmltemplate.demo; + +import static org.hamcrest.CoreMatchers.equalTo; +import static org.hamcrest.text.MatchesPattern.matchesPattern; +import static org.mockito.Mockito.when; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; +import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content; +import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; -import com.cmlteam.cmltemplate.controllers.MainController; -import com.cmlteam.cmltemplate.services.SampleService; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; @@ -13,21 +19,13 @@ import org.springframework.test.context.junit.jupiter.SpringExtension; import org.springframework.test.web.servlet.MockMvc; -import static org.hamcrest.CoreMatchers.equalTo; -import static org.hamcrest.text.MatchesPattern.matchesPattern; -import static org.mockito.Mockito.when; -import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; -import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content; -import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; - @ExtendWith(SpringExtension.class) -@WebMvcTest(MainController.class) -@ContextConfiguration(classes = {SampleService.class, MainController.class}) -public class MainControllerTest { +@WebMvcTest(DemoApi.class) +@ContextConfiguration(classes = {DemoService.class, DemoApi.class}) +public class DemoApiTest { @Autowired private MockMvc mockMvc; - @MockBean private SampleService service; + @MockBean private DemoService service; @BeforeEach void setup() { diff --git a/src/test/java/com/cmlteam/cmltemplate/BadRequestTests.java b/src/test/java/com/cmlteam/cmltemplate/demo/validation/BadRequestTests.java similarity index 90% rename from src/test/java/com/cmlteam/cmltemplate/BadRequestTests.java rename to src/test/java/com/cmlteam/cmltemplate/demo/validation/BadRequestTests.java index cf132ea..9c24793 100644 --- a/src/test/java/com/cmlteam/cmltemplate/BadRequestTests.java +++ b/src/test/java/com/cmlteam/cmltemplate/demo/validation/BadRequestTests.java @@ -1,4 +1,4 @@ -package com.cmlteam.cmltemplate; +package com.cmlteam.cmltemplate.demo.validation; import static com.cmlteam.cmltemplate.util.JsonUtil.json; import static org.hamcrest.Matchers.hasSize; @@ -6,8 +6,7 @@ import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.*; import com.cmlteam.cmltemplate.config.BadRequestErrorRenderer; -import com.cmlteam.cmltemplate.controllers.MainController; -import com.cmlteam.cmltemplate.controllers.validation.UserApi; +import com.cmlteam.cmltemplate.demo.DemoApi; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; import org.springframework.beans.factory.annotation.Autowired; @@ -17,7 +16,7 @@ import org.springframework.test.web.servlet.MockMvc; @ExtendWith(SpringExtension.class) -@WebMvcTest(MainController.class) +@WebMvcTest(DemoApi.class) @ContextConfiguration(classes = {UserApi.class, BadRequestErrorRenderer.class}) public class BadRequestTests { @Autowired private MockMvc mockMvc; diff --git a/src/test/java/com/cmlteam/cmltemplate/util/JsonUtilTest.java b/src/test/java/com/cmlteam/cmltemplate/util/JsonUtilTest.java index 751e4bf..0a33c54 100644 --- a/src/test/java/com/cmlteam/cmltemplate/util/JsonUtilTest.java +++ b/src/test/java/com/cmlteam/cmltemplate/util/JsonUtilTest.java @@ -1,17 +1,16 @@ package com.cmlteam.cmltemplate.util; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertThrows; + +import java.util.List; +import java.util.Map; import lombok.AllArgsConstructor; import lombok.Getter; import lombok.NoArgsConstructor; import lombok.Setter; import org.junit.jupiter.api.Test; -import java.util.List; -import java.util.Map; - -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertThrows; - class JsonUtilTest { private static final String INVALID_JSON = "},z";