ref #6714 fix UserAndGroupServiceImplTest after updating 001-cdm.h2.sql
authorAndreas Müller <a.mueller@bgbm.org>
Mon, 24 Aug 2020 17:51:22 +0000 (19:51 +0200)
committerAndreas Müller <a.mueller@bgbm.org>
Mon, 24 Aug 2020 17:51:22 +0000 (19:51 +0200)
cdmlib-services/src/test/java/eu/etaxonomy/cdm/api/service/UserAndGroupServiceImplTest.java
cdmlib-services/src/test/resources/eu/etaxonomy/cdm/api/service/SecurityTest.xml

index 3f8a7376867c6d13c2b9d0d1bf95cb6035512b67..093f997900d301d751117a2e6d27f4994e0a7d91 100644 (file)
@@ -173,19 +173,19 @@ public class UserAndGroupServiceImplTest extends AbstractSecurityTestBase {
         context.setAuthentication(authentication);\r
 \r
         List<GrantedAuthority> authorityList = new ArrayList<>();\r
-        GrantedAuthorityImpl rolePublishAthotrity = GrantedAuthorityImpl.NewInstance(null);\r
-        rolePublishAthotrity.setAuthority(Role.ROLE_PUBLISH.toString()); // testing if creating a Role from string is working\r
-        authorityList.add(rolePublishAthotrity);\r
+        GrantedAuthorityImpl roleRemotingAuthority = GrantedAuthorityImpl.NewInstance(null);\r
+        roleRemotingAuthority.setAuthority(Role.ROLE_REMOTING.toString()); // testing if creating a Role from string is working\r
+        authorityList.add(roleRemotingAuthority);\r
 \r
-        String publishersGroupName = "publishers";\r
+        String remotingGroupName = "publishers";\r
 \r
-        groupService.createGroup(publishersGroupName, authorityList);\r
+        groupService.createGroup(remotingGroupName, authorityList);\r
 \r
         commitAndStartNewTransaction(null);\r
 \r
-        List<GrantedAuthority> groupAuthorities = groupService.findGroupAuthorities(publishersGroupName);\r
+        List<GrantedAuthority> groupAuthorities = groupService.findGroupAuthorities(remotingGroupName);\r
 \r
-        Assert.assertEquals(Role.ROLE_PUBLISH.toString(), groupAuthorities.get(0).getAuthority());\r
+        Assert.assertEquals(Role.ROLE_REMOTING.toString(), groupAuthorities.get(0).getAuthority());\r
     }\r
 \r
     @Test\r
@@ -220,7 +220,6 @@ public class UserAndGroupServiceImplTest extends AbstractSecurityTestBase {
         context.setAuthentication(authentication);\r
 \r
         // create an entity of ROLE_PUBLISH and save it to the database\r
-        grantedAuthorityService.save(Role.ROLE_PUBLISH.asNewGrantedAuthority());\r
         commitAndStartNewTransaction(null);\r
         GrantedAuthorityImpl rolePublish = grantedAuthorityService.load(Role.ROLE_PUBLISH.getUuid());\r
 \r
index 8d89ef9e7098abbbcab8510acbbbb2579ccfae9d..ac6ab4c99fba43d47e53a3d12ab26863f3bb2f7e 100644 (file)
@@ -33,8 +33,8 @@
   <GRANTEDAUTHORITYIMPL ID="14" UUID="56eac992-67ba-40be-896c-4e992ca2afc0" CREATED="2009-02-03 17:52:26.0" AUTHORITY="ROLE_ADMIN"/><!-- role prefix 'ROLE_' defined in RoleVoter !!! -->
   <GRANTEDAUTHORITYIMPL ID="15" UUID="ce489645-9505-4635-9fe4-7550704ded76" CREATED="2009-02-03 17:52:26.0" AUTHORITY="DESCRIPTIONELEMENTBASE.[CREATE,DELETE,READ,UPDATE]"/>
   <GRANTEDAUTHORITYIMPL ID="16" UUID="249abf18-a749-4ea4-a270-da28ce66a4c8" CREATED="2009-02-03 17:52:26.0" AUTHORITY="DESCRIPTIONBASE.[CREATE,DELETE,READ,UPDATE]"/>
-  <GRANTEDAUTHORITYIMPL ID="17"  UUID="67d525d6-34e4-4e1a-a00c-6ae6b716ed2c" CREATED="2014-01-31 17:52:26.0" AUTHORITY="ROLE_PUBLISH"/>
-  <GRANTEDAUTHORITYIMPL ID="18"  UUID="56eac992-67ba-40be-896c-4e992ca2afc0" CREATED="2014-02-15 17:52:26.0" AUTHORITY="TAXONNAME.[CREATE,READ,UPDATE]"/><!-- same as in default perm. group editor -->
+  <GRANTEDAUTHORITYIMPL ID="17"  UUID="9ffa7879-cc67-4592-a14a-b251cccde1a7" CREATED="2014-01-31 17:52:26.0" AUTHORITY="ROLE_PUBLISH"/>
+  <GRANTEDAUTHORITYIMPL ID="18"  UUID="48309203-81c0-4263-a9d7-0f7f5d79ea12" CREATED="2014-02-15 17:52:26.0" AUTHORITY="TAXONNAME.[CREATE,READ,UPDATE]"/><!-- same as in default perm. group editor -->
   <GRANTEDAUTHORITYIMPL ID="19"  UUID="566b1325-be50-4b0a-9aa2-3ecd610215f2" CREATED="2014-02-15 17:52:26.0" AUTHORITY="REFERENCE.[CREATE,READ]"/>
 
   <USERACCOUNT USERNAME="admin" ID="1" CREATED="2009-06-18 13:47:59.0" UUID="e4acf200-63b6-11dd-ad8b-0800200c9a66" PASSWORD="656a8bc965ac42adc800013e1a8612b9" ENABLED="true" ACCOUNTNONEXPIRED="true" CREDENTIALSNONEXPIRED="true" ACCOUNTNONLOCKED="true"/>