idm = new InfinispanIDM(getDefaultCache());
RealmFactory factory = new RealmFactory(idm);
deployment.getProviderFactory().register(new SkeletonKeyContextResolver(true));
deployment.getRegistry().addSingletonResource(factory);
TokenManagement tokenManagement = new TokenManagement(idm);
deployment.getRegistry().addSingletonResource(tokenManagement);
RealmRepresentation r = loadJson(realmJson);
client = new ResteasyClientBuilder().build();
WebTarget target = client.target(generateURL("/realms"));