Creates RPC-style endpoint following layered architecture (Controller → Manager → Repository). Use when creating new API endpoints or CRUD operations.
日本語の概要は準備中です。原文の説明を表示しています。
Testing patterns for Micronaut/Kotlin backend including repository tests, integration tests, and test data builders. Use when writing tests, setting up test infrastructure, or improving coverage.
インストールする前に、エージェントに与えられる指示の中身を確認できます。
See
integration-test-setup.mdfor @MicronautTest configuration, Retrofit client setup, and connection pool tuning.See
examples.mdfor complete code patterns including MockK, test data builders, and assertions.
Every endpoint needs an integration test. Extend AbstractControllerTest, use Retrofit clients from module-client, and clean up with truncateAllTables() in @AfterEach.
Key rules:
HttpRequestaccessToken()@Test
fun `{action} - {expected outcome}`() = runBlocking { }
// Examples:
fun `getEmployee - returns employee by id`() = runBlocking { }
fun `getEmployee - returns 404 when not found`() = runBlocking { }
fun `createEmployee - fails with 401 when not authenticated`() = runBlocking { }
@Test
fun `getById - returns 404 when not found`() = runBlocking {
val token = accessToken(prepareUser())
assertThrows<HttpException> {
runBlocking {
client.getById(authorization = token, id = UUID.randomUUID())
}
}.also {
assertThat(it.code()).isEqualTo(404)
}
}
Extend AbstractRepositoryTest. Every repository needs these tests at minimum:
class DefaultEmployeeRepositoryTest : AbstractRepositoryTest() {
private val repository = DefaultEmployeeRepository(database)
@BeforeEach
fun cleanup() { database.primary.truncateAllTables() }
@Test
fun `insert - happy path`() { }
@Test
fun `byId - returns entity when exists`() { }
@Test
fun `byId - returns null when not exists`() { }
@Test
fun `byId - returns null when soft deleted`() { }
@Test
fun `deleteById - soft deletes entity`() { }
@Test
fun `update - updates selected fields`() { }
}
mockk<T>() for creating mockscoEvery / coVerify for suspend functions (not every/verify)slot<T>() + capture() to verify what arguments were passedrunTest { } from kotlinx.coroutines.test — NOT runBlocking. runTest handles virtual time and catches coroutine issues.// Given, // When, // Then@Nested + @DisplayName to group related testsSee
examples.mdfor full MockK code examples,@Nestedpatterns, test data builders, and AssertJ assertions.
Connection pool exhaustion: If parallel tests fail with "cannot acquire connection", bump maxPoolSize to 20. See integration-test-setup.md for the config snippet.
MockK + coroutines: Always use coEvery/coVerify for suspend functions. Plain every/verify won't work and gives confusing errors.
./gradlew test # All tests
./gradlew test --tests "com.yourcompany.EmployeeControllerTest" # One class
./gradlew :app:module-repository:test # One module
まだレビューはありません。使ってみた感想をお寄せください。
概要と使いどころ
Creates RPC-style endpoint following layered architecture (Controller → Manager → Repository). Use when creating new API endpoints or CRUD operations.
日本語の概要は準備中です。原文の説明を表示しています。
Write blog posts, guides, tutorials, and long-form content. Sounds like a real person, not AI. Use when the user wants polished written content.
日本語の概要は準備中です。原文の説明を表示しています。
Design RPC-style APIs with layered architecture (Controller → Manager → Repository). Use when creating new API endpoints, designing API contracts, or reviewing API patterns.
日本語の概要は準備中です。原文の説明を表示しています。
Run a structured brainstorm session for startup ideas. Takes a theme or problem and generates ideas with quick gut-checks. Use when the user wants to explore a space or generate new ideas.
日本語の概要は準備中です。原文の説明を表示しています。
Run real browser QA with Playwright. Use when testing a frontend feature, verifying UI before PR, smoke testing after deploy, or investigating reported visual bugs.
日本語の概要は準備中です。原文の説明を表示しています。
CI/CD pipeline patterns for GitHub Actions, PR automation, and deployment workflows. Use when setting up CI, fixing broken pipelines, automating PR checks, or configuring deployment.
日本語の概要は準備中です。原文の説明を表示しています。