List of usage examples for org.springframework.http MediaType APPLICATION_JSON_UTF8_VALUE
String APPLICATION_JSON_UTF8_VALUE
To view the source code for org.springframework.http MediaType APPLICATION_JSON_UTF8_VALUE.
Click Source Link
From source file:com.vmware.gemfire.tools.pulse.controllers.PulseControllerJUnitTest.java
@Test public void authenticateUserNotLoggedIn() throws Exception { this.mockMvc/* ww w . j ava 2 s.co m*/ .perform(get("/authenticateUser") .accept(MediaType.parseMediaType(MediaType.APPLICATION_JSON_UTF8_VALUE))) .andExpect(status().isOk()).andExpect(jsonPath("$.isUserLoggedIn").value(false)); }
From source file:com.vmware.gemfire.tools.pulse.controllers.PulseControllerJUnitTest.java
@Test public void authenticateUserLoggedIn() throws Exception { this.mockMvc/*from ww w . j ava2 s . c o m*/ .perform(get("/authenticateUser").principal(principal) .accept(MediaType.parseMediaType(MediaType.APPLICATION_JSON_UTF8_VALUE))) .andExpect(status().isOk()).andExpect(jsonPath("$.isUserLoggedIn").value(true)); }
From source file:com.vmware.gemfire.tools.pulse.controllers.PulseControllerJUnitTest.java
@Test public void pulseVersion() throws Exception { this.mockMvc/*from ww w. j av a2 s.c o m*/ .perform(get("/pulseVersion") .accept(MediaType.parseMediaType(MediaType.APPLICATION_JSON_UTF8_VALUE))) .andExpect(status().isOk()).andExpect(jsonPath("$.pulseVersion").isNotEmpty()) .andExpect(jsonPath("$.buildId").isNotEmpty()).andExpect(jsonPath("$.buildDate").isNotEmpty()) .andExpect(jsonPath("$.sourceDate").isNotEmpty()) .andExpect(jsonPath("$.sourceRevision").isNotEmpty()) .andExpect(jsonPath("$.sourceRepository").isNotEmpty()); }
From source file:com.vmware.gemfire.tools.pulse.controllers.PulseControllerJUnitTest.java
@Test public void clearAlerts() throws Exception { this.mockMvc/*from w w w. ja v a 2s.com*/ .perform(get("/clearAlerts").param("alertType", "1") .accept(MediaType.parseMediaType(MediaType.APPLICATION_JSON_UTF8_VALUE))) .andExpect(status().isOk()).andExpect(jsonPath("$.pageNumber").value(1)) .andExpect(jsonPath("$.systemAlerts").isEmpty()).andExpect(jsonPath("$.connectedFlag").value(false)) .andExpect(jsonPath("$.status").value("deleted")); }
From source file:com.vmware.gemfire.tools.pulse.controllers.PulseControllerJUnitTest.java
@Test public void acknowledgeAlert() throws Exception { this.mockMvc/*from ww w . j a v a2 s . co m*/ .perform(get("/acknowledgeAlert").param("alertId", "1") .accept(MediaType.parseMediaType(MediaType.APPLICATION_JSON_UTF8_VALUE))) .andExpect(status().isOk()).andExpect(jsonPath("$.status").value("deleted")); }
From source file:com.vmware.gemfire.tools.pulse.controllers.PulseControllerJUnitTest.java
@Test public void dataBrowserRegions() throws Exception { this.mockMvc//w ww. ja v a 2 s. c o m .perform(get("/dataBrowserRegions") .accept(MediaType.parseMediaType(MediaType.APPLICATION_JSON_UTF8_VALUE))) .andExpect(status().isOk()).andExpect(jsonPath("$.clusterName").value(CLUSTER_NAME)) .andExpect(jsonPath("$.connectedFlag").value(false)) .andExpect(jsonPath("$.clusterRegions[0].fullPath").value(REGION_PATH)) .andExpect(jsonPath("$.clusterRegions[0].regionType").value(REGION_TYPE)); }
From source file:com.vmware.gemfire.tools.pulse.controllers.PulseControllerJUnitTest.java
@Test public void dataBrowserQuery() throws Exception { doReturn(mapper.createObjectNode().put("foo", "bar")).when(cluster).executeQuery(anyString(), anyString(), anyInt());// www. ja v a2s . com this.mockMvc .perform(get("/dataBrowserQuery").param("query", "SELECT * FROM " + REGION_PATH) .param("members", MEMBER_NAME).principal(principal) .accept(MediaType.parseMediaType(MediaType.APPLICATION_JSON_UTF8_VALUE))) .andExpect(status().isOk()).andExpect(jsonPath("$.foo").value("bar")); }
From source file:com.vmware.gemfire.tools.pulse.controllers.PulseControllerJUnitTest.java
@Test public void dataBrowserQueryHistory() throws Exception { dataBrowserQuery();/*from w w w .ja v a 2s . c o m*/ this.mockMvc .perform(get("/dataBrowserQueryHistory").param("action", "view").principal(principal) .accept(MediaType.parseMediaType(MediaType.APPLICATION_JSON_UTF8_VALUE))) .andExpect(status().isOk()) .andExpect(jsonPath("$.queryHistory[0].queryText").value("\"SELECT * FROM " + REGION_PATH + "\"")); }
From source file:com.vmware.gemfire.tools.pulse.controllers.PulseControllerJUnitTest.java
@Test public void pulseProductSupport() throws Exception { this.mockMvc//from w ww .jav a 2 s . c o m .perform(get("/pulseProductSupport") .accept(MediaType.parseMediaType(MediaType.APPLICATION_JSON_UTF8_VALUE))) .andExpect(status().isOk()).andExpect(jsonPath("$.product").value("gemfire")); }
From source file:com.vmware.gemfire.tools.pulse.controllers.PulseControllerJUnitTest.java
@Test public void getQueryStatisticsGridModel() throws Exception { this.mockMvc/*ww w . j a v a 2 s .com*/ .perform(get("/getQueryStatisticsGridModel").principal(principal) .accept(MediaType.parseMediaType(MediaType.APPLICATION_JSON_UTF8_VALUE))) .andExpect(status().isOk()) .andExpect(jsonPath("$.columnNames", containsInAnyOrder("Query", "NumExecution", "TotalExecutionTime(ns)", "NumExecutionsInProgress", "NumTimesCompiled", "NumTimesGlobalIndexLookup", "NumRowsModified", "ParseTime(ms)", "BindTime(ms)", "OptimizeTime(ms)", "RoutingInfoTime(ms)", "GenerateTime(ms)", "TotalCompilationTime(ms)", "ExecutionTime(ns)", "ProjectionTime(ns)", "RowsModificationTime(ns)", "QNNumRowsSeen", "QNMsgSendTime(ns)", "QNMsgSerTime(ns)", "QNRespDeSerTime(ns)"))); }