+ assertTrue("updated", updated);
+ DatastoreContext configContext = configIntrospector.getContext();
+
+ assertEquals(44, configContext.getShardTransactionIdleTimeout().toMinutes());
+ assertFalse(configContext.isPersistent());
+ }
+
+ @Test
+ public void testGetDatastoreContextForShard() {
+ final Map<String, Object> properties = new HashMap<>();
+ properties.put("shard-transaction-idle-timeout-in-minutes", "22"); // global setting
+ properties.put("operational.shard-transaction-idle-timeout-in-minutes", "33"); // operational override
+ properties.put("config.shard-transaction-idle-timeout-in-minutes", "44"); // config override
+ properties.put("topology.shard-transaction-idle-timeout-in-minutes", "55"); // global shard override
+ properties.put("config.topology.persistent", "false"); // per-shard config override
+
+ final DatastoreContextIntrospector operIntrospector = INTROSPECTOR_FACTORY.newInstance(OPERATIONAL);
+
+ DatastoreContext shardContext = operIntrospector.newContextFactory().getShardDatastoreContext("topology");
+ assertEquals(10, shardContext.getShardTransactionIdleTimeout().toMinutes());
+
+ operIntrospector.update(properties);
+ DatastoreContext operContext = operIntrospector.getContext();
+ assertEquals(33, operContext.getShardTransactionIdleTimeout().toMinutes());