Found the bug: boolean logic in linkResource. Test failure message did not help with diagnosing the problem. Good thing we're introducing unit tests!
Passed topic-service unit tests