BAEL-4687: renamed project from jackson to data 2
This commit is contained in:
+32
@@ -0,0 +1,32 @@
|
||||
package com.baeldung.boot.jackson.app;
|
||||
|
||||
import com.baeldung.boot.jackson.config.CoffeeConstants;
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
import org.springframework.boot.test.web.client.TestRestTemplate;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
@SpringBootTest(classes = Application.class, webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
|
||||
public abstract class AbstractCoffeeIntegrationTest {
|
||||
|
||||
@Autowired
|
||||
protected TestRestTemplate restTemplate;
|
||||
|
||||
@Test
|
||||
public void whenGetCoffee_thenSerializedWithDateAndNonNull() {
|
||||
String formattedDate = DateTimeFormatter.ofPattern(CoffeeConstants.dateTimeFormat)
|
||||
.format(LocalDateTime.now());
|
||||
|
||||
String brand = "Lavazza";
|
||||
|
||||
String url = "/coffee?brand=" + brand;
|
||||
String response = restTemplate.getForObject(url, String.class);
|
||||
assertThat(response).isEqualTo(
|
||||
"{\"brand\":\"" + brand + "\",\"date\":\"" + formattedDate + "\"}");
|
||||
}
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
package com.baeldung.boot.jackson.app;
|
||||
|
||||
import com.baeldung.boot.jackson.config.CoffeeCustomizerConfig;
|
||||
import org.springframework.context.annotation.Import;
|
||||
|
||||
@Import(CoffeeCustomizerConfig.class)
|
||||
public class CoffeeCustomizerIntegrationTest extends AbstractCoffeeIntegrationTest {
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
package com.baeldung.boot.jackson.app;
|
||||
|
||||
import com.baeldung.boot.jackson.config.CoffeeHttpConverterConfiguration;
|
||||
import org.springframework.context.annotation.Import;
|
||||
|
||||
@Import(CoffeeHttpConverterConfiguration.class)
|
||||
public class CoffeeHttpConverterIntegrationTest extends AbstractCoffeeIntegrationTest {
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
package com.baeldung.boot.jackson.app;
|
||||
|
||||
import com.baeldung.boot.jackson.config.CoffeeJacksonBuilderConfig;
|
||||
import org.springframework.context.annotation.Import;
|
||||
|
||||
@Import(CoffeeJacksonBuilderConfig.class)
|
||||
public class CoffeeJacksonBuilderIntegrationTest extends AbstractCoffeeIntegrationTest {
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
package com.baeldung.boot.jackson.app;
|
||||
|
||||
import com.baeldung.boot.jackson.config.CoffeeObjectMapperConfig;
|
||||
import org.springframework.context.annotation.Import;
|
||||
|
||||
@Import(CoffeeObjectMapperConfig.class)
|
||||
public class CoffeeObjectMapperIntegrationTest extends AbstractCoffeeIntegrationTest {
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
package com.baeldung.boot.jackson.app;
|
||||
|
||||
import com.baeldung.boot.jackson.config.CoffeeRegisterModuleConfig;
|
||||
import org.springframework.context.annotation.Import;
|
||||
|
||||
@Import(CoffeeRegisterModuleConfig.class)
|
||||
public class CoffeeRegisterModuleIntegrationTest extends AbstractCoffeeIntegrationTest {
|
||||
}
|
||||
Reference in New Issue
Block a user