BAEL-4687: renamed project from jackson to data 2

This commit is contained in:
Adina Rolea
2020-12-04 19:55:44 +02:00
parent 003a5f2034
commit c19b868d3b
18 changed files with 4 additions and 4 deletions
@@ -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 + "\"}");
}
}
@@ -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 {
}
@@ -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 {
}
@@ -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 {
}
@@ -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 {
}
@@ -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 {
}