use of org.eclipse.lsp4j.Diagnostic in project sts4 by spring-projects.
the class ManifestYamlEditorTest method reconcileHealthCheckType.
@Test
public void reconcileHealthCheckType() throws Exception {
Editor editor;
Diagnostic problem;
editor = harness.newEditor("applications:\n" + "- name: my-app\n" + " health-check-type: http\n" + " health-check-http-endpoint: /health");
editor.assertProblems();
editor = harness.newEditor("applications:\n" + "- name: foo\n" + " health-check-type: none");
problem = editor.assertProblems("none|'none' is deprecated in favor of 'process'").get(0);
assertEquals(DiagnosticSeverity.Warning, problem.getSeverity());
editor = harness.newEditor("applications:\n" + "- name: foo\n" + " health-check-type: port");
editor.assertProblems();
editor = harness.newEditor("applications:\n" + "- name: foo\n" + " health-check-type: process");
editor.assertProblems();
}
use of org.eclipse.lsp4j.Diagnostic in project sts4 by spring-projects.
the class ManifestYamlEditorTest method reconcileShowsWarningOnUnknownService.
@Test
public void reconcileShowsWarningOnUnknownService() throws Exception {
ClientRequests cfClient = cloudfoundry.client;
CFServiceInstance service = Mockito.mock(CFServiceInstance.class);
when(service.getName()).thenReturn("myservice");
when(cfClient.getServices()).thenReturn(ImmutableList.of(service));
Editor editor = harness.newEditor("applications:\n" + "- name: foo\n" + " services:\n" + " - bad-service\n");
editor.assertProblems("bad-service|There is no service instance called");
Diagnostic problem = editor.assertProblem("bad-service");
assertEquals(DiagnosticSeverity.Warning, problem.getSeverity());
}
use of org.eclipse.lsp4j.Diagnostic in project sts4 by spring-projects.
the class ManifestYamlEditorTest method domainReconcile.
@Test
public void domainReconcile() throws Exception {
List<CFDomain> domains = ImmutableList.of(mockDomain("one.com"), mockDomain("two.com"));
when(cloudfoundry.client.getDomains()).thenReturn(domains);
Editor editor;
Diagnostic p;
editor = harness.newEditor("domain: bad.com");
p = editor.assertProblems("bad.com|unknown 'Domain'. Valid values are: [one.com, two.com]").get(0);
assertEquals(DiagnosticSeverity.Warning, p.getSeverity());
editor = harness.newEditor("domains:\n" + "- one.com\n" + "- bad.com\n" + "- two.com");
editor.assertProblems("bad.com|unknown 'Domain'. Valid values are: [one.com, two.com]");
}
use of org.eclipse.lsp4j.Diagnostic in project sts4 by spring-projects.
the class ManifestYamlEditorTest method reconcileShowsWarningOnNoService.
@Test
public void reconcileShowsWarningOnNoService() throws Exception {
ClientRequests cfClient = cloudfoundry.client;
when(cfClient.getServices()).thenReturn(ImmutableList.of());
Editor editor = harness.newEditor("applications:\n" + "- name: foo\n" + " services:\n" + " - bad-service\n");
editor.assertProblems("bad-service|There is no service instance called");
Diagnostic problem = editor.assertProblem("bad-service");
assertEquals(DiagnosticSeverity.Warning, problem.getSeverity());
}
use of org.eclipse.lsp4j.Diagnostic in project sts4 by spring-projects.
the class ManifestYamlEditorTest method deprecatedHealthCheckTypeQuickfix.
@Test
public void deprecatedHealthCheckTypeQuickfix() throws Exception {
Editor editor = harness.newEditor("applications:\n" + "- name: foo\n" + " health-check-type: none");
Diagnostic problem = editor.assertProblems("none|'none' is deprecated in favor of 'process'").get(0);
assertEquals(DiagnosticSeverity.Warning, problem.getSeverity());
CodeAction quickfix = editor.assertCodeAction(problem);
assertEquals("Replace deprecated value 'none' by 'process'", quickfix.getLabel());
quickfix.perform();
editor.assertRawText("applications:\n" + "- name: foo\n" + " health-check-type: process");
}
Aggregations