Index: trunk/test/unit/org/openstreetmap/josm/gui/dialogs/relation/GenericRelationEditorTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/dialogs/relation/GenericRelationEditorTest.java	(revision 14380)
+++ trunk/test/unit/org/openstreetmap/josm/gui/dialogs/relation/GenericRelationEditorTest.java	(revision 14385)
@@ -2,4 +2,5 @@
 package org.openstreetmap.josm.gui.dialogs.relation;
 
+import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotNull;
 import static org.junit.Assert.assertNull;
@@ -7,4 +8,5 @@
 import java.util.Collections;
 
+import javax.swing.JOptionPane;
 import javax.swing.JPanel;
 
@@ -21,4 +23,5 @@
 import org.openstreetmap.josm.gui.tagging.ac.AutoCompletingTextField;
 import org.openstreetmap.josm.testutils.JOSMTestRules;
+import org.openstreetmap.josm.testutils.mockers.JOptionPaneSimpleMocker;
 
 import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
@@ -83,11 +86,28 @@
     @Test
     public void testAddPrimitivesToRelation() {
+        TestUtils.assumeWorkingJMockit();
+        final JOptionPaneSimpleMocker jopsMocker = new JOptionPaneSimpleMocker();
+
         Relation r = TestUtils.addFakeDataSet(new Relation(1));
         assertNull(GenericRelationEditor.addPrimitivesToRelation(r, Collections.<OsmPrimitive>emptyList()));
+
+        jopsMocker.getMockResultMap().put(
+            "<html>You are trying to add a relation to itself.<br><br>This creates circular references "
+            + "and is therefore discouraged.<br>Skipping relation 'incomplete'.</html>",
+            JOptionPane.OK_OPTION
+        );
+
         assertNull(GenericRelationEditor.addPrimitivesToRelation(r, Collections.singleton(new Relation(1))));
+
+        assertEquals(1, jopsMocker.getInvocationLog().size());
+        Object[] invocationLogEntry = jopsMocker.getInvocationLog().get(0);
+        assertEquals(JOptionPane.OK_OPTION, (int) invocationLogEntry[0]);
+        assertEquals("Warning", invocationLogEntry[2]);
 
         assertNotNull(GenericRelationEditor.addPrimitivesToRelation(r, Collections.singleton(new Node(1))));
         assertNotNull(GenericRelationEditor.addPrimitivesToRelation(r, Collections.singleton(new Way(1))));
         assertNotNull(GenericRelationEditor.addPrimitivesToRelation(r, Collections.singleton(new Relation(2))));
+
+        assertEquals(1, jopsMocker.getInvocationLog().size());
     }
 
Index: trunk/test/unit/org/openstreetmap/josm/gui/dialogs/relation/actions/RelationEditorActionsTest.java
===================================================================
--- trunk/test/unit/org/openstreetmap/josm/gui/dialogs/relation/actions/RelationEditorActionsTest.java	(revision 14380)
+++ trunk/test/unit/org/openstreetmap/josm/gui/dialogs/relation/actions/RelationEditorActionsTest.java	(revision 14385)
@@ -11,6 +11,7 @@
 import javax.swing.text.JTextComponent;
 
+import org.openstreetmap.josm.TestUtils;
+import org.openstreetmap.josm.gui.ConditionalOptionPaneUtil;
 import org.openstreetmap.josm.testutils.mockers.JOptionPaneSimpleMocker;
-import org.openstreetmap.josm.gui.ConditionalOptionPaneUtil;
 
 import com.google.common.collect.ImmutableMap;
@@ -71,4 +72,5 @@
     @Test
     public void testDeleteCurrentRelationAction() {
+        TestUtils.assumeWorkingJMockit();
         final JOptionPaneSimpleMocker jopsMocker = new JOptionPaneSimpleMocker(
             ImmutableMap.<String, Object>of(
@@ -107,4 +109,5 @@
     @Test
     public void testSetRoleAction() {
+        TestUtils.assumeWorkingJMockit();
         final JOptionPaneSimpleMocker.MessagePanelMocker mpMocker = new JOptionPaneSimpleMocker.MessagePanelMocker();
         // JOptionPaneSimpleMocker doesn't handle showOptionDialog calls because of their potential
