final String qualifier = Qualifiers.PROJECT;
ComponentDto mockComponent = mock(ComponentDto.class);
when(mockComponent.getId()).thenReturn(componentId);
when(mockComponent.key()).thenReturn(componentKey);
when(mockComponent.qualifier()).thenReturn(qualifier);
MockUserSession.set().setLogin("admin").addProjectPermissions(UserRole.ADMIN, componentKey);
when(componentDao.getByKey(session, componentKey)).thenReturn(mockComponent);
service.applyDefaultPermissionTemplate(componentKey);
verify(permissionFacade).grantDefaultRoles(session, componentId, qualifier);