本文へ移動
cccskills
無料GitHub で公開

annotations

Conventions for using annotations in all tests using Jupiter

日本語の概要は準備中です。原文の説明を表示しています。

インストール方法を見る

含まれるファイル(1)

  • SKILL.md1.8 KB

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

1. Make sure to use @param:Value eveywhere @Value is declared for Kotlin classes and files only

Remember to run tests after replacing all of them

2. Make sure to use interpolation prefixes for the @Value annotation in Kotlin classes and files only

Example 1 (applying to params)

Replace this:

class VirtualThreadsDemoApplication(
    val taskService: TaskService,
    @param:Value("\${org.jesperancinha.vtcc.tasks}") private val tasks: Int,
)

with this:

class VirtualThreadsDemoApplication(
    val taskService: TaskService,
    @param:Value($$"${org.jesperancinha.vtcc.tasks}") private val tasks: Int,
) 

Example 2 (applying to fields, on lateinit vars

Replace this:

class BankCompanyLauncherOtherPropertiesKotlinTest {
    /**
     * Properties and environment variables
     */
    @Value($$"${environment}")
    private lateinit var environment: String
}

with this:

class BankCompanyLauncherOtherPropertiesKotlinTest {
    /**
     * Properties and environment variables
     */
    @field:Value($$"${environment}")
    private lateinit var environment: String
}

The same should be applied to annotation @Autowired, but only for non-test classes and only in Kotlin files. The same should be applied to annotation @JsonProperty, @JsonDeserialize, @JsonAlias, @LocalServerPort, but only in Kotlin files. Do not add @Autowired, or any form of it with a different target to any parameter. @Autowired usage should be removed from production code instead.

3. Checklist

[] Make sure there is no more use of @Value annotation being used directly [] Make sure no @param:Value has been changed in a Java file [] Check that all @param:Value annotations are used correctly

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

コメント

ログインなしで書き込めます。使ってみた感想、質問、動かなかった環境などを気軽にどうぞ。

まだコメントはありません。最初のコメントを書いてみませんか。

送信するとすぐに公開されます。メールアドレスや電話番号などの個人情報は書かないでください。URL は 2 つまでです。

0 / 1000 文字

このフォームは reCAPTCHA で保護されており、Google のプライバシーポリシーと利用規約が適用されます。

同じリポジトリのスキル

angular

無料

Conventions for Angular applications

日本語の概要は準備中です。原文の説明を表示しています。

jesperancinha/healthy-cameras32026年8月11日 更新

docker

無料

Conventions for docker

日本語の概要は準備中です。原文の説明を表示しています。

jesperancinha/healthy-cameras32026年8月11日 更新

Conventions for using in all JEE frameworks. These are common standards for CDI

日本語の概要は準備中です。原文の説明を表示しています。

jesperancinha/healthy-cameras32026年8月11日 更新

Conventions for using in all JVM languages

日本語の概要は準備中です。原文の説明を表示しています。

jesperancinha/healthy-cameras32026年8月11日 更新

Conventions for using Java

日本語の概要は準備中です。原文の説明を表示しています。

jesperancinha/healthy-cameras32026年8月11日 更新

Conventions for using Kotlin

日本語の概要は準備中です。原文の説明を表示しています。

jesperancinha/healthy-cameras32026年8月11日 更新

jesperancinha のスキルをすべて見る

このスキルの問題を報告する