Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ibacher committed Nov 27, 2024
1 parent 2ede16b commit a1dd8a0
Showing 1 changed file with 4 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,13 @@
import com.fasterxml.jackson.databind.ObjectMapper;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.openmrs.web.test.BaseModuleWebContextSensitiveTest;
import org.springframework.beans.factory.ObjectFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
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.setup.MockMvcBuilders;
import org.springframework.web.context.WebApplicationContext;

import java.util.List;
import java.util.Map;
Expand All @@ -21,21 +18,18 @@
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;

@RunWith(SpringJUnit4ClassRunner.class)
@WebAppConfiguration
public class VisitControllerTest extends BaseModuleWebContextSensitiveTest {

@Autowired
private WebApplicationContext webApplicationContext;
private ObjectFactory<VisitController> controllerFactory;

private MockMvc mockMvc;

@Before
public void setUp() throws Exception {
executeDataSet("baseMetaData.xml");
executeDataSet("pastVisitSetup.xml");
mockMvc = MockMvcBuilders.webAppContextSetup(webApplicationContext).build();

mockMvc = MockMvcBuilders.standaloneSetup(controllerFactory.getObject()).build();
}

@Test
Expand Down

0 comments on commit a1dd8a0

Please sign in to comment.