private static String createVendorExample() { VendorBean bean = newVendorBean().withName("Atlassian").withUrl("http://www.atlassian.com").build(); return gson.toJson(JsonExamplesUtils.createJsonObject("vendor", bean)); }
private static String createVendorExample() { VendorBean bean = newVendorBean().withName("Atlassian").withUrl("http://www.atlassian.com").build(); return gson.toJson(JsonExamplesUtils.createJsonObject("vendor", bean)); }
private static ConnectRunner newRemotePlugin(String product, String productBaseUrl) { final String addonKey = AddonTestUtils.randomAddonKey(); return new ConnectRunner(productBaseUrl, addonKey) .setAuthenticationToNone() .addScopes( ScopeName.READ, ScopeName.WRITE, ScopeName.DELETE, product.equals("jira") ? ScopeName.PROJECT_ADMIN : ScopeName.SPACE_ADMIN, ScopeName.ADMIN) .setVendor( new VendorBeanBuilder() .withName("Test Perf Vendor") .withUrl("www.example.com") .build()); } }
private static String createAddonExample() { Map<String, String> links = ImmutableMap.<String, String>builder().put("self", "http://www.example.com/connect/jira").build(); Set<ScopeName> scopes = Sets.newHashSet(ScopeName.READ, ScopeName.WRITE); ConnectAddonBean addonBean = newConnectAddonBean() .withKey("my-addon-key") .withName("My Connect Addon") .withDescription("A connect addon that does something") .withVendor(newVendorBean().withName("My Company").withUrl("http://www.example.com").build()) .withBaseurl("http://www.example.com/connect/jira") .withLinks(links) .withAuthentication(newAuthenticationBean().build()) .withLicensing(true) .withLifecycle(LifecycleBean.newLifecycleBean().withInstalled("/installed").withUninstalled("/uninstalled").build()) .withScopes(scopes) .build(); final JsonElement jsonRepresentation = gson.toJsonTree(addonBean); // Remove the version element from the example because our vendors should jsonRepresentation.getAsJsonObject().remove("version"); return gson.toJson(jsonRepresentation); }
private static String createAddonExample() { Map<String, String> links = ImmutableMap.<String, String>builder().put("self", "http://www.example.com/connect/jira").build(); Set<ScopeName> scopes = Sets.newHashSet(ScopeName.READ, ScopeName.WRITE); ConnectAddonBean addonBean = newConnectAddonBean() .withKey("my-addon-key") .withName("My Connect Addon") .withDescription("A connect addon that does something") .withVendor(newVendorBean().withName("My Company").withUrl("http://www.example.com").build()) .withBaseurl("http://www.example.com/connect/jira") .withLinks(links) .withAuthentication(newAuthenticationBean().build()) .withLicensing(true) .withLifecycle(LifecycleBean.newLifecycleBean().withInstalled("/installed").withUninstalled("/uninstalled").build()) .withScopes(scopes) .build(); final JsonElement jsonRepresentation = gson.toJsonTree(addonBean); // Remove the version element from the example because our vendors should jsonRepresentation.getAsJsonObject().remove("version"); return gson.toJson(jsonRepresentation); }
.withVendor(new VendorBeanBuilder() .withName(rawConnectAddonListingData.getVendorName().orElse(null)) .withUrl(rawConnectAddonListingData.getVendorUrl().orElse("")) .build()