// Path: src/main/java/org/cloudfoundry/community/servicebroker/datalifecycle/controller/SanitizeController.java
// @RestController
// class SanitizeController {
// 
// 	@Autowired
// 	private DataProviderService dataService;
// 
// 	private static final String location = "/api/sanitizescript";
// 
// 	@RequestMapping(value = location, method = RequestMethod.GET)
// 	public ResponseEntity<JSONObject> getSanitizeScript() {
// 		String script = dataService.getScript();
// 		JSONObject response = new JSONObject();
// 		if (null != script) {
// 
// 			response.put("script", script);
// 		}
// 		return new ResponseEntity<JSONObject>(response, HttpStatus.OK);
// 	}
// 
// 	@RequestMapping(value = location, method = RequestMethod.POST, produces = "application/json")
// 	public ResponseEntity<String> addSanitizeScript(@RequestBody Map<String, Object> script) {
// 
// 		dataService.saveScript((String) script.get("script"));
// 		String response = "{}";
// 
// 		HttpHeaders headers = new HttpHeaders();
// 		UriComponents components = UriComponentsBuilder.fromPath(location)
// 				.buildAndExpand();
// 
// 		headers.setLocation(components.toUri());
// 		return new ResponseEntity<String>(response, headers, HttpStatus.CREATED);
// 	}
// }
// 
// Path: src/main/java/org/cloudfoundry/community/servicebroker/datalifecycle/service/DataProviderService.java
// @Service
// public class DataProviderService {
// 
// 	private ScriptRepo scriptRepo;
// 
// 	@Autowired
// 	public DataProviderService(ScriptRepo scriptRepo) {
// 		this.scriptRepo = scriptRepo;
// 	}
// 
// 	public void saveScript(String script) {
// 		scriptRepo.save(new SanitizationScript(script));
// 	}
// 
// 	/**
// 	 * Retrieve the sanitization script from the repo
// 	 * 
// 	 * @return the script if one has been set, null otherwise.
// 	 */
// 	public String getScript() {
// 		SanitizationScript result = scriptRepo.findOne(SanitizationScript.ID);
// 
// 		return result == null ? null : result.getScript();
// 	}
// }


import static org.hamcrest.Matchers.is;
import static org.mockito.Matchers.any;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.header;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
import net.minidev.json.JSONObject;
import org.cloudfoundry.community.servicebroker.datalifecycle.controller.SanitizeController;
import org.cloudfoundry.community.servicebroker.datalifecycle.service.DataProviderService;
import org.junit.Before;
import org.junit.Test;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
import org.springframework.http.MediaType;
import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
import org.springframework.test.web.servlet.MockMvc;
import org.springframework.test.web.servlet.setup.MockMvcBuilders;
package org.cloudfoundry.community.servicebroker.datalifecycle.controller;



public class SanitizeControllerTest {

	private MockMvc mockMvc;

	private String script = "drop * from table";

	private String location = "/api/sanitizescript";

	@InjectMocks
// Path: src/main/java/org/cloudfoundry/community/servicebroker/datalifecycle/controller/SanitizeController.java
// @RestController
// class SanitizeController {
// 
// 	@Autowired
// 	private DataProviderService dataService;
// 
// 	private static final String location = "/api/sanitizescript";
// 
// 	@RequestMapping(value = location, method = RequestMethod.GET)
// 	public ResponseEntity<JSONObject> getSanitizeScript() {
// 		String script = dataService.getScript();
// 		JSONObject response = new JSONObject();
// 		if (null != script) {
// 
// 			response.put("script", script);
// 		}
// 		return new ResponseEntity<JSONObject>(response, HttpStatus.OK);
// 	}
// 
// 	@RequestMapping(value = location, method = RequestMethod.POST, produces = "application/json")
// 	public ResponseEntity<String> addSanitizeScript(@RequestBody Map<String, Object> script) {
// 
// 		dataService.saveScript((String) script.get("script"));
// 		String response = "{}";
// 
// 		HttpHeaders headers = new HttpHeaders();
// 		UriComponents components = UriComponentsBuilder.fromPath(location)
// 				.buildAndExpand();
// 
// 		headers.setLocation(components.toUri());
// 		return new ResponseEntity<String>(response, headers, HttpStatus.CREATED);
// 	}
// }
// 
// Path: src/main/java/org/cloudfoundry/community/servicebroker/datalifecycle/service/DataProviderService.java
// @Service
// public class DataProviderService {
// 
// 	private ScriptRepo scriptRepo;
// 
// 	@Autowired
// 	public DataProviderService(ScriptRepo scriptRepo) {
// 		this.scriptRepo = scriptRepo;
// 	}
// 
// 	public void saveScript(String script) {
// 		scriptRepo.save(new SanitizationScript(script));
// 	}
// 
// 	/**
// 	 * Retrieve the sanitization script from the repo
// 	 * 
// 	 * @return the script if one has been set, null otherwise.
// 	 */
// 	public String getScript() {
// 		SanitizationScript result = scriptRepo.findOne(SanitizationScript.ID);
// 
// 		return result == null ? null : result.getScript();
// 	}
// }


// Path: src/test/java/org/cloudfoundry/community/servicebroker/datalifecycle/controller/SanitizeControllerTest.java
import static org.hamcrest.Matchers.is;
import static org.mockito.Matchers.any;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.header;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
import net.minidev.json.JSONObject;
import org.cloudfoundry.community.servicebroker.datalifecycle.controller.SanitizeController;
import org.cloudfoundry.community.servicebroker.datalifecycle.service.DataProviderService;
import org.junit.Before;
import org.junit.Test;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
import org.springframework.http.MediaType;
import org.springframework.http.converter.json.MappingJackson2HttpMessageConverter;
import org.springframework.test.web.servlet.MockMvc;
import org.springframework.test.web.servlet.setup.MockMvcBuilders;

package org.cloudfoundry.community.servicebroker.datalifecycle.controller;



public class SanitizeControllerTest {

	private MockMvc mockMvc;

	private String script = "drop * from table";

	private String location = "/api/sanitizescript";

	@InjectMocks
	SanitizeController sanitizeController;