### Question:
ContentStore extends CassandraStore { public void updateContentProperties(String contentId, Map<String, Object> map) { TelemetryManager.log("UpdateContentProperties | Content: " + contentId + " | Properties: " + map); Session session = CassandraConnector.getSession(); if (null == map || map.isEmpty()) throw new ClientException(ContentStoreParams.ERR_INVALID_PROPERTY_VALUES.name(), "Invalid property values. Please specify valid property values"); String query = getUpdateQuery(map.keySet()); PreparedStatement ps = session.prepare(query); Object[] values = new Object[map.size() + 1]; try { int i = 0; for (Entry<String, Object> entry : map.entrySet()) { String value = ""; if (null == entry.getValue()) { value = ""; } else if (entry.getValue() instanceof String) { value = (String) entry.getValue(); } else { value = mapper.writeValueAsString(entry.getValue()); } values[i] = value; i += 1; } values[i] = contentId; BoundStatement bound = ps.bind(values); session.execute(bound); logTransactionEvent("UPDATE", contentId, map); } catch (Exception e) { TelemetryManager.error("Error! Executing update content property: " + e.getMessage(), e); throw new ServerException(ContentStoreParams.ERR_SERVER_ERROR.name(), "Error updating property in Content Store."); } } ContentStore(); void updateContentBody(String contentId, String body); void updateContentOldBody(String contentId, String body); String getContentBody(String contentId); String getContentProperty(String contentId, String property); Map<String, Object> getContentProperties(String contentId, List<String> properties); void updateContentProperty(String contentId, String property, String value); void updateContentProperties(String contentId, Map<String, Object> map);  }### Answer:
@Test public void testUpdateContentProps() { String identifier = "test_content"; String body = "test_content_body"; Map<String, Object> map = new HashMap<>(); map.put("body", body); contentStore.updateContentProperties(identifier, map); ResultSet resultSet = getSession().execute( "SELECT content_id, blobAsText(body) as body FROM " + keyspace + "." + table + " WHERE content_id='" + identifier + "';"); List<Row> rows = resultSet.all(); int count = rows.size(); Assert.assertTrue(count == 1); Row row = rows.get(0); Assert.assertTrue(identifier.equals(row.getString("content_id"))); Assert.assertTrue(body.equals(row.getString("body"))); }
@Test(expected = ClientException.class) public void testUpdateContentPropsEmptyPropertyNameToSave() { String identifier = "test_content"; String body = "test_content_body"; Map<String, Object> map = new HashMap<>(); map.put("", body); contentStore.updateContentProperties(identifier, map); }
@Test(expected = ClientException.class) public void testUpdateContentPropsEmptyPropsMapToSave() { contentStore.updateContentProperties("test_content", null); }