use of com.hazelcast.config.JavaSerializationFilterConfig in project hazelcast by hazelcast.
the class SerializationClassNameFilterTest method testClassInWhitelist.
/**
* <pre>
* Given: Default is disabled and explicit whitelist is used.
* When: {@link SerializationClassNameFilter#filter(String)} is called for a whitelisted class.
* Then: no exception is thrown
* </pre>
*/
@Test
public void testClassInWhitelist() {
JavaSerializationFilterConfig config = new JavaSerializationFilterConfig().setDefaultsDisabled(true);
config.getWhitelist().addClasses("java.lang.Test1", "java.lang.Test2", "java.lang.Test3");
new SerializationClassNameFilter(config).filter("java.lang.Test2");
}
Aggregations