Example usage for org.springframework.boot.actuate.health Status Status

List of usage examples for org.springframework.boot.actuate.health Status Status

Introduction

In this page you can find the example usage for org.springframework.boot.actuate.health Status Status.

Prototype

public Status(String code) 

Source Link

Document

Create a new Status instance with the given code and an empty description.

Usage

From source file:com.ge.predix.acs.monitoring.UaaHealthIndicatorTest.java

@DataProvider
public Object[][] dp() {
    return new Object[][] { new Object[] { mockRestWithUp(), Status.UP },
            new Object[] { mockRestWithException(), new Status(AcsMonitoringConstants.UAA_OUT_OF_SERVICE) }, };
}

From source file:com.ge.predix.acs.monitoring.AcsDBHealthIndicatorTest.java

@DataProvider
public Object[][] dp() {

    TitanMigrationManager happyMigrationManager = new TitanMigrationManager();
    TitanMigrationManager sadMigrationManager = new TitanMigrationManager();
    Whitebox.setInternalState(happyMigrationManager, "isMigrationComplete", true);
    Whitebox.setInternalState(sadMigrationManager, "isMigrationComplete", false);

    return new Object[][] { new Object[]

            { mockDBWithUp(), Status.UP, happyMigrationManager },

            { mockDBWithException(new TransientDataAccessResourceException("")),
                    new Status(AcsMonitoringConstants.ACS_DB_OUT_OF_SERVICE), happyMigrationManager },

            { mockDBWithException(new QueryTimeoutException("")),
                    new Status(AcsMonitoringConstants.ACS_DB_OUT_OF_SERVICE), happyMigrationManager },

            { mockDBWithException(new DataSourceLookupFailureException("")),
                    new Status(AcsMonitoringConstants.ACS_DB_OUT_OF_SERVICE), happyMigrationManager },

            { mockDBWithException(new PermissionDeniedDataAccessException("", null)),
                    new Status(AcsMonitoringConstants.ACS_DB_OUT_OF_SERVICE), happyMigrationManager },

            { mockDBWithUp(), new Status(AcsMonitoringConstants.ACS_DB_MIGRATION_INCOMPLETE),
                    sadMigrationManager },

    };/*from ww w .  j av a2 s .c  o  m*/
}