package ca.intelliware.ihtsdo.mlds.search;

import java.io.File;

import org.springframework.core.io.FileSystemResourceLoader;
import org.springframework.mock.web.MockServletContext;

public class AngularTranslateServiceSetup {
	MockServletContext mockServletContext;
	AngularTranslateService angularTranslateService;
	
	public void setup() {
		System.out.println("AngularTranslateServiceSetup - working directory is " + new File(".").getAbsolutePath());
		mockServletContext = new MockServletContext("src/main/webapp", new FileSystemResourceLoader());
		angularTranslateService = new AngularTranslateService();
		angularTranslateService.setServletContext(mockServletContext);
	}
}
@@ -41,30 +41,8 @@
 h;%0A%0A
-import java.io.File;%0A%0A
 impo
@@ -98,16 +98,16 @@
 Loader;%0A
+
 import o
@@ -320,117 +320,206 @@
 %7B%0A%09%09
-System.out.println(%22AngularTranslateServiceSetup - working directory is %22 + new File(%22.%22).getAbsolutePath());
+if (AngularTranslateService.getInstance() == null) %7B%0A%09%09%09angularTranslateService = new AngularTranslateService();%0A%09%09%7D else %7B%0A%09%09%09angularTranslateService = AngularTranslateService.getInstance();%0A%09%09%7D%0A%09%09
 %0A%09%09m
@@ -617,67 +617,8 @@
 ));%0A
-%09%09angularTranslateService = new AngularTranslateService();%0A
 %09%09an

Patch AngularTranslateService during test to avoid odd servlet resource location behaviour