title: How do I give request parameters for a POST using MockMvc
body: <p>I try to junit the following controller</p>
  
  <pre><code>  @RequestMapping(value="actions.htm", params="reqType=delete",method=RequestMethod.POST)
    @ResponseBody
    public String deletePendingAction(@RequestParam("aPk") Long aPk)
    {
      pendingActionsService.deletePendingAction(aPk);
      return "Deleted";
    }
  </code></pre>
  
  <p>I use params="reqType=delete" and this is I think the reason why junit fails to map to the controller. I tested all other controllers and they work fine without params tag to the controller. My junit config is:</p>
  
  <pre><code>@RunWith(SpringJUnit4ClassRunner.class)
  @WebAppConfiguration
  @ContextConfiguration(classes = ApplicationConfig.class,loader = AnnotationConfigWebContextLoader.class)
  @TransactionConfiguration(defaultRollback = true)
  @Transactional
  public class JUnitTests {
  
    @Autowired
    private WebApplicationContext wac;
  
    private MockMvc mockMvc;
  
     @Before
     public void SetupContext()
     {
       this.mockMvc = MockMvcBuilders.webAppContextSetup(this.wac).build();
     }
  
     @Test
     public void testController() throws Exception
     {
        this.mockMvc.perform(post("/actions.htm","reqType=delete").param("aPk","2"));
     }
  }
  </code></pre>
  
  <p>How do I translate this params tag to the spring mvc junit? Thank you</p>