+ @Test
+ fun `resource resolution issue of resourceStore HashMap during resource resolution`() {
+ var uncaughtExceptionOccured = AtomicBoolean(false)
+ for (i in 1..1000) {
+ thread {
+ resourceAssignmentRuntimeService.putResolutionStore("key_$i", "value_$i".asJsonType())
+ }
+ val t = thread(false) {
+ resourceAssignmentRuntimeService.getResolutionStore()
+ // often ConcurrentModificationException occurs here
+ }
+ t.uncaughtExceptionHandler =
+ Thread.UncaughtExceptionHandler { t, e -> uncaughtExceptionOccured = AtomicBoolean(true) }
+ t.start()
+ }
+ assertEquals(uncaughtExceptionOccured.get(), false)
+ }
+