Skip to content

Add Kotlin DSL extension functions for TestEntityManager#49063

Closed
dj258255 wants to merge 1 commit intospring-projects:mainfrom
dj258255:gh-37963-kotlin-test-entity-manager-extensions
Closed

Add Kotlin DSL extension functions for TestEntityManager#49063
dj258255 wants to merge 1 commit intospring-projects:mainfrom
dj258255:gh-37963-kotlin-test-entity-manager-extensions

Conversation

@dj258255
Copy link
Copy Markdown
Contributor

@dj258255 dj258255 commented Feb 5, 2026

Closes gh-37963

Add Kotlin reified extension functions for TestEntityManager:

  • find<Foo>(primaryKey) instead of find(Foo::class.java, primaryKey)
  • persistAndGetId<Long>(entity) instead of persistAndGetId(entity, Long::class.java)
  • getId<Long>(entity) instead of getId(entity, Long::class.java)

This follows the same pattern used in TestRestTemplateExtensions.kt

Closes spring-projectsgh-37963

Signed-off-by: Beom Su <dj258255@naver.com>
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Feb 5, 2026
@snicoll snicoll self-assigned this Feb 5, 2026
@snicoll snicoll added type: enhancement A general enhancement and removed status: waiting-for-triage An issue we've not yet triaged labels Feb 5, 2026
@snicoll snicoll added this to the 4.1.0-M2 milestone Feb 5, 2026
snicoll pushed a commit that referenced this pull request Feb 5, 2026
See gh-49063

Signed-off-by: Beom Su <dj258255@naver.com>
@snicoll snicoll closed this in 6cc1913 Feb 5, 2026
@snicoll
Copy link
Copy Markdown
Member

snicoll commented Feb 5, 2026

Good stuff, thanks @dj258255

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: enhancement A general enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Kotlin DSL extension functions for TestEntityManager

3 participants