Skip to content

Potential Regression with Configuration Properties in Spring Boot 3.5.1 #46038

Closed as duplicate of#46039
@dietzsch

Description

@dietzsch

Hello,

when updating one of my applications from Spring Boot 3.5.0 to 3.5.1/3.5.2 a few testcases started to fail when loading Configuration Properties in my integration tests. It seems that when a configuration property is defined as list it does not work anymore.

I have a Configuration Property like this:

@Getter
@Setter
@Configuration
@NoArgsConstructor
@AllArgsConstructor
@ConfigurationProperties("openstack.server.os")
public class OpenStackServerOs {
  private List<Template> templates;

  /** Configuration Property for Templates */
  @Getter
  @Setter
  @NoArgsConstructor
  @AllArgsConstructor
  public static class Template {
    private String name;
    private boolean isDefault;
    private List<OperatingSystem> operatingSystem;
    private TemplateType type;
    private List<CloudInitFile> files;
  }

  public enum TemplateType {
    YML,
    MULTI_PART
  }

  /** Configuration Property for Files */
  @Getter
  @Setter
  @NoArgsConstructor
  @AllArgsConstructor
  public static class CloudInitFile {
    private String filename;
    private String contentType;

    public String getFile() {
      return filename.substring(filename.lastIndexOf('/') + 1);
    }
  }
}

This code worked so far without issues, but now causes errors. I created a small demo project - https://github.com/dietzsch/demo. When running with Spring Boot 3.5.0 the test is successful, with 3.5.1/3.5.2 is causing an error.

Alex

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions