/**
 * 
 */
package io.vertigo.starterkit;

import io.vertigo.starterkit.tools.AbstractStarterKitTest;

import java.util.List;

import org.junit.Assert;
import org.junit.Test;

import io.vertigo.commons.analytics.health.HealthCheck;
import io.vertigo.commons.analytics.health.HealthMeasure;
import io.vertigo.commons.analytics.health.HealthStatus;
import io.vertigo.commons.impl.analytics.health.HealthAnalyticsUtil;


/**
 * Classe de test vérifiant le bon démarrage de l'application.
 * @author jmforhan
 *
 */
public class ApplicationStartTest extends AbstractStarterKitTest {

	/**
	 * On vérifie le bon démarrage de l'application.
	 */
	@Test
	public void testStartApplication() {
		// On récupère l'état de santé globale et on le loggue
		final List<HealthCheck> lst = HealthAnalyticsUtil.getHealthChecks();
		String noPb = null;
		for (final HealthCheck health : lst) {
			final StringBuilder sb = new StringBuilder();
			sb.append(health.getModule());
			sb.append('|');
			sb.append(health.getFeature());
			sb.append('|');
			sb.append(health.getChecker());
			sb.append('|');
			sb.append(health.getName());
			final HealthMeasure measure = health.getMeasure();
			sb.append(" : ");
			sb.append(measure.getStatus());
			final String msg = sb.toString();
			getLogger().info(msg);
			if (noPb == null && measure.getStatus() != HealthStatus.GREEN) {
				noPb = msg;
			}
		}
		Assert.assertNull(noPb);
	}
}

@@ -1,15 +1,14 @@
 /**%0A *
- 
 %0A */%0Apac
@@ -47,56 +47,20 @@
 ort 
-io.vertigo.starterkit.tools.AbstractStarterKitTe
+java.util.Li
 st;%0A
@@ -67,33 +67,38 @@
 %0Aimport java
-.util.Lis
+x.inject.Injec
 t;%0A%0Aimport o
@@ -134,24 +134,78 @@
 unit.Test;%0A%0A
+import io.vertigo.commons.analytics.AnalyticsManager;%0A
 import io.ve
@@ -385,59 +385,48 @@
 igo.
-commons.impl.analytics.health.HealthAnalyticsUtil;%0A
+starterkit.tools.AbstractStarterKitTest;
 %0A%0A/*
@@ -585,16 +585,70 @@
 Test %7B%0A%0A
+%09@Inject%0A%09private AnalyticsManager analyticsManager;%0A%0A
 %09/**%0A%09 *
@@ -837,23 +837,17 @@
 t = 
-HealthA
+a
 nalytics
 Util
@@ -846,12 +846,15 @@
 tics
-Util
+Manager
 .get

switch to public api