quarkus-dev-services-and-testing
하는 일
이 도구는 Quarkus 코드를 자동으로 테스트하도록 돕습니다. 수동 설정 없이 테스트에 필요한 데이터베이스와 다른 서비스를 시작합니다.
사용하는 경우
- ✓Quarkus 프로젝트의 테스트를 작성할 때.
- ✓테스트를 위해 데이터베이스를 시뮬레이션해야 할 때.
- ✓기존 테스트의 버그를 고칠 때.
스킬 링크
https://github.com/github/awesome-copilot/blob/main/skills/quarkus-dev-services-and-testing/SKILL.md복사해서 AI(Claude, ChatGPT, Cursor)에 붙여넣고 지침을 따르도록 요청하세요.
사용 방법
가장 쉬운 방법입니다. 메시지를 복사해 AI에 붙여넣으세요. AI가 스킬을 읽고 지침을 따릅니다.
바로 붙여넣을 수 있는 메시지
Claude Code, Codex, Cursor용입니다. 프로젝트 폴더에서 실행하면 스킬이 설치됩니다.
SKILL.md를 다운로드해 에이전트의 스킬 폴더에 넣으세요.
AI에게 요청하는 예시
“PostgreSQL 데이터베이스로 사용자 API를 테스트하고 싶습니다.”
매주 새 스킬 5개. 읽는 데 1분.
작동 방식
테스트를 실행하면 Quarkus는 데이터베이스 같은 서비스가 필요한지 확인합니다. 필요한데 설정된 서비스가 없으면 Docker를 사용해 자동으로 하나를 시작합니다. 이렇게 하면 테스트가 실행될 환경이 갖춰집니다.
기술 내용 (원본 SKILL.md)
작성자의 영어 원문을 GitHub에서 그대로 가져왔습니다.
Quarkus Dev Services and Testing
Check the project's Quarkus version first. Framework-neutral Testcontainers usage can use the optional java-testcontainers skill if installed (otherwise see https://java.testcontainers.org/); this skill covers only Quarkus-specific features.
Dev Services
In dev and test modes Quarkus starts containers (PostgreSQL, MySQL, Kafka, Redis, Keycloak, ...) automatically when the related extension is present and no connection is configured (Docker or Podman required).
# Global switch
quarkus.devservices.enabled=true
%dev.quarkus.datasource.devservices.image-name=postgres:17
# Reuse container across restarts (also requires testcontainers.reuse.enable=true in ~/.testcontainers.properties)
quarkus.datasource.devservices.reuse=true
# Fixed port (optional)
quarkus.datasource.devservices.port=5432
# Share between apps in dev mode
quarkus.kafka.devservices.shared=true
Disable one with quarkus.<ext>.devservices.enabled=false; configuring a URL/host explicitly also disables it. Dev UI (/q/dev-ui) lists running services.
Tests
@QuarkusTest
class GreetingResourceTest {
@Test
void hello() {
given().when().get("/hello").then().statusCode(200).body(is("Hello"));
}
}
Dependencies, test scope: io.quarkus:quarkus-junit (3.31+, what the 3.40 template generates) or quarkus-junit5 (3.27 template; still published and resolvable on 3.40) and io.rest-assured:rest-assured. Keep whichever the project already uses.
- Inject beans in tests with
@Inject; mock CDI beans withio.quarkus.test.InjectMock(quarkus-junit-mockito, formerlyquarkus-junit5-mockito; verified mocking aPanacheRepositorybean on 3.40.1). - Security:
@TestSecurity(user="alice", roles="admin")(quarkus-test-security). - Profiles:
@TestProfile(MyProfile.class)withQuarkusTestProfile#getConfigOverrides(); restarts the app, so use sparingly. - Transactions:
@TestTransactionrolls back after the test. @QuarkusIntegrationTestruns against the packaged artifact (jar, native binary or container); you cannot inject beans there, only call it over HTTP.
Test resources
public class WireMockResource implements QuarkusTestResourceLifecycleManager {
public Map<String,String> start() { /* start, return config overrides */ return Map.of(); }
public void stop() { }
}
@QuarkusTest
@WithTestResource(WireMockResource.class) // io.quarkus.test.common.WithTestResource
class MyTest { }
@WithTestResource (verified on 3.40.1) applies to the annotated test class; Quarkus restarts the app when the set of resources changes. The older @QuarkusTestResource still compiles and runs on 3.40.1 but applies globally to all tests unless restrictToAnnotatedClass = true. Do not put @ConfigProperty injection points for resource-supplied values in a test class: test classes are scanned as beans, and the app fails to start for other test classes that lack the resource. Prefer Dev Services over custom resources when an extension supports it.
Running
./mvnw test # unit/@QuarkusTest
./mvnw verify -DskipITs=false # also runs *IT via maven-failsafe-plugin
Gotcha: *IT classes (@QuarkusIntegrationTest) are run by Failsafe in the verify phase, and need the quarkus-maven-plugin build goal and the failsafe config (with java.util.logging.manager and maven.home system properties) generated by the project template. ./mvnw test silently skips them, and the 3.27 and 3.40 templates also set <skipITs>true</skipITs>, so plain ./mvnw verify skips them too (verified): pass -DskipITs=false (or -Dnative, whose profile flips it). With -Dnative and a container build on macOS or Windows, the binary is a Linux ELF and the IT fails with Exit code is: '126'; use a local Mandrel/GraalVM build for those.
Continuous testing: run ./mvnw quarkus:dev and press r to start or re-run tests and p to pause them (h lists the hotkeys); once running, tests re-run on code changes (quarkus.test.continuous-testing=enabled|paused|disabled).
Verified on Quarkus 3.40.1 (JDK 26, Docker Desktop): @QuarkusTest with Dev Services PostgreSQL (postgres:18 by default), @TestTransaction, @TestProfile, @TestSecurity, @InjectMock, *IT via Failsafe. @QuarkusTest and Dev Services on 3.27.6 as well.
Checklist
- Use Dev Services before writing a custom resource.
…
자주 묻는 질문
따로 설치해야 할 것이 있나요?
서비스가 자동으로 시작되려면 컴퓨터에 Docker나 Podman이 설치되어 있고 실행 중이어야 합니다.
이 기능은 어떻게 끄나요?
Quarkus 설정을 바꿔 특정 종류의 서비스(예: 데이터베이스)에 대해서나, 모든 서비스에 대해 자동 서비스 기능을 끌 수 있습니다.
다른 종류의 테스트에도 쓸 수 있나요?
네, 이 도구는 Quarkus 생태계 안의 테스트에 집중되어 있어 프레임워크의 기능과 쉽게 통합할 수 있습니다.
상세 정보
작성자의 원본 설명
Quarkus Dev Services and testing: zero-config containers, @QuarkusTest, @QuarkusIntegrationTest, test resources, RestAssured, @InjectMock, profiles and continuous testing. Use when writing or fixing tests in a Quarkus project.
repo: github/awesome-copilot
인기도
- GitHub 스타
- 40k
- 순위
- #7378
- 라이선스
- MIT
- 업데이트
- 2026. 10. 15.
댓글
- …
이 저장소의 다른 스킬
acquire-codebase-knowledge
40k에이전트가 기존 코드 프로젝트를 이해하고 문서화하도록 돕습니다. 새 구성원을 맞이하거나 아키텍처를 개괄적으로 파악할 때 유용합니다.
acreadiness-assess
40k에이전트가 프로젝트의 AI 준비 상태를 평가하고 보고서를 만들도록 합니다. 프로젝트가 AI 도구를 쓸 준비가 얼마나 되어 있는지 이해하는 데 유용합니다.
acreadiness-generate-instructions
40k에이전트가 평가 결과를 바탕으로 AI 도구를 위한 지침을 만들도록 돕습니다. AI가 코드와 상호작용하는 방식을 개선하고 확인된 공백을 메울 때 유용합니다.
acreadiness-policy
40k에이전트가 AI 프로젝트 평가를 위한 정책을 정의하거나 적용하도록 돕습니다. 프로젝트 평가 방식을 표준화하고 규정 준수를 보장할 때 유용합니다.
비슷한 스킬
test-driven-development
311k에이전트가 기능이나 수정을 만들기 전에 실패하는 테스트를 먼저 쓰고, 그것을 통과시키는 가장 작은 코드를 작성하도록 가르칩니다.
verification-before-completion
311k에이전트가 작업, 수정, 빌드가 완료되었거나 통과했다고 말하기 전에 실제 점검을 실행하고 결과를 읽도록 가르칩니다.
migrate-to-shoehorn
310k테스트 파일의 위험한 타입 캐스팅을 shoehorn 라이브러리로 바꿔, 테스트가 일부 데이터만 써도 타입 검사를 통과하도록 돕습니다.