public ShallowConnectAddonBean() { this.key = ""; this.name = ""; this.version = "1.0"; this.description = ""; this.vendor = VendorBean.newVendorBean().build(); this.links = newHashMap(); this.lifecycle = LifecycleBean.newLifecycleBean().build(); this.scopes = new HashSet<>(); this.baseUrl = ""; this.authentication = newAuthenticationBean().build(); this.enableLicensing = null; }
private static String createLifecycleExample() { LifecycleBean bean = LifecycleBean.newLifecycleBean() .withInstalled("/installed") .withUninstalled("/uninstalled") .withEnabled("/enabled") .withDisabled("/disabled") .build(); return gson.toJson(bean); }
private static String createLifecycleExample() { LifecycleBean bean = LifecycleBean.newLifecycleBean() .withInstalled("/installed") .withUninstalled("/uninstalled") .withEnabled("/enabled") .withDisabled("/disabled") .build(); return gson.toJson(bean); }
public ConnectRunner addDisableLifecycle() { LifecycleBean lifecycle = getLifecycle(); addonBuilder.withLifecycle(newLifecycleBean(lifecycle).withDisabled(DISABLED_PATH).build()); return this; }
public ConnectRunner addEnableLifecycle() { LifecycleBean lifecycle = getLifecycle(); addonBuilder.withLifecycle(newLifecycleBean(lifecycle).withEnabled(ENABLED_PATH).build()); return this; }
public ConnectRunner addInstallLifecycle() { LifecycleBean lifecycle = getLifecycle(); addonBuilder.withLifecycle(newLifecycleBean(lifecycle).withInstalled(INSTALLED_PATH).build()); return this; }
public ConnectRunner addUninstallLifecycle() { LifecycleBean lifecycle = getLifecycle(); addonBuilder.withLifecycle(newLifecycleBean(lifecycle).withUninstalled(UNINSTALLED_PATH).build()); return this; }
private LifecycleBean getLifecycle() { if (null == addonBuilder.getLifecycle()) { addonBuilder.withLifecycle(newLifecycleBean().build()); } return addonBuilder.getLifecycle(); }
public ConnectRunner addEnableLifecycle() { LifecycleBean lifecycle = getLifecycle(); addonBuilder.withLifecycle(newLifecycleBean(lifecycle).withEnabled(ENABLED_PATH).build()); return this; }
public ConnectRunner addUninstallLifecycle() { LifecycleBean lifecycle = getLifecycle(); addonBuilder.withLifecycle(newLifecycleBean(lifecycle).withUninstalled(UNINSTALLED_PATH).build()); return this; }
private LifecycleBean getLifecycle() { if (null == addonBuilder.getLifecycle()) { addonBuilder.withLifecycle(newLifecycleBean().build()); } return addonBuilder.getLifecycle(); }
public ConnectRunner addInstallLifecycle() { LifecycleBean lifecycle = getLifecycle(); addonBuilder.withLifecycle(newLifecycleBean(lifecycle).withInstalled(INSTALLED_PATH).build()); return this; }
public ConnectRunner addDisableLifecycle() { LifecycleBean lifecycle = getLifecycle(); addonBuilder.withLifecycle(newLifecycleBean(lifecycle).withDisabled(DISABLED_PATH).build()); return this; }
public ShallowConnectAddonBean() { this.key = ""; this.name = ""; this.version = "1.0"; this.description = ""; this.vendor = VendorBean.newVendorBean().build(); this.links = newHashMap(); this.lifecycle = LifecycleBean.newLifecycleBean().build(); this.scopes = new HashSet<>(); this.baseUrl = ""; this.authentication = newAuthenticationBean().build(); this.enableLicensing = false; this.translations = TranslationsBean.empty(); this.dependencies = new DependenciesBean(); }
this.lifecycle = LifecycleBean.newLifecycleBean().build();
this.lifecycle = LifecycleBean.newLifecycleBean().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); }
private ConnectAddonBean createAddonBeanWithScope(ScopeName scopeName) { final String key = getPluginKeyForScopeName(scopeName); ConnectAddonBeanBuilder connectAddonBeanBuilder = newConnectAddonBean() .withKey(key) .withName(key) .withBaseurl(testPluginInstaller.getInternalAddonBaseUrl(key)) .withLicensing(true) .withAuthentication(newAuthenticationBean() .withType(AuthenticationType.JWT) .build()) .withLifecycle(newLifecycleBean() .withInstalled("/installed") .build()) .withModule("generalPages", newPageBean() .withUrl("/hello-world.html") .withKey("general") .withName(I18nProperty.value("Greeting")) .build()); // scopes are optional so that we can have "no scopes" test classes if (null != scopeName) { connectAddonBeanBuilder = connectAddonBeanBuilder.withScopes(new HashSet<>(singletonList(scopeName))); } return connectAddonBeanBuilder.build(); } }