java-tutorials/spring-boot/src/test/java/com/baeldung/buildproperties/BuildInfoServiceIntegrationTest.java
2020-01-09 19:14:55 +01:00

25 lines
832 B
Java

package com.baeldung.buildproperties;
import static org.junit.Assert.assertThat;
import org.hamcrest.Matchers;
import org.junit.jupiter.api.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
@RunWith(SpringRunner.class)
@SpringBootTest(classes = Application.class)
class BuildInfoServiceIntegrationTest {
@Autowired
private BuildInfoService service;
@Test
void whenGetApplicationDescription_thenSuccess() {
assertThat(service.getApplicationDescription(), Matchers.is("This is simple boot application for Spring boot actuator test"));
assertThat(service.getApplicationVersion(), Matchers.is("0.0.1-SNAPSHOT"));
}
}