Skip to content

RequestParam defaultValue is not correctly reading from application.yml for integration tests #32212

@senocak

Description

@senocak

Affects: 3.2.2

  • id("org.springframework.boot") version "3.2.2"
  • kotlin("jvm") version "1.9.22"
  1. This is my requestparam to get the data from application.yml

@RequestParam(name = "size", defaultValue = "\${spring.data.web.pageable.default-page-size:10}", required = false) size: Int,

  1. When i try to run basic integration-test using @SpringBootTest i get following error;

Failed to convert value of type 'java.lang.String' to required type 'int'; For input string: "${spring.data.web.pageable.default-page-size:10}"

  1. I do have parameter defined in my yml so following works in same test;
    @Value("\${spring.data.web.pageable.default-page-size}") private lateinit var pageSize: String

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: invalidAn issue that we don't feel is valid

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions