@Test public void setParamsTest() throws JSONException { JSONObject jsonObject = new JSONObject().put("key", "value"); nuggAd.setNuggAdData(jsonObject).setParams(); assertEquals(1, buffer.getVolatileParams().size()); assertEquals(0, buffer.getPersistentParams().size()); assertEquals(1, buffer.getVolatileParams().get("stc").getValues().size()); assertEquals(new JSONObject().put("nuggad", jsonObject).toString(), buffer.getVolatileParams().get("stc").getValues().get(0).execute()); }
@Override void setParams() { if (new ArrayList<>(Arrays.asList(((String) tracker.getConfiguration().get(TrackerConfigurationKeys.PLUGINS)).split(","))).contains("nuggad")) { try { tracker.setParam(Hit.HitParam.JSON.stringValue(), new JSONObject().put("nuggad", nuggAdData).toString(), new ParamOption().setAppend(true).setEncode(true).setType(ParamOption.Type.JSON)); } catch (JSONException e) { e.printStackTrace(); } } else { Tool.executeCallback(tracker.getListener(), Tool.CallbackType.WARNING, "NuggAd not enabled"); } }
NuggAd extends BusinessObject { @Override void setParams() { if (new ArrayList<>(Arrays.asList(((String) tracker.getConfiguration().get(TrackerConfigurationKeys.PLUGINS)).split(","))).contains("nuggad")) { try { tracker.setParam(Hit.HitParam.JSON.stringValue(), new JSONObject().put("nuggad", nuggAdData).toString(), new ParamOption().setAppend(true).setEncode(true).setType(ParamOption.Type.JSON)); } catch (JSONException e) { e.printStackTrace(); } } else { Tool.executeCallback(tracker.getListener(), Tool.CallbackType.WARNING, "NuggAd not enabled"); } } }
NuggAd extends BusinessObject { @Override void setParams() { if (new ArrayList<>(Arrays.asList(((String) tracker.getConfiguration().get(TrackerConfigurationKeys.PLUGINS)).split(","))).contains("nuggad")) { try { tracker.setParam(Hit.HitParam.JSON.stringValue(), new JSONObject().put("nuggad", nuggAdData).toString(), new ParamOption().setAppend(true).setEncode(true).setType(ParamOption.Type.JSON)); } catch (JSONException e) { e.printStackTrace(); } } else { Tool.executeCallback(tracker.getListener(), Tool.CallbackType.WARNING, "NuggAd not enabled"); } } NuggAd(Tracker tracker); }
NuggAd extends BusinessObject { @Override void setParams() { if (new ArrayList<>(Arrays.asList(((String) tracker.getConfiguration().get(TrackerConfigurationKeys.PLUGINS)).split(","))).contains("nuggad")) { try { tracker.setParam(Hit.HitParam.JSON.stringValue(), new JSONObject().put("nuggad", nuggAdData).toString(), new ParamOption().setAppend(true).setEncode(true).setType(ParamOption.Type.JSON)); } catch (JSONException e) { e.printStackTrace(); } } else { Tool.executeCallback(tracker.getListener(), Tool.CallbackType.WARNING, "NuggAd not enabled"); } } NuggAd(Tracker tracker);  }
NuggAd extends BusinessObject { @Override void setParams() { if (new ArrayList<>(Arrays.asList(((String) tracker.getConfiguration().get(TrackerConfigurationKeys.PLUGINS)).split(","))).contains("nuggad")) { try { tracker.setParam(Hit.HitParam.JSON.stringValue(), new JSONObject().put("nuggad", nuggAdData).toString(), new ParamOption().setAppend(true).setEncode(true).setType(ParamOption.Type.JSON)); } catch (JSONException e) { e.printStackTrace(); } } else { Tool.executeCallback(tracker.getListener(), Tool.CallbackType.WARNING, "NuggAd not enabled"); } } NuggAd(Tracker tracker);   }