From 443f131443c5b44f8302b7575f65619c0b05d471 Mon Sep 17 00:00:00 2001 From: baubakg Date: Thu, 12 Sep 2024 09:01:04 +0200 Subject: [PATCH] Changed names of the plgin package environment variable --- README.md | 4 ++-- ReleaseNotes.md | 2 +- .../campaign/tests/bridge/service/ConfigValueHandlerIBS.java | 4 ++-- .../adobe/campaign/tests/bridge/service/IBSPluginManager.java | 4 ++-- .../com/adobe/campaign/tests/bridge/service/PluginTests.java | 4 ++-- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 810c0d49..bbe94573 100644 --- a/README.md +++ b/README.md @@ -511,9 +511,9 @@ We now allow the extraction and the formatting of Dates. This is done by setting ### Deserialization Plugins As of version 2.11.17, we introduced the notion of plugins. For now you can customize how an object is deserialized. This can be usefull when the default object serialization is incomplete or not to your liking. -To create your plugin you need to: +To create your own plugin you need to: * Implement the interface methods of the interface `com.adobe.campaign.tests.bridge.service.plugins.IBSDeserializerPlugin`. -* Add the package of the plugin to the environment variable `IBS.DESERIALIZATION.PLUGINS`. +* Flag the package of the plugin in the environment variable `IBS.PLUGINS.PACKAGE`. There is an example of the plugin in the tests under `integroBridgeService/src/test/java/com/adobe/campaign/tests/bridge/plugins/deserializer/MimeExtractionPluginDeserializer.java`. diff --git a/ReleaseNotes.md b/ReleaseNotes.md index 44bc6340..ed7fa5f4 100644 --- a/ReleaseNotes.md +++ b/ReleaseNotes.md @@ -8,8 +8,8 @@ * Ignoring methods returning objects that we do not have the rights to execute/access. * **New Environment Variables** * IBS.DESERIALIZATION.DEPTH.LIMIT : This value sets the maximum depth of the deserialization. - * IBS.PLUGINS.PATH : The package path in which IBS should search for the plugins. * IBS.DESERIALIZATION.DATE.FORMAT : The format in which the date should be deserialized. + * IBS.PLUGINS.PACKAGE : The package path in which the IBS should search for the plugins you write. ## 2.11.16 * **New Feature** [#3 Include an Assertion Feature](https://github.com/adobe/bridgeService/issues/3). We have now included the possibility for users to define assertions. This allows you to clarify accepted results for the call you make with the IBS. diff --git a/integroBridgeService/src/main/java/com/adobe/campaign/tests/bridge/service/ConfigValueHandlerIBS.java b/integroBridgeService/src/main/java/com/adobe/campaign/tests/bridge/service/ConfigValueHandlerIBS.java index 3934a858..c2a1ebe5 100644 --- a/integroBridgeService/src/main/java/com/adobe/campaign/tests/bridge/service/ConfigValueHandlerIBS.java +++ b/integroBridgeService/src/main/java/com/adobe/campaign/tests/bridge/service/ConfigValueHandlerIBS.java @@ -65,8 +65,8 @@ public void activate(String in_value) { "When set to true, we forbid the system from returning the value in the return payload. This is to avoid XSS attacks. This should ONLY be true when you want to debug."), DESERIALIZATION_DEPTH_LIMIT("IBS.DESERIALIZATION.DEPTH.LIMIT", "1", false, "This value sets the maximum depth of the deserialization."), - PLUGIN_DESERIALIZATION_PATH( - "IBS.PLUGINS.PATH", null, false, "The package path in which IBS should search for the plugins."), + PLUGINS_PACKAGE( + "IBS.PLUGINS.PACKAGE", null, false, "The package path in which IBS should search for the plugins."), DESERIALIZATION_DATE_FORMAT( "IBS.DESERIALIZATION.DATE.FORMAT", "NONE", false, "The date format to be used for deserialization."); diff --git a/integroBridgeService/src/main/java/com/adobe/campaign/tests/bridge/service/IBSPluginManager.java b/integroBridgeService/src/main/java/com/adobe/campaign/tests/bridge/service/IBSPluginManager.java index 889f21cf..9c06c4d6 100644 --- a/integroBridgeService/src/main/java/com/adobe/campaign/tests/bridge/service/IBSPluginManager.java +++ b/integroBridgeService/src/main/java/com/adobe/campaign/tests/bridge/service/IBSPluginManager.java @@ -50,9 +50,9 @@ static boolean appliesTo(Object in_object) { } static void loadPlugins() { - if (ConfigValueHandlerIBS.PLUGIN_DESERIALIZATION_PATH.isSet()) { + if (ConfigValueHandlerIBS.PLUGINS_PACKAGE.isSet()) { Reflections reflections = new Reflections( - ConfigValueHandlerIBS.PLUGIN_DESERIALIZATION_PATH.fetchValue()); + ConfigValueHandlerIBS.PLUGINS_PACKAGE.fetchValue()); Set> classes = reflections.getSubTypesOf( IBSDeserializerPlugin.class); diff --git a/integroBridgeService/src/test/java/com/adobe/campaign/tests/bridge/service/PluginTests.java b/integroBridgeService/src/test/java/com/adobe/campaign/tests/bridge/service/PluginTests.java index e8eb2c3a..1f86541f 100644 --- a/integroBridgeService/src/test/java/com/adobe/campaign/tests/bridge/service/PluginTests.java +++ b/integroBridgeService/src/test/java/com/adobe/campaign/tests/bridge/service/PluginTests.java @@ -136,7 +136,7 @@ public void testUsageOfTheExtractionPlugInConfigBased() throws MessagingExceptio assertThat("Since no plugin has been declared content should be generated by default", l_result.get("content"), Matchers.not(Matchers.instanceOf(List.class))); - ConfigValueHandlerIBS.PLUGIN_DESERIALIZATION_PATH.activate( + ConfigValueHandlerIBS.PLUGINS_PACKAGE.activate( "com.adobe.campaign.tests.bridge.plugins.deserializer"); IBSPluginManager.loadPlugins(); @@ -195,7 +195,7 @@ public void testExceptionsDuringPluginManager_invocationTarget() throws NoSuchMe @Test public void testExceptionsDuringPluginManager_illegalAccess() throws NoSuchMethodException { - ConfigValueHandlerIBS.PLUGIN_DESERIALIZATION_PATH.activate( + ConfigValueHandlerIBS.PLUGINS_PACKAGE.activate( "com.adobe.campaign.tests.bridge.service.data.plugins.badctor2"); try { IBSPluginManager.loadPlugins();