Package org.springframework.test.web.servlet

Examples of org.springframework.test.web.servlet.MockMvc.perform()


    handlers.add(handler);
    RealTimeUpdateController controller = new RealTimeUpdateController(new HashMap<String, String>(), handlers, "shhhhh!!!!");
    MockMvc mockMvc =
        standaloneSetup(controller)
        .build();
    mockMvc.perform(post("/realtime/facebook/foo")
              .contentType(APPLICATION_JSON)
              .content(jsonFromFile("rtupdate-simple"))
              .header("X-Hub-Signature", "sha1=765aa709e93724268969ad0cd922d6e0acbb3f35"))
      .andExpect(content().string(""));
    mockMvc.perform(post("/realtime/facebook/bar")
View Full Code Here


    mockMvc.perform(post("/realtime/facebook/foo")
              .contentType(APPLICATION_JSON)
              .content(jsonFromFile("rtupdate-simple"))
              .header("X-Hub-Signature", "sha1=765aa709e93724268969ad0cd922d6e0acbb3f35"))
      .andExpect(content().string(""));
    mockMvc.perform(post("/realtime/facebook/bar")
        .contentType(APPLICATION_JSON)
        .content(jsonFromFile("rtupdate-simple"))
        .header("X-Hub-Signature", "sha1=765aa709e93724268969ad0cd922d6e0acbb3f35"))
      .andExpect(content().string(""));
   
View Full Code Here

    handlers.add(handler);
    RealTimeUpdateController controller = new RealTimeUpdateController(new HashMap<String, String>(), handlers, "shhhhh!!!!");
    MockMvc mockMvc =
        standaloneSetup(controller)
        .build();
    mockMvc.perform(post("/realtime/facebook/foo")
              .contentType(APPLICATION_JSON)
              .content(jsonFromFile("rtupdate-simple"))
              .header("X-Hub-Signature", "sha1=765aa709e93724268969ad0cd922d6e0acbb3f36"))
      .andExpect(content().string(""));
   
View Full Code Here

    handlers.add(handler);
    RealTimeUpdateController controller = new RealTimeUpdateController(new HashMap<String, String>(), handlers, "shhhhh!!!!");
    MockMvc mockMvc =
        standaloneSetup(controller)
        .build();
    mockMvc.perform(post("/realtime/facebook/foo")
              .contentType(APPLICATION_JSON)
              .content(jsonFromFile("rtupdate-simple")))
      .andExpect(content().string(""));
   
    MultiValueMap<String, RealTimeUpdate> updates = handler.getUpdates();
View Full Code Here

    ConnectionRepository connectionRepository = usersConnectionRepository.createConnectionRepository("habuma");
    connectionRepository.addConnection(connection);
    assertEquals(1, connectionRepository.findAllConnections().size());
    DisconnectController controller = new DisconnectController(usersConnectionRepository, CLIENT_SECRET);
    MockMvc mockMvc = standaloneSetup(controller).build();
    mockMvc.perform(post("/disconnect/facebook").param("signed_request", SIGNED_REQUEST))
      .andExpect(status().isNoContent());   
    assertEquals(0, connectionRepository.findAllConnections().size());
  }
 
}
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.