/*******************************************************************************
 * Copyright (c) 2016 Pivotal, Inc.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *     Pivotal, Inc. - initial API and implementation
 *******************************************************************************/
package org.springframework.ide.vscode.boot.test;

import static org.assertj.core.api.Assertions.assertThat;

import java.io.File;
import java.net.URISyntaxException;
import java.nio.file.Paths;
import java.util.concurrent.Callable;

import org.eclipse.lsp4j.InitializeResult;
import org.eclipse.lsp4j.TextDocumentSyncKind;
import org.eclipse.lsp4j.services.LanguageServer;
import org.junit.Test;
import org.springframework.ide.vscode.boot.BootPropertiesLanguageServer;
import org.springframework.ide.vscode.commons.languageserver.util.SimpleLanguageServer;
import org.springframework.ide.vscode.languageserver.testharness.LanguageServerHarness;

/**
 * Boot app properties file language server tests
 * 
 * @author Alex Boyko
 *
 */
public class BootPropertiesLanguageServerTest {

	public static File getTestResource(String name) throws URISyntaxException {
		return Paths.get(BootPropertiesLanguageServer.class.getResource(name).toURI()).toFile();
	}

	private LanguageServerHarness newHarness() throws Exception {
		Callable<? extends SimpleLanguageServer> f = () -> new BootPropertiesLanguageServer((d) -> null, (d) -> null, (d) -> null);
		return new LanguageServerHarness(f);
	}
	
	@Test
	public void createAndInitializeServerWithWorkspace() throws Exception {
		LanguageServerHarness harness = newHarness();
		File workspaceRoot = getTestResource("/workspace/");
		assertExpectedInitResult(harness.intialize(workspaceRoot));
	}

	@Test
	public void createAndInitializeServerWithoutWorkspace() throws Exception {
		File workspaceRoot = null;
		LanguageServerHarness harness = newHarness();
		assertExpectedInitResult(harness.intialize(workspaceRoot));
	}
	
	private void assertExpectedInitResult(InitializeResult initResult) {
		assertThat(initResult.getCapabilities().getTextDocumentSync()).isEqualTo(TextDocumentSyncKind.Incremental);
	}

}

@@ -865,29 +865,29 @@
 p4j.
-services.LanguageServ
+jsonrpc.messages.Eith
 er;%0A
@@ -1215,17 +1215,16 @@
 tests%0A *
- 
 %0A * @aut
@@ -1697,18 +1697,17 @@
 (f);%0A%09%7D%0A
-%09
 %0A
+
 %09@Test%0A%09
@@ -2176,10 +2176,9 @@
 %0A%09%7D%0A
-%09
 %0A
+
 %09pri
@@ -2243,16 +2243,16 @@
 sult) %7B%0A
-
 %09%09assert
@@ -2306,16 +2306,26 @@
 ntSync()
+.getLeft()
 ).isEqua

Fix more failing tests