Posts

Showing posts with the label testing

How to get current time when I hit a webserivce using jmeter

Image
How to get current time when I hit a webserivce using jmeter I run the create customer ws and wanted to capture the date time at which it is get executed in jmeter and pass that datetime into the Create Customer-verify OpDateTime JDBC sampler. Please help!!!!!! Below is the problem for which I need solution. Jmeter Screenshot 1 Answer 1 Add a " Regular Expression Extractor " as child of "Create Customer WS" Then passe the variable value to your other sampler: ${date} By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Spring MockMvc WebApplicationContext is null when running JUnit Tests with Maven

Spring MockMvc WebApplicationContext is null when running JUnit Tests with Maven I have a Spring mock-mvc JUnit test class that contains two tests. When I run the tests within Eclipse IDE both tests pass (I use Eclipse Maven plugin). When running the tests from the command line using mvn test one of the tests fails because the WebApplicationContext that is @Autowired is sometimes null. Here is my test class @WebAppConfiguration @ActiveProfiles({ "dev", "test" }) public class AddLinkEndpointMvcTest extends BaseMvc { @Autowired private WebApplicationContext wac; private MockMvc mockMvc; @Before public void before() { System.out.println("WAC = " + wac); mockMvc = MockMvcBuilders.webAppContextSetup(wac).build(); } @Test public void addLinkDoesNotSupportGet() throws Exception { mockMvc.perform(get("/myurl")).andExpect(status().is(HttpStatus.SC_METHOD_NOT_ALLOWED)); } @Test public v...