Hello all,
I'm using Converter to convert a JsonObject (a Map) to an Interface.
I've created this test for a scenario where any bundle is informed:
IProvisioningConfiguration config = CONVERTER.convert(json)
.to(IProvisioningConfiguration.class);
assertThat(config).isNotNull();
assertThat(config.delay()).isEqualTo(5);
assertThat(config.bundles()).isEmpty();
My problem is that I'm receiving a ConversionException when trying to
access a method from the interface which value was not supplied by the
source object map.
org.osgi.util.converter.ConversionException: No value for property:
bundles
at
org.osgi.util.converter.ConvertingImpl$4.invoke(ConvertingImpl.java:802)
at com.sun.proxy.$Proxy8.bundles(Unknown Source)
at
br.com.c8tech.vxosgi.config.JsonConvertionUnitTest.testProvisioningConfigurationJsonConvertionToInterface(JsonConvertionUnitTest.java:102)
Is there any way to work with optional values in the target interface
without get this exception ?
many thanks,
Cristiano