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"));
Response response = target.request().post(Entity.json(r));
Assert.assertEquals(201, response.getStatus());