Add support for values of type java.time.Duration...
So that both application.properties and application.yml - recognize/treat these as atomic values - can recognize 'garbage' values during reconcile and give a error.
This commit is contained in:
@@ -78,6 +78,33 @@ public class ApplicationPropertiesEditorTest extends AbstractPropsEditorTest {
|
||||
editor.assertProblems("problem|extraneous input", "another|mismatched input");
|
||||
}
|
||||
|
||||
|
||||
@Test public void bug_158348104() throws Exception {
|
||||
//See: https://www.pivotaltracker.com/story/show/158348104
|
||||
data("spring.activemq.close-timeout", "java.time.Duration", null, null);
|
||||
|
||||
Editor editor;
|
||||
|
||||
editor = newEditor("");
|
||||
editor.assertContextualCompletions("springactcloti",
|
||||
"spring.activemq.close-timeout=<*>"
|
||||
);
|
||||
|
||||
editor = newEditor(
|
||||
"spring.activemq.close-timeout=garbage"
|
||||
);
|
||||
editor.assertProblems("garbage|not a valid duration");
|
||||
|
||||
editor = newEditor(
|
||||
"spring.activemq.close-timeout: 15s"
|
||||
);
|
||||
editor.assertProblems(/*NONE*/);
|
||||
|
||||
editor = newEditor(
|
||||
"spring.activemq.close-timeout: PT10S" //ISO duration format
|
||||
);
|
||||
editor.assertProblems(/*NONE*/);
|
||||
}
|
||||
@Test public void testServerPortCompletion() throws Exception {
|
||||
data("server.port", INTEGER, 8080, "Port where server listens for http.");
|
||||
assertCompletion("ser<*>", "server.port=<*>");
|
||||
|
||||
@@ -51,6 +51,41 @@ public class ApplicationYamlEditorTest extends AbstractPropsEditorTest {
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@Test public void bug_158348104() throws Exception {
|
||||
//See: https://www.pivotaltracker.com/story/show/158348104
|
||||
data("spring.activemq.close-timeout", "java.time.Duration", null, null);
|
||||
|
||||
Editor editor;
|
||||
|
||||
editor = newEditor("");
|
||||
editor.assertContextualCompletions("springactcloti",
|
||||
"spring:\n" +
|
||||
" activemq:\n" +
|
||||
" close-timeout: <*>"
|
||||
);
|
||||
|
||||
editor = newEditor(
|
||||
"spring:\n" +
|
||||
" activemq:\n" +
|
||||
" close-timeout: garbage"
|
||||
);
|
||||
editor.assertProblems("garbage|not a valid duration");
|
||||
|
||||
editor = newEditor(
|
||||
"spring:\n" +
|
||||
" activemq:\n" +
|
||||
" close-timeout: 15s"
|
||||
);
|
||||
editor.assertProblems(/*NONE*/);
|
||||
|
||||
editor = newEditor(
|
||||
"spring:\n" +
|
||||
" activemq:\n" +
|
||||
" close-timeout: PT10S" //ISO duration format
|
||||
);
|
||||
editor.assertProblems(/*NONE*/);
|
||||
}
|
||||
|
||||
@Test public void bug_153144391() throws Exception {
|
||||
//See: https://www.pivotaltracker.com/story/show/153144391
|
||||
useProject(createPredefinedMavenProject("empty-boot-1.3.0-app"));
|
||||
|
||||
Reference in New Issue
Block a user