diff --git a/bramble-core/src/test/java/org/briarproject/bramble/plugin/ConnectionRegistryImplTest.java b/bramble-core/src/test/java/org/briarproject/bramble/plugin/ConnectionRegistryImplTest.java
index f0841bc8e7d2e225c30678f52b7ced4f41816b58..d0cbb7732ac0ded2427fc874757ce366c9cd7a88 100644
--- a/bramble-core/src/test/java/org/briarproject/bramble/plugin/ConnectionRegistryImplTest.java
+++ b/bramble-core/src/test/java/org/briarproject/bramble/plugin/ConnectionRegistryImplTest.java
@@ -15,6 +15,7 @@ import org.junit.Test;
 
 import java.util.Collection;
 import java.util.Collections;
+import java.util.NoSuchElementException;
 
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertTrue;
@@ -86,7 +87,7 @@ public class ConnectionRegistryImplTest extends BrambleTestCase {
 		try {
 			c.unregisterConnection(contactId, transportId, true);
 			fail();
-		} catch (IllegalArgumentException expected) {
+		} catch (NoSuchElementException expected) {
 			// Expected
 		}
 		// Register both contacts with one transport, one contact with both -