From b26f887a2e733b05e4ac7c0d2ae91b4e8e2f72f8 Mon Sep 17 00:00:00 2001 From: lijuny <1920271554@qq.com> Date: Tue, 13 Aug 2019 18:51:19 +0800 Subject: [PATCH] Simplify some code See gh-17852 --- .../autoconfigure/LocalDevToolsAutoConfigurationTests.java | 3 +-- .../devtools/remote/client/ClassPathChangeUploaderTests.java | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/autoconfigure/LocalDevToolsAutoConfigurationTests.java b/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/autoconfigure/LocalDevToolsAutoConfigurationTests.java index 12bde8a9e49..248a49521e6 100644 --- a/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/autoconfigure/LocalDevToolsAutoConfigurationTests.java +++ b/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/autoconfigure/LocalDevToolsAutoConfigurationTests.java @@ -252,8 +252,7 @@ class LocalDevToolsAutoConfigurationTests { Restarter.initialize(new String[0], false, new MockRestartInitializer(), false); SpringApplication application = new SpringApplication(config); application.setDefaultProperties(getDefaultProperties(properties)); - ConfigurableApplicationContext context = application.run(args); - return context; + return application.run(args); } private Map getDefaultProperties(Map specifiedProperties) { diff --git a/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/remote/client/ClassPathChangeUploaderTests.java b/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/remote/client/ClassPathChangeUploaderTests.java index 2cd777db7f8..c9dfcd0732b 100644 --- a/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/remote/client/ClassPathChangeUploaderTests.java +++ b/spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/remote/client/ClassPathChangeUploaderTests.java @@ -139,8 +139,7 @@ class ClassPathChangeUploaderTests { files.add(new ChangedFile(sourceFolder, file3, Type.DELETE)); Set changeSet = new LinkedHashSet<>(); changeSet.add(new ChangedFiles(sourceFolder, files)); - ClassPathChangedEvent event = new ClassPathChangedEvent(this, changeSet, false); - return event; + return new ClassPathChangedEvent(this, changeSet, false); } private File createFile(File sourceFolder, String name) throws IOException {