Skip to content

Commit

Permalink
Merge branch 'release/v1.3.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
mwarman committed Jul 6, 2015
2 parents 5243ce1 + dcd59f9 commit 86a4e13
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ The project demonstrates how to use Spring Profiles to activate (or deactivate)
The project contains unit test examples for standard components such as business services or batch beans and examples for the web service endpoints using Mock objects. Perform complete end-to-end testing with Spring MVC mocking or leverage Mockito to stub or spy business components.

#### Actuator Monitoring and Management
The project illustrates the use of Spring Boot Actuator for application monitoring and management. The application demonstrates the recording of custom metrics. Also, custom Maven project attributes are incorporated into the Actuator info endpoint.
The project illustrates the use of Spring Boot Actuator for application monitoring and management. The application demonstrates the recording of custom metrics and the creation of custom health checks. Also, custom Maven project attributes are incorporated into the Actuator info endpoint.

#### API Documentation Generator
The project includes [Springfox](http://springfox.github.io/springfox/) Swagger integration to automatically generate API docs for the RESTful web service endpoints. This feature may be activated using the *"docs"* Spring profile.
Expand Down
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@

<groupId>com.leanstacks</groupId>
<artifactId>skeleton-ws-spring-boot</artifactId>
<version>1.2.1</version>
<version>1.3.0</version>
<name>Web Services Project Skeleton</name>
<description>Skeleton project for RESTful web services using Spring Boot.</description>

<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.2.4.RELEASE</version>
<version>1.2.5.RELEASE</version>
</parent>

<properties>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
package com.leanstacks.ws.actuator.health;

import java.util.Collection;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.actuate.health.Health;
import org.springframework.boot.actuate.health.HealthIndicator;
import org.springframework.stereotype.Component;

import com.leanstacks.ws.model.Greeting;
import com.leanstacks.ws.service.GreetingService;

@Component
public class GreetingHealthIndicator implements HealthIndicator {

@Autowired
private GreetingService greetingService;

@Override
public Health health() {
Collection<Greeting> greetings = greetingService.findAll();

if (greetings == null || greetings.size() == 0) {
return Health.down().withDetail("count", 0).build();
}

return Health.up().withDetail("count", greetings.size()).build();
}

}

0 comments on commit 86a4e13

Please sign in to comment.