Project

General

Profile

Revision f19b11bb

IDf19b11bbf6cce94e33d4bab266057ab870064257
Parent 7fbec49e
Child c8e2d1bc

Added by Andreas Müller about 2 months ago

ref #6714 fix UserAndGroupServiceImplTest after updating 001-cdm.h2.sql

View differences:

cdmlib-services/src/test/java/eu/etaxonomy/cdm/api/service/UserAndGroupServiceImplTest.java
173 173
        context.setAuthentication(authentication);
174 174

  
175 175
        List<GrantedAuthority> authorityList = new ArrayList<>();
176
        GrantedAuthorityImpl rolePublishAthotrity = GrantedAuthorityImpl.NewInstance(null);
177
        rolePublishAthotrity.setAuthority(Role.ROLE_PUBLISH.toString()); // testing if creating a Role from string is working
178
        authorityList.add(rolePublishAthotrity);
176
        GrantedAuthorityImpl roleRemotingAuthority = GrantedAuthorityImpl.NewInstance(null);
177
        roleRemotingAuthority.setAuthority(Role.ROLE_REMOTING.toString()); // testing if creating a Role from string is working
178
        authorityList.add(roleRemotingAuthority);
179 179

  
180
        String publishersGroupName = "publishers";
180
        String remotingGroupName = "publishers";
181 181

  
182
        groupService.createGroup(publishersGroupName, authorityList);
182
        groupService.createGroup(remotingGroupName, authorityList);
183 183

  
184 184
        commitAndStartNewTransaction(null);
185 185

  
186
        List<GrantedAuthority> groupAuthorities = groupService.findGroupAuthorities(publishersGroupName);
186
        List<GrantedAuthority> groupAuthorities = groupService.findGroupAuthorities(remotingGroupName);
187 187

  
188
        Assert.assertEquals(Role.ROLE_PUBLISH.toString(), groupAuthorities.get(0).getAuthority());
188
        Assert.assertEquals(Role.ROLE_REMOTING.toString(), groupAuthorities.get(0).getAuthority());
189 189
    }
190 190

  
191 191
    @Test
......
220 220
        context.setAuthentication(authentication);
221 221

  
222 222
        // create an entity of ROLE_PUBLISH and save it to the database
223
        grantedAuthorityService.save(Role.ROLE_PUBLISH.asNewGrantedAuthority());
224 223
        commitAndStartNewTransaction(null);
225 224
        GrantedAuthorityImpl rolePublish = grantedAuthorityService.load(Role.ROLE_PUBLISH.getUuid());
226 225

  
cdmlib-services/src/test/resources/eu/etaxonomy/cdm/api/service/SecurityTest.xml
33 33
  <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 !!! -->
34 34
  <GRANTEDAUTHORITYIMPL ID="15" UUID="ce489645-9505-4635-9fe4-7550704ded76" CREATED="2009-02-03 17:52:26.0" AUTHORITY="DESCRIPTIONELEMENTBASE.[CREATE,DELETE,READ,UPDATE]"/>
35 35
  <GRANTEDAUTHORITYIMPL ID="16" UUID="249abf18-a749-4ea4-a270-da28ce66a4c8" CREATED="2009-02-03 17:52:26.0" AUTHORITY="DESCRIPTIONBASE.[CREATE,DELETE,READ,UPDATE]"/>
36
  <GRANTEDAUTHORITYIMPL ID="17"  UUID="67d525d6-34e4-4e1a-a00c-6ae6b716ed2c" CREATED="2014-01-31 17:52:26.0" AUTHORITY="ROLE_PUBLISH"/>
37
  <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 -->
36
  <GRANTEDAUTHORITYIMPL ID="17"  UUID="9ffa7879-cc67-4592-a14a-b251cccde1a7" CREATED="2014-01-31 17:52:26.0" AUTHORITY="ROLE_PUBLISH"/>
37
  <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 -->
38 38
  <GRANTEDAUTHORITYIMPL ID="19"  UUID="566b1325-be50-4b0a-9aa2-3ecd610215f2" CREATED="2014-02-15 17:52:26.0" AUTHORITY="REFERENCE.[CREATE,READ]"/>
39 39

  
40 40
  <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"/>

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)