/** * Returns a list of properties. * * @return List of properties */ public List<Property> toList() { return properties.entrySet().stream() .map(e -> Property.create(e.getKey(), e.getValue())) .collect(Collectors.toList()); }
@Test public void testPropertySerialization() throws Exception { Property pIn = Property.create("key1", 10L); assertEquals("Properties were not equal", pIn, GradoopFlinkTestUtils.writeAndRead(pIn, getExecutionEnvironment())); }
@Test public void testSet() throws Exception { Properties properties = Properties.create(); properties.set(Property.create(KEY_1, BOOL_VAL_1)); assertEquals(BOOL_VAL_1, properties.get(KEY_1).getObject()); // override properties.set(Property.create(KEY_1, INT_VAL_2)); assertEquals(INT_VAL_2, properties.get(KEY_1).getObject()); }
@Test public void testRemove2() throws Exception { Properties properties = Properties.create(); PropertyValue removed; properties.set(KEY_1, BOOL_VAL_1); removed = properties.remove(Property.create(KEY_1, BOOL_VAL_1)); assertEquals(0, properties.size()); assertNotNull(removed); properties.set(KEY_1, BOOL_VAL_1); removed = properties.remove(Property.create(KEY_2, BOOL_VAL_1)); assertEquals(1, properties.size()); assertNull(removed); }