summaryrefslogtreecommitdiff
path: root/eaaf-springboot-utils/src/test/java/at/gv/egiz
diff options
context:
space:
mode:
authorThomas <>2021-06-18 08:18:59 +0200
committerThomas <>2021-06-18 08:18:59 +0200
commit108df5e1cc640070d1b03fb2dfd99306e661b8fe (patch)
tree3480ccccbf20011572f2dc3b3db743d9f12d1482 /eaaf-springboot-utils/src/test/java/at/gv/egiz
parent5a2544a18d44eec63ace935b1869da9c67d73f6c (diff)
downloadEAAF-Components-108df5e1cc640070d1b03fb2dfd99306e661b8fe.tar.gz
EAAF-Components-108df5e1cc640070d1b03fb2dfd99306e661b8fe.tar.bz2
EAAF-Components-108df5e1cc640070d1b03fb2dfd99306e661b8fe.zip
update some log messages
Diffstat (limited to 'eaaf-springboot-utils/src/test/java/at/gv/egiz')
-rw-r--r--eaaf-springboot-utils/src/test/java/at/gv/egiz/eaaf/utils/springboot/test/SimpleSpringBootStarterTest.java21
1 files changed, 16 insertions, 5 deletions
diff --git a/eaaf-springboot-utils/src/test/java/at/gv/egiz/eaaf/utils/springboot/test/SimpleSpringBootStarterTest.java b/eaaf-springboot-utils/src/test/java/at/gv/egiz/eaaf/utils/springboot/test/SimpleSpringBootStarterTest.java
index 611cc3aa..e0c478af 100644
--- a/eaaf-springboot-utils/src/test/java/at/gv/egiz/eaaf/utils/springboot/test/SimpleSpringBootStarterTest.java
+++ b/eaaf-springboot-utils/src/test/java/at/gv/egiz/eaaf/utils/springboot/test/SimpleSpringBootStarterTest.java
@@ -1,5 +1,8 @@
package at.gv.egiz.eaaf.utils.springboot.test;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
import java.io.IOException;
import org.apache.http.client.ClientProtocolException;
@@ -17,6 +20,7 @@ import org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactor
import org.springframework.context.ConfigurableApplicationContext;
import at.gv.egiz.eaaf.utils.springboot.test.dummy.DummySpringBootApp;
+import at.gv.egiz.eaaf.utils.springboot.utils.VersionHolder;
public class SimpleSpringBootStarterTest {
@@ -29,13 +33,15 @@ public class SimpleSpringBootStarterTest {
ConfigurableApplicationContext ctx = DummySpringBootApp.getCtx();
Assert.assertNotNull("SpringBootContext", ctx);
- //check if AJP Connector config was set
+ // check if AJP Connector config was set
TomcatServletWebServerFactory ajp = ctx.getBean(TomcatServletWebServerFactory.class);
Assert.assertNotNull("No AJP connector", ajp);
- //check simple http calls
+ // check simple http calls
testSimpleHttpCall();
+ // check version holder
+ checkVersionHolder(ctx);
SpringApplication.exit(ctx, new ExitCodeGenerator() {
@@ -51,12 +57,17 @@ public class SimpleSpringBootStarterTest {
// check if authentication works on actuator end-point
final HttpClientBuilder builder = HttpClients.custom();
final CloseableHttpClient client = builder.build();
- Assert.assertNotNull("httpClient", client);
+ assertNotNull("httpClient", client);
final HttpUriRequest httpGet1 = new HttpGet("http://localhost:8080/junit");
final CloseableHttpResponse httpResp1 = client.execute(httpGet1);
- Assert.assertEquals("http statusCode", 200, httpResp1.getStatusLine().getStatusCode());
+ assertEquals("http statusCode", 200, httpResp1.getStatusLine().getStatusCode());
+
+ }
+
+ private void checkVersionHolder(ConfigurableApplicationContext ctx) {
+ VersionHolder versionHolder = ctx.getBean(VersionHolder.class);
+ assertEquals("can not extract version", "unknown", versionHolder.getVersion());
}
-
}