--- /dev/null
+package org.simantics.db.tests.api.readGraph.getInverse;
+
+import org.junit.Test;
+import org.simantics.db.Resource;
+import org.simantics.db.common.primitiverequest.Inverse;
+import org.simantics.db.exception.NoInverseException;
+import org.simantics.db.testing.base.ExistingDatabaseTest;
+import org.simantics.db.tests.common.Writes;
+
+/*
+ * When a resource does not specify L0.InverseOf, getInverse shall throw NoInverseException.
+ */
+public class GetInverseTest1 extends ExistingDatabaseTest {
+
+ @Test
+ public void test() throws Exception{
+
+ Resource resource = getSession().syncRequest(Writes.newEmpty());
+
+ try {
+ assertNotNull("Null not allowed",getSession().syncRequest(new Inverse(resource)));
+ } catch (NoInverseException e) {
+ return;
+ }
+ fail("Should throw.");
+ }
+
+}