use of org.eclipse.lsp4j.Diagnostic in project sts4 by spring-projects.
the class ManifestYamlEditorTest method reconcileRouteFormat.
@Test
public void reconcileRouteFormat() throws Exception {
Editor editor = harness.newEditor("applications:\n" + "- name: foo\n" + " routes:\n" + " - route: http://springsource.org\n");
editor.assertProblems("http://springsource.org|is not a valid 'Route'");
Diagnostic problem = editor.assertProblem("http://springsource.org");
assertEquals(DiagnosticSeverity.Error, problem.getSeverity());
editor = harness.newEditor("applications:\n" + "- name: foo\n" + " routes:\n" + " - route: spring source.org\n");
editor.assertProblems("spring source.org|is not a valid 'Route'");
problem = editor.assertProblem("spring source.org");
assertEquals(DiagnosticSeverity.Error, problem.getSeverity());
editor = harness.newEditor("applications:\n" + "- name: foo\n" + " routes:\n" + " - route: springsource.org:kuku\n");
editor.assertProblems("springsource.org:kuku|is not a valid 'Route'");
problem = editor.assertProblem("springsource.org:kuku");
assertEquals(DiagnosticSeverity.Error, problem.getSeverity());
editor = harness.newEditor("applications:\n" + "- name: foo\n" + " routes:\n" + " - route: springsource.org/kuku?p=23\n");
editor.assertProblems("springsource.org/kuku?p=23|is not a valid 'Route'");
problem = editor.assertProblem("springsource.org/kuku?p=23");
assertEquals(DiagnosticSeverity.Error, problem.getSeverity());
editor = harness.newEditor("applications:\n" + "- name: foo\n" + " routes:\n" + " - route: springsource.org:645788\n");
editor.assertProblems("springsource.org:645788|is not a valid 'Route'");
problem = editor.assertProblem("springsource.org:645788");
assertEquals(DiagnosticSeverity.Error, problem.getSeverity());
}
Aggregations