use of io.helidon.common.SerializationConfig in project helidon by oracle.
the class DeserializationTest method configureDeserialization.
@BeforeAll
static void configureDeserialization() {
ObjectInputFilter myFilter = filterInfo -> {
if (filterInfo.serialClass() == null) {
return ObjectInputFilter.Status.UNDECIDED;
}
if (filterInfo.serialClass().equals(Configured.class)) {
return ObjectInputFilter.Status.ALLOWED;
}
return ObjectInputFilter.Status.UNDECIDED;
};
ObjectInputFilter.Config.setSerialFilter(myFilter);
// JDK Filter configured in pom.xml
SerializationConfig sc = SerializationConfig.builder().onWrongConfig(SerializationConfig.Action.FAIL).onNoConfig(SerializationConfig.Action.IGNORE).ignoreFiles(false).traceSerialization(SerializationConfig.TraceOption.NONE).build();
// should fail, as we do not have a blacklist for all other
assertThrows(IllegalStateException.class, sc::configure);
}
use of io.helidon.common.SerializationConfig in project helidon by oracle.
the class DeserializationTest method configureDeserialization.
@BeforeAll
static void configureDeserialization() {
// JDK Filter configured in pom.xml
SerializationConfig sc = SerializationConfig.builder().onWrongConfig(SerializationConfig.Action.FAIL).onNoConfig(SerializationConfig.Action.IGNORE).ignoreFiles(false).traceSerialization(SerializationConfig.TraceOption.NONE).build();
// should fail, as we do not have a blacklist for all other
assertThrows(IllegalStateException.class, sc::configure);
}
use of io.helidon.common.SerializationConfig in project helidon by oracle.
the class DeserializationTest method configureDeserialization.
@BeforeAll
static void configureDeserialization() {
ObjectInputFilter myFilter = filterInfo -> {
if (filterInfo.serialClass() == null) {
return ObjectInputFilter.Status.UNDECIDED;
}
if (filterInfo.serialClass().equals(Configured.class)) {
return ObjectInputFilter.Status.ALLOWED;
}
return ObjectInputFilter.Status.REJECTED;
};
ObjectInputFilter.Config.setSerialFilter(myFilter);
SerializationConfig sc = SerializationConfig.builder().onWrongConfig(SerializationConfig.Action.FAIL).onNoConfig(SerializationConfig.Action.IGNORE).ignoreFiles(false).traceSerialization(SerializationConfig.TraceOption.NONE).build();
// should not fail, as we have a blacklist for all other
sc.configure();
}
use of io.helidon.common.SerializationConfig in project helidon by oracle.
the class DeserializationTest method configureDeserialization.
@BeforeAll
static void configureDeserialization() {
SerializationConfig sc = SerializationConfig.builder().onWrongConfig(SerializationConfig.Action.IGNORE).onNoConfig(SerializationConfig.Action.FAIL).ignoreFiles(false).traceSerialization(SerializationConfig.TraceOption.NONE).build();
assertThrows(IllegalStateException.class, sc::configure);
}
use of io.helidon.common.SerializationConfig in project helidon by oracle.
the class DeserializationTest method configureDeserialization.
@BeforeAll
static void configureDeserialization() {
// JDK Filter configured in pom.xml
SerializationConfig sc = SerializationConfig.builder().onWrongConfig(SerializationConfig.Action.FAIL).onNoConfig(SerializationConfig.Action.FAIL).ignoreFiles(false).traceSerialization(SerializationConfig.TraceOption.NONE).build();
// should not fail, as we have a blacklist for all other
sc.configure();
}
Aggregations