Register ApplicationConversionService for context

Update `SpringApplication` to automatically register the shared
`ApplicationConversionService` instance with the `BeanFactory` and
`Environment`.

Closes gh-12148
This commit is contained in:
Phillip Webb
2018-09-11 14:21:56 -07:00
parent ab6bdc7ae2
commit 0c00508b3c
6 changed files with 74 additions and 7 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2012-2017 the original author or authors.
* Copyright 2012-2018 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -62,9 +62,9 @@ public class SampleSimpleApplicationTests {
@Test
public void testCommandLineOverrides() throws Exception {
SampleSimpleApplication.main(new String[] { "--name=Gordon" });
SampleSimpleApplication.main(new String[] { "--name=Gordon", "--duration=1m" });
String output = this.outputCapture.toString();
assertThat(output).contains("Hello Gordon");
assertThat(output).contains("Hello Gordon for 60 seconds");
}
}