Search in sources :

Example 1 with GetCacheEntryRequest

use of com.hazelcast.internal.management.request.GetCacheEntryRequest in project hazelcast by hazelcast.

the class GetCacheEntryRequestTest method testGetCacheEntry.

@Test
public void testGetCacheEntry() throws Exception {
    GetCacheEntryRequest request = new GetCacheEntryRequest("string", "test", "1");
    ICacheManager hazelcastCacheManager = hz.getCacheManager();
    ICache<String, String> cache = hazelcastCacheManager.getCache("test");
    cache.put("1", "one");
    JsonObject jsonObject = new JsonObject();
    request.writeResponse(managementCenterService, jsonObject);
    JsonObject result = (JsonObject) jsonObject.get("result");
    assertEquals("one", result.get("cacheBrowse_value").asString());
}
Also used : JsonObject(com.eclipsesource.json.JsonObject) GetCacheEntryRequest(com.hazelcast.internal.management.request.GetCacheEntryRequest) ICacheManager(com.hazelcast.core.ICacheManager) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test) ParallelTest(com.hazelcast.test.annotation.ParallelTest)

Aggregations

JsonObject (com.eclipsesource.json.JsonObject)1 ICacheManager (com.hazelcast.core.ICacheManager)1 GetCacheEntryRequest (com.hazelcast.internal.management.request.GetCacheEntryRequest)1 ParallelTest (com.hazelcast.test.annotation.ParallelTest)1 QuickTest (com.hazelcast.test.annotation.QuickTest)1 Test (org.junit.Test)1