Testing @ConfigurationProperties based on spring-cloud-starter-vault-config with SPOCK

Viewed 32

I found these articles:

But, I did not found a testing process...

Here my class

import lombok.Data;
import org.hibernate.validator.constraints.NotBlank;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;

@Data
@Configuration
@ConfigurationProperties(prefix = "clients.my-microservice")
public class MyMicroserviceConfiguration {

    @NotBlank
    private String url;
    @NotBlank
    private String port;

}

For my configuration, I'm using HashiCorp Vault with spring-cloud-starter-vault-config

Does it make sense?

Is there any alternative to Test my MyMicroserviceConfiguration class using Spock?

Is there something testing for @ConfigurationProperties under these conditions?

0 Answers
Related