// Path: src/main/java/org/cloudfoundry/community/servicebroker/datalifecycle/model/SanitizationScript.java
// @Entity
// public class SanitizationScript {
// 
// 	public final static long ID = 1;
// 
// 	@Id
// 	private long id = ID;
// 
// 	private String script;
// 
// 	protected SanitizationScript() {
// 	}
// 
// 	public SanitizationScript(final String script) {
// 		this.setScript(script);
// 	}
// 
// 	public String getScript() {
// 		return script;
// 	}
// 
// 	private void setScript(String script) {
// 		this.script = script;
// 	}
// 
// 	public long getId() {
// 		return id;
// 	}
// 
// 	public void setId(long id) {
// 		this.id = id;
// 	}
// }
// 
// Path: src/main/java/org/cloudfoundry/community/servicebroker/datalifecycle/repo/ScriptRepo.java
// public interface ScriptRepo extends CrudRepository<SanitizationScript, Long> {
// 
// }
// 
// 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.hamcrest.Matchers.notNullValue;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertThat;
import static org.mockito.Matchers.argThat;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import org.cloudfoundry.community.servicebroker.datalifecycle.model.SanitizationScript;
import org.cloudfoundry.community.servicebroker.datalifecycle.repo.ScriptRepo;
import org.cloudfoundry.community.servicebroker.datalifecycle.service.DataProviderService;
import org.junit.Before;
import org.junit.Test;
import org.mockito.ArgumentMatcher;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
package org.cloudfoundry.community.servicebroker.datalifecycle.service;



public class DataProviderServiceTest {

	@Mock
	ScriptRepo scriptRepo;

	private DataProviderService service;

	@Before
	public void setUp() {
		MockitoAnnotations.initMocks(this);
		service = new DataProviderService(scriptRepo);
	}

	@Test
	public void itShouldSaveTheScript() {
		service.saveScript("The Script");
		verify(scriptRepo, times(1)).save(
// Path: src/main/java/org/cloudfoundry/community/servicebroker/datalifecycle/model/SanitizationScript.java
// @Entity
// public class SanitizationScript {
// 
// 	public final static long ID = 1;
// 
// 	@Id
// 	private long id = ID;
// 
// 	private String script;
// 
// 	protected SanitizationScript() {
// 	}
// 
// 	public SanitizationScript(final String script) {
// 		this.setScript(script);
// 	}
// 
// 	public String getScript() {
// 		return script;
// 	}
// 
// 	private void setScript(String script) {
// 		this.script = script;
// 	}
// 
// 	public long getId() {
// 		return id;
// 	}
// 
// 	public void setId(long id) {
// 		this.id = id;
// 	}
// }
// 
// Path: src/main/java/org/cloudfoundry/community/servicebroker/datalifecycle/repo/ScriptRepo.java
// public interface ScriptRepo extends CrudRepository<SanitizationScript, Long> {
// 
// }
// 
// 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/service/DataProviderServiceTest.java
import static org.hamcrest.Matchers.is;
import static org.hamcrest.Matchers.notNullValue;
import static org.junit.Assert.assertNull;
import static org.junit.Assert.assertThat;
import static org.mockito.Matchers.argThat;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
import org.cloudfoundry.community.servicebroker.datalifecycle.model.SanitizationScript;
import org.cloudfoundry.community.servicebroker.datalifecycle.repo.ScriptRepo;
import org.cloudfoundry.community.servicebroker.datalifecycle.service.DataProviderService;
import org.junit.Before;
import org.junit.Test;
import org.mockito.ArgumentMatcher;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;

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



public class DataProviderServiceTest {

	@Mock
	ScriptRepo scriptRepo;

	private DataProviderService service;

	@Before
	public void setUp() {
		MockitoAnnotations.initMocks(this);
		service = new DataProviderService(scriptRepo);
	}

	@Test
	public void itShouldSaveTheScript() {
		service.saveScript("The Script");
		verify(scriptRepo, times(1)).save(
				argThat(new ArgumentMatcher<SanitizationScript>() {