Amit Pandey a54c9e0c9e Bael 4461 2 (#4444)
* [BAEL-4462] - Fixed integration tests

* [BAEL-4462] - Fixed integration tests

* [BAEL-4462] - Fixed integration tests

* [BAEL-4462] - Fixed integration tests

* [BAEL-4462] - Fixed integration tests

* [BAEL-4462] - Fixed integration tests

* [BAEL-4462] - Fixed integration tests

* [BAEL-4462] - Fixed integration tests

* [BAEL-4462] - Fixed integration tests

* [BAEL-4462] - Fixed integration tests

* [BAEL-4462] - Fixed integration tests

* [BAEL-4462] - Fixed integration tests

* [BAEL-4462] - Fixed integration tests

* [BAEL-4462] - Fixed integration tests

* Fix verification times
2018-06-11 10:18:30 +02:00

27 lines
941 B
Java

package com.baeldung.jcache;
import org.junit.Test;
import javax.cache.Cache;
import javax.cache.CacheManager;
import javax.cache.Caching;
import javax.cache.configuration.MutableConfiguration;
import javax.cache.spi.CachingProvider;
import static org.junit.Assert.assertEquals;
public class JCacheIntegrationTest {
@Test
public void instantiateCache() {
CachingProvider cachingProvider = Caching.getCachingProvider("com.hazelcast.cache.HazelcastCachingProvider");
CacheManager cacheManager = cachingProvider.getCacheManager();
MutableConfiguration<String, String> config = new MutableConfiguration<>();
Cache<String, String> cache = cacheManager.createCache("simpleCache", config);
cache.put("key1", "value1");
cache.put("key2", "value2");
assertEquals("value1", cache.get("key1"));
assertEquals("value2", cache.get("key2"));
cacheManager.close();
}
}