From f80c430ca06e531dcc6f81bf26ceecda9819e78f Mon Sep 17 00:00:00 2001 From: Kory Draughn Date: Tue, 14 May 2024 16:52:47 -0400 Subject: [PATCH] [#448] Adjust tests for iRODS 4.3.2. --- .../irods/jargon/core/pub/UserGroupAOImplTest.java | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/jargon-core/src/test/java/org/irods/jargon/core/pub/UserGroupAOImplTest.java b/jargon-core/src/test/java/org/irods/jargon/core/pub/UserGroupAOImplTest.java index fa98e0e52..4a5b621e3 100644 --- a/jargon-core/src/test/java/org/irods/jargon/core/pub/UserGroupAOImplTest.java +++ b/jargon-core/src/test/java/org/irods/jargon/core/pub/UserGroupAOImplTest.java @@ -11,6 +11,7 @@ import org.irods.jargon.core.exception.DuplicateDataException; import org.irods.jargon.core.exception.InvalidGroupException; import org.irods.jargon.core.exception.InvalidUserException; +import org.irods.jargon.core.exception.JargonException; import org.irods.jargon.core.protovalues.UserTypeEnum; import org.irods.jargon.core.pub.domain.User; import org.irods.jargon.core.pub.domain.UserGroup; @@ -765,8 +766,16 @@ public final void testRemoveUserFromGroupUserNotInGroup() throws Exception { userGroupAO.removeUserGroup(userGroup); userGroupAO.addUserGroup(userGroup); - userGroupAO.removeUserFromGroup(testUserGroup, - testingProperties.getProperty(TestingPropertiesHelper.IRODS_SECONDARY_USER_KEY), null); + if (accessObjectFactory.getIRODSServerProperties(irodsAccount).isAtLeastIrods432()) { + JargonException thrown = Assert.assertThrows(JargonException.class, + () -> userGroupAO.removeUserFromGroup(testUserGroup, + testingProperties.getProperty(TestingPropertiesHelper.IRODS_SECONDARY_USER_KEY), null)); + Assert.assertEquals(thrown.getUnderlyingIRODSExceptionCode(), -1830000); // USER_NOT_IN_GROUP + } + else { + userGroupAO.removeUserFromGroup(testUserGroup, + testingProperties.getProperty(TestingPropertiesHelper.IRODS_SECONDARY_USER_KEY), null); + } } /**