Skip to content

Commit 08054cf

Browse files
committed
Merge pull request #36062 from quaff
* pr/36062: Polish "Replace @CsvSource with @valuesource where feasible" Replace @CsvSource with @valuesource where feasible Closes gh-36062
2 parents beb4010 + 09e5d38 commit 08054cf

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

spring-boot-project/spring-boot-tools/spring-boot-test-support/src/test/java/org/springframework/boot/testsupport/classpath/ModifiedClassPathExtensionForkParameterizedTests.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2022 the original author or authors.
2+
* Copyright 2012-2023 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -20,7 +20,7 @@
2020
import java.util.List;
2121

2222
import org.junit.jupiter.params.ParameterizedTest;
23-
import org.junit.jupiter.params.provider.CsvSource;
23+
import org.junit.jupiter.params.provider.ValueSource;
2424

2525
import static org.assertj.core.api.Assertions.assertThat;
2626

@@ -35,7 +35,7 @@ class ModifiedClassPathExtensionForkParameterizedTests {
3535
private static final List<String> arguments = new ArrayList<>();
3636

3737
@ParameterizedTest
38-
@CsvSource({ "one", "two", "three" })
38+
@ValueSource(strings = { "one", "two", "three" })
3939
void testIsInvokedOnceForEachArgument(String argument) {
4040
if (argument.equals("one")) {
4141
assertThat(arguments).isEmpty();

spring-boot-project/spring-boot/src/test/java/org/springframework/boot/context/config/ConfigDataEnvironmentTests.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
import org.junit.jupiter.api.Test;
2929
import org.junit.jupiter.api.TestInfo;
3030
import org.junit.jupiter.params.ParameterizedTest;
31-
import org.junit.jupiter.params.provider.CsvSource;
31+
import org.junit.jupiter.params.provider.ValueSource;
3232

3333
import org.springframework.boot.ConfigurableBootstrapContext;
3434
import org.springframework.boot.DefaultBootstrapContext;
@@ -229,7 +229,7 @@ protected ConfigDataEnvironmentContributors createContributors(
229229
}
230230

231231
@ParameterizedTest
232-
@CsvSource({ "include", "include[0]" })
232+
@ValueSource(strings = { "include", "include[0]" })
233233
void processAndApplyWhenHasProfileIncludeInProfileSpecificDocumentThrowsException(String property, TestInfo info) {
234234
this.environment.setProperty("spring.config.location", getConfigLocation(info));
235235
ConfigDataEnvironment configDataEnvironment = new ConfigDataEnvironment(this.logFactory, this.bootstrapContext,
@@ -253,7 +253,7 @@ protected ConfigDataEnvironmentContributors createContributors(
253253
}
254254

255255
@ParameterizedTest
256-
@CsvSource({ "spring.profiles.include", "spring.profiles.include[0]" })
256+
@ValueSource(strings = { "spring.profiles.include", "spring.profiles.include[0]" })
257257
void processAndApplyIncludesProfilesFromSpringProfilesInclude(String property, TestInfo info) {
258258
this.environment.setProperty("spring.config.location", getConfigLocation(info));
259259
ConfigDataEnvironment configDataEnvironment = new ConfigDataEnvironment(this.logFactory, this.bootstrapContext,

0 commit comments

Comments
 (0)