Skip to content

Commit 8817574

Browse files
committed
Use static import for Collections.singleton
Replace Collections.singleton(key) with a static import singleton(key) in BaseTest.java and remove the now-unused java.util.Collections import. Also apply small whitespace/formatting adjustments around fields; no functional behavior changes.
1 parent f1c95fa commit 8817574

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

  • microsphere-spring-cloud-openfeign/src/test/java/io/microsphere/spring/cloud/openfeign

microsphere-spring-cloud-openfeign/src/test/java/io/microsphere/spring/cloud/openfeign/BaseTest.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@
1515
import org.springframework.core.env.MutablePropertySources;
1616
import org.springframework.test.context.TestPropertySource;
1717

18-
import java.util.Collections;
1918
import java.util.HashMap;
2019
import java.util.Map;
2120
import java.util.Set;
2221

2322
import static io.microsphere.logging.LoggerFactory.getLogger;
23+
import static java.util.Collections.singleton;
2424

2525
/**
2626
* @author <a href="mailto:maimengzzz@gmail.com">韩超</a>
@@ -43,10 +43,13 @@
4343
public abstract class BaseTest<T> {
4444

4545
private static final Logger log = getLogger(BaseTest.class);
46+
4647
@Autowired
4748
private ApplicationEventPublisher publisher;
49+
4850
@Autowired
4951
private Environment environment;
52+
5053
@Autowired
5154
private BaseClient client;
5255

@@ -57,7 +60,7 @@ public abstract class BaseTest<T> {
5760

5861
public void replaceConfig() {
5962
final String key = afterTestComponentConfigKey();
60-
Set<String> keys = Collections.singleton(key);
63+
Set<String> keys = singleton(key);
6164
final Class<?> className = afterTestComponent();
6265
MutablePropertySources propertySources = ((ConfigurableEnvironment)this.environment).getPropertySources();
6366
Map<String, Object> map = new HashMap<>();

0 commit comments

Comments
 (0)