BAEL-15988 : Java file movement
This commit is contained in:
-43
@@ -1,43 +0,0 @@
|
||||
package com.baeldung.git;
|
||||
|
||||
import static org.assertj.core.api.Assertions.assertThat;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.test.context.ContextConfiguration;
|
||||
import org.springframework.test.context.TestPropertySource;
|
||||
import org.springframework.test.context.junit4.SpringRunner;
|
||||
|
||||
@RunWith(SpringRunner.class)
|
||||
@ContextConfiguration(classes = CommitIdApplication.class)
|
||||
@TestPropertySource(properties = { "spring.jmx.default-domain=test" })
|
||||
public class CommitIdIntegrationTest {
|
||||
|
||||
private static final Logger LOG = LoggerFactory.getLogger(CommitIdIntegrationTest.class);
|
||||
|
||||
@Value("${git.commit.message.short:UNKNOWN}")
|
||||
private String commitMessage;
|
||||
|
||||
@Value("${git.branch:UNKNOWN}")
|
||||
private String branch;
|
||||
|
||||
@Value("${git.commit.id:UNKNOWN}")
|
||||
private String commitId;
|
||||
|
||||
@Test
|
||||
public void whenInjecting_shouldDisplay() throws Exception {
|
||||
|
||||
LOG.info(commitId);
|
||||
LOG.info(commitMessage);
|
||||
LOG.info(branch);
|
||||
|
||||
assertThat(commitMessage).isNotEqualTo("UNKNOWN");
|
||||
|
||||
assertThat(branch).isNotEqualTo("UNKNOWN");
|
||||
|
||||
assertThat(commitId).isNotEqualTo("UNKNOWN");
|
||||
}
|
||||
}
|
||||
-29
@@ -1,29 +0,0 @@
|
||||
package org.baeldung.boot.jsoncomponent;
|
||||
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import javafx.scene.paint.Color;
|
||||
|
||||
import org.baeldung.boot.jsoncomponent.User;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.autoconfigure.json.JsonTest;
|
||||
import org.springframework.test.context.junit4.SpringRunner;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
@JsonTest
|
||||
@RunWith(SpringRunner.class)
|
||||
public class UserJsonDeserializerIntegrationTest {
|
||||
|
||||
@Autowired
|
||||
private ObjectMapper objectMapper;
|
||||
|
||||
@Test
|
||||
public void testDeserialize() throws IOException {
|
||||
User user = objectMapper.readValue("{\"favoriteColor\":\"#f0f8ff\"}", User.class);
|
||||
assertEquals(Color.ALICEBLUE, user.getFavoriteColor());
|
||||
}
|
||||
}
|
||||
-28
@@ -1,28 +0,0 @@
|
||||
package org.baeldung.boot.jsoncomponent;
|
||||
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import javafx.scene.paint.Color;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.autoconfigure.json.JsonTest;
|
||||
import org.springframework.test.context.junit4.SpringRunner;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
import org.baeldung.boot.jsoncomponent.User;
|
||||
|
||||
@JsonTest
|
||||
@RunWith(SpringRunner.class)
|
||||
public class UserJsonSerializerIntegrationTest {
|
||||
|
||||
@Autowired
|
||||
private ObjectMapper objectMapper;
|
||||
|
||||
@Test
|
||||
public void testSerialization() throws JsonProcessingException {
|
||||
String json = objectMapper.writeValueAsString(new User(Color.ALICEBLUE));
|
||||
assertEquals("{\"favoriteColor\":\"#f0f8ff\"}", json);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user