Skip to content

snowdrop/testsuite

Repository files navigation

Spring Boot Testsuite

1. Instructions

Steps to execute the test suite are:

1) Login to Open Shift

oc login $(minishift console --url) -u admin -p admin

2) Grant permissions for config map, circuit-breaker

oc policy add-role-to-user view -n $(oc project -q) -z default

3) Execute tests

mvn clean verify -Popenshift

2. Use cases to be investigated

  • Health Check (OpenShift+Spring Boot Actuator)

  • Kubernetes ConfigMap for configuration

  • Server-side load balancing (Kube/OpenShift).

  • Kubernetes/DNS for service registration/discovery (+ ribbon backed by Kube with one IP?) If multiple endpoints are registered, they will be used for loadbalancing by ribbon (https://github.com/fabric8io/spring-cloud-kubernetes#ribbon-discovery-in-kubernetes)

  • Hystrix + Turbine Server to stream info reported by the Services Circuit Checked (= Hystrix Circuit Breaker pattern)

  • Logging (EFK)

3. Future version of Obsidian.next

4. REST Service with Apache Tomcat

Description

A REST endpoint is exposed by Spring Boot using as Java Web Container Apache Tomcat. The REST endpoint /greeting returns a message to say hello world with an id which is increment for each call.

http http://localhost:8080/greeting
HTTP/1.1 200
Content-Type: application/json;charset=UTF-8
Date: Thu, 23 Feb 2017 08:11:08 GMT
Transfer-Encoding: chunked

{
    "content": "Hello, World!",
    "id": 1
}

5. REST Service using Apache CXF

This use case is based on the same logic as REST Service with Apache Tomcat but it uses as starter Spring Boot Starter - Apache CXF. To let Apache CXF to discover the services and register the REST application, the property cxf → jaxrs has been added within the application.properties file in order to tell to the framework to discover and register the REST endpoints

cxf:
  jaxrs:
    component-scan: true

6. JPA with Spring Data repositories

Description

The goal of this use case is to setup a CRUD service talking to a H2 database where the model is defined with the common entities here. At run time, an in memory H2 database is created, some records imported using an import.sql file. The CRUD services will be generated automatically.

References:

7. JPA with Hibernate

The goal of this use case is to setup a CRUD service talking to a H2 database where the model is defined with the common entities here. At run time, an in memory H2 database is created, some records imported using an import.sql file. A Service class will contain the CRUD methods. No transaction support is required.

8. Health Check

The goal of this use case is to verify health endpoint exposed by the Spring Boot Actuator. In a local test case healthy and unhealthy statuses are verified using a custom health indicator. In an OpenShift test case only healthy status is verified, because otherwise pod wouldn’t start or would be restarted.

9. Ribbon

10. Circuit Breaker

  • Hystrix

11. Tracing

  • Opentracing - Jaeger

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages