[BAEL-3913] Fixed broken lines format and reduced the test method names length

This commit is contained in:
kkaravitis 2020-03-22 22:06:44 +02:00
parent f1f9e87468
commit adf1ee9b0d
6 changed files with 31 additions and 32 deletions

View File

@ -7,7 +7,8 @@ import org.springframework.context.annotation.Profile;
import org.springframework.stereotype.Component;
@Profile("!test")
@ConditionalOnProperty(prefix = "application.runner",
@ConditionalOnProperty(
prefix = "application.runner",
value = "enabled",
havingValue = "true",
matchIfMissing = true)

View File

@ -6,7 +6,8 @@ import org.springframework.context.annotation.Profile;
import org.springframework.stereotype.Component;
@Profile("!test")
@ConditionalOnProperty(prefix = "command.line.runner",
@ConditionalOnProperty(
prefix = "command.line.runner",
value = "enabled",
havingValue = "true",
matchIfMissing = true)

View File

@ -31,8 +31,7 @@ public class LoadSpringContextIntegrationTest {
ApplicationRunner applicationRunner;
@Test
void whenContextLoads_thenAllBeansAreLoadedButCommandLineAndApplicationRunnerAreNotExecuted()
throws Exception {
void whenContextLoads_thenRunnersDoNotRun() throws Exception {
assertNotNull(taskService);
assertNotNull(commandLineRunner);
assertNotNull(applicationRunner);

View File

@ -19,7 +19,7 @@ class RunApplicationIntegrationTest {
CommandLineTaskExecutor commandLineTaskExecutor;
@Test
void whenContextLoads_thenTheCommandLineAndApplicationRunnerAreExecuted() throws Exception {
void whenContextLoads_thenRunnersRun() throws Exception {
verify(applicationRunnerTaskExecutor, times(1)).run(any());
verify(commandLineTaskExecutor, times(1)).run(any());
}

View File

@ -21,7 +21,7 @@ class RunApplicationWithTestProfileIntegrationTest {
private ApplicationContext context;
@Test
void whenContextLoads_thenTheCommandLineAndApplicationRunnerAreNotLoaded() {
void whenContextLoads_thenRunnersAreNotLoaded() {
assertNotNull(context.getBean(TaskService.class));
assertThrows(NoSuchBeanDefinitionException.class,
() -> context.getBean(CommandLineTaskExecutor.class),

View File

@ -12,17 +12,15 @@ import com.baeldung.prevent.commandline.application.runner.execution.Application
import com.baeldung.prevent.commandline.application.runner.execution.CommandLineTaskExecutor;
import com.baeldung.prevent.commandline.application.runner.execution.TaskService;
@SpringBootTest(
properties = {
@SpringBootTest(properties = {
"command.line.runner.enabled=false",
"application.runner.enabled=false"
})
"application.runner.enabled=false" })
class RunApplicationWithTestPropertiesIntegrationTest {
@Autowired
private ApplicationContext context;
@Test
void whenContextLoads_thenTheCommandLineAndApplicationRunnerAreNotLoaded() {
void whenContextLoads_thenRunnersAreNotLoaded() {
assertNotNull(context.getBean(TaskService.class));
assertThrows(NoSuchBeanDefinitionException.class,
() -> context.getBean(CommandLineTaskExecutor.class),