// Path: core/src/test/java/org/soluvas/sanad/core/PropertyMockingApplicationContextInitializer.java
// public class PropertyMockingApplicationContextInitializer implements
// 		ApplicationContextInitializer<ConfigurableApplicationContext> {
// 
// 	@Override
// 	public void initialize(ConfigurableApplicationContext applicationContext) {
// 		MutablePropertySources propertySources = applicationContext
// 				.getEnvironment().getPropertySources();
// 		MockPropertySource mockEnvVars = new MockPropertySource()
// 			// PostgresConfig
// 			.withProperty("sqlUrl", "jdbc:postgresql://localhost/sanad_sanad_dev")
// 			.withProperty("sqlUser", "postgres")
// 			.withProperty("sqlPassword", "bippo")
// 			.withProperty("jpaHbm2DdlAuto", "update")
// 			// Multitenancy
// 			.withProperty("tenantEnv", "dev")
// 			.withProperty("workspaceDir", new File(System.getProperty("user.home"), "sanad_sanad_dev"))
// 			.withProperty("tenantId", "sanad")
// 			.withProperty("tenantSource", TenantSource.CONFIG);
// 		propertySources.replace(
// 				StandardEnvironment.SYSTEM_ENVIRONMENT_PROPERTY_SOURCE_NAME,
// 				mockEnvVars);
// 		
// 		final CustomScopeConfigurer scopeConfigurer = new CustomScopeConfigurer();
// 		scopeConfigurer.setScopes(ImmutableMap.<String, Object>of(WebApplicationContext.SCOPE_REQUEST, new RequestOrCommandScope()));
// 		applicationContext.addBeanFactoryPostProcessor(scopeConfigurer);
// 	}
// 
// }


import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
import javax.inject.Inject;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.soluvas.sanad.core.PropertyMockingApplicationContextInitializer;
import org.springframework.http.MediaType;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.context.web.WebAppConfiguration;
import org.springframework.test.web.servlet.MockMvc;
import org.springframework.test.web.servlet.MvcResult;
import org.springframework.test.web.servlet.ResultActions;
import org.springframework.test.web.servlet.setup.MockMvcBuilders;
import org.springframework.transaction.PlatformTransactionManager;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.context.WebApplicationContext;
package org.soluvas.sanad.core.mvc;




@RunWith(SpringJUnit4ClassRunner.class)
@WebAppConfiguration
// Path: core/src/test/java/org/soluvas/sanad/core/PropertyMockingApplicationContextInitializer.java
// public class PropertyMockingApplicationContextInitializer implements
// 		ApplicationContextInitializer<ConfigurableApplicationContext> {
// 
// 	@Override
// 	public void initialize(ConfigurableApplicationContext applicationContext) {
// 		MutablePropertySources propertySources = applicationContext
// 				.getEnvironment().getPropertySources();
// 		MockPropertySource mockEnvVars = new MockPropertySource()
// 			// PostgresConfig
// 			.withProperty("sqlUrl", "jdbc:postgresql://localhost/sanad_sanad_dev")
// 			.withProperty("sqlUser", "postgres")
// 			.withProperty("sqlPassword", "bippo")
// 			.withProperty("jpaHbm2DdlAuto", "update")
// 			// Multitenancy
// 			.withProperty("tenantEnv", "dev")
// 			.withProperty("workspaceDir", new File(System.getProperty("user.home"), "sanad_sanad_dev"))
// 			.withProperty("tenantId", "sanad")
// 			.withProperty("tenantSource", TenantSource.CONFIG);
// 		propertySources.replace(
// 				StandardEnvironment.SYSTEM_ENVIRONMENT_PROPERTY_SOURCE_NAME,
// 				mockEnvVars);
// 		
// 		final CustomScopeConfigurer scopeConfigurer = new CustomScopeConfigurer();
// 		scopeConfigurer.setScopes(ImmutableMap.<String, Object>of(WebApplicationContext.SCOPE_REQUEST, new RequestOrCommandScope()));
// 		applicationContext.addBeanFactoryPostProcessor(scopeConfigurer);
// 	}
// 
// }


// Path: core/src/test/java/org/soluvas/sanad/core/mvc/AnnotationTest.java
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.content;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.jsonPath;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
import javax.inject.Inject;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.soluvas.sanad.core.PropertyMockingApplicationContextInitializer;
import org.springframework.http.MediaType;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import org.springframework.test.context.web.WebAppConfiguration;
import org.springframework.test.web.servlet.MockMvc;
import org.springframework.test.web.servlet.MvcResult;
import org.springframework.test.web.servlet.ResultActions;
import org.springframework.test.web.servlet.setup.MockMvcBuilders;
import org.springframework.transaction.PlatformTransactionManager;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.context.WebApplicationContext;

package org.soluvas.sanad.core.mvc;




@RunWith(SpringJUnit4ClassRunner.class)
@WebAppConfiguration
@ContextConfiguration(classes=SanadMvcConfig.class, initializers=PropertyMockingApplicationContextInitializer.class)