Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SmallRye Health codestart #20584

Merged
merged 1 commit into from
Oct 7, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{#include readme-header /}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: smallrye-health-codestart
ref: smallrye-health
type: code
tags: extension-codestart
metadata:
title: SmallRye Health
description: Monitor your application's health using SmallRye Health
related-guide-section: https://quarkus.io/guides/smallrye-health
language:
base:
dependencies:
- io.quarkus:quarkus-smallrye-health
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package org.acme;

import org.eclipse.microprofile.health.HealthCheck;
import org.eclipse.microprofile.health.HealthCheckResponse;
import org.eclipse.microprofile.health.Liveness;

@Liveness
public class MyLivenessCheck implements HealthCheck {

@Override
public HealthCheckResponse call() {
return HealthCheckResponse.up("alive");
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package org.acme

import org.eclipse.microprofile.health.HealthCheck
import org.eclipse.microprofile.health.HealthCheckResponse
import org.eclipse.microprofile.health.Liveness

@Liveness
public class MyLivenessCheck : HealthCheck {

override fun call(): HealthCheckResponse {
return HealthCheckResponse.up("alive")
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,9 @@ metadata:
- "quarkus.health."
- "quarkus.smallrye-health."
- "mp.health."
codestart:
name: "smallrye-health"
languages:
- "java"
- "kotlin"
artifact: "io.quarkus:quarkus-project-core-extension-codestarts"
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package io.quarkus.devtools.codestarts.quarkus;

import static io.quarkus.devtools.codestarts.quarkus.QuarkusCodestartCatalog.Language.JAVA;
import static io.quarkus.devtools.codestarts.quarkus.QuarkusCodestartCatalog.Language.KOTLIN;

import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.condition.EnabledIfSystemProperty;
import org.junit.jupiter.api.extension.RegisterExtension;

import io.quarkus.devtools.testing.codestarts.QuarkusCodestartTest;

public class SmallRyeHealthCodestartTest {

@RegisterExtension
public static QuarkusCodestartTest codestartTest = QuarkusCodestartTest.builder()
.codestarts("smallrye-health")
.languages(JAVA, KOTLIN)
.build();

@Test
void testContent() throws Throwable {
codestartTest.checkGeneratedSource("org.acme.MyLivenessCheck");
}

@Test
@EnabledIfSystemProperty(named = "build-projects", matches = "true")
void buildAllProjectsForLocalUse() throws Throwable {
codestartTest.buildAllProjects();
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package ilove.quark.us;

import org.eclipse.microprofile.health.HealthCheck;
import org.eclipse.microprofile.health.HealthCheckResponse;
import org.eclipse.microprofile.health.Liveness;

@Liveness
public class MyLivenessCheck implements HealthCheck {

@Override
public HealthCheckResponse call() {
return HealthCheckResponse.up("alive");
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package ilove.quark.us;

import org.eclipse.microprofile.health.HealthCheck;
import org.eclipse.microprofile.health.HealthCheckResponse;
import org.eclipse.microprofile.health.Liveness;

@Liveness
public class MyLivenessCheck implements HealthCheck {

@Override
public HealthCheckResponse call() {
return HealthCheckResponse.up("alive");
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package ilove.quark.us

interface MyHealthCheck {

fun message(): String?

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package ilove.quark.us

import org.eclipse.microprofile.health.HealthCheck
import org.eclipse.microprofile.health.HealthCheckResponse
import org.eclipse.microprofile.health.Liveness

@Liveness
public class MyLivenessCheck : HealthCheck {

override fun call(): HealthCheckResponse {
return HealthCheckResponse.up("alive")
}

}