@Test public void testMulti() throws Exception { Request request = JsonRequestTranslator.load(new File("src/test/resources/Request-Multi.json")); validateMulti(request); }
public static Request load(String jsonString) throws JSONStructureException { try { GsonJsonRequest gsonRequest = gson.fromJson(new StringReader(jsonString), GsonJsonRequest.class); gsonRequest.postFromJsonDeserialization(); return gsonRequest.toXacmlRequest(); } catch (JsonSyntaxException | JsonIOException e) { throw new JSONStructureException("Failed to load json string " + jsonString.substring(0, 10), e); } }
JsonRequestTranslator { public static Request load(String jsonString) throws JSONStructureException { try { GsonJsonRequest gsonRequest = gson.fromJson(new StringReader(jsonString), GsonJsonRequest.class); gsonRequest.postFromJsonDeserialization(); return gsonRequest.toXacmlRequest(); } catch (JsonSyntaxException | JsonIOException e) { throw new JSONStructureException("Failed to load json string " + jsonString.substring(0, 10), e); } } }
JsonRequestTranslator { public static Request load(String jsonString) throws JSONStructureException { try { GsonJsonRequest gsonRequest = gson.fromJson(new StringReader(jsonString), GsonJsonRequest.class); gsonRequest.postFromJsonDeserialization(); return gsonRequest.toXacmlRequest(); } catch (JsonSyntaxException | JsonIOException e) { throw new JSONStructureException("Failed to load json string " + jsonString.substring(0, 10), e); } } private  JsonRequestTranslator(); }
JsonRequestTranslator { public static Request load(String jsonString) throws JSONStructureException { try { GsonJsonRequest gsonRequest = gson.fromJson(new StringReader(jsonString), GsonJsonRequest.class); gsonRequest.postFromJsonDeserialization(); return gsonRequest.toXacmlRequest(); } catch (JsonSyntaxException | JsonIOException e) { throw new JSONStructureException("Failed to load json string " + jsonString.substring(0, 10), e); } } private  JsonRequestTranslator(); static Request load(String jsonString); static Request load(File fileRequest); static Request load(InputStream is); static String toString(Request request, boolean prettyPrint); }
JsonRequestTranslator { public static Request load(String jsonString) throws JSONStructureException { try { GsonJsonRequest gsonRequest = gson.fromJson(new StringReader(jsonString), GsonJsonRequest.class); gsonRequest.postFromJsonDeserialization(); return gsonRequest.toXacmlRequest(); } catch (JsonSyntaxException | JsonIOException e) { throw new JSONStructureException("Failed to load json string " + jsonString.substring(0, 10), e); } } private  JsonRequestTranslator(); static Request load(String jsonString); static Request load(File fileRequest); static Request load(InputStream is); static String toString(Request request, boolean prettyPrint);  }