Skip to content

Commit

Permalink
SHIBUI-2380
Browse files Browse the repository at this point in the history
Changes per code review
  • Loading branch information
chasegawa committed Oct 26, 2022
1 parent a9c2e3c commit 2e8f4e6
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import edu.internet2.tier.shibboleth.admin.ui.domain.EntityDescriptor;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

Expand All @@ -17,7 +16,7 @@ public interface EntityDescriptorRepository extends JpaRepository<EntityDescript
@Query(value = "select new edu.internet2.tier.shibboleth.admin.ui.repository.EntityDescriptorProjection(e.entityID, e.resourceId, e.serviceProviderName, e.createdBy, " +
"e.createdDate, e.serviceEnabled, e.idOfOwner, e.protocol) " +
"from EntityDescriptor e")
List<EntityDescriptorProjection> findAllBy();
List<EntityDescriptorProjection> findAllReturnProjections();

@Query(value = "select new edu.internet2.tier.shibboleth.admin.ui.repository.EntityDescriptorProjection(e.entityID, e.resourceId, e.serviceProviderName, e.createdBy, " +
"e.createdDate, e.serviceEnabled, e.idOfOwner, e.protocol) " +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -439,7 +439,7 @@ public Iterable<EntityDescriptorRepresentation> getAllDisabledAndNotOwnedByAdmin
public List<EntityDescriptorProjection> getAllEntityDescriptorProjectionsBasedOnUserAccess() throws ForbiddenException {
switch (userService.getCurrentUserAccess()) {
case ADMIN:
List<EntityDescriptorProjection> o = entityDescriptorRepository.findAllBy();
List<EntityDescriptorProjection> o = entityDescriptorRepository.findAllReturnProjections();
return o;
case GROUP:
User user = userService.getCurrentUser();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class EntityDescriptorRepositoryTest extends AbstractBaseDataJpaTest {
noExceptionThrown()

when:
List<EntityDescriptorProjection> projections = entityDescriptorRepository.findAllBy()
List<EntityDescriptorProjection> projections = entityDescriptorRepository.findAllReturnProjections()

then:
projections.size() == 1
Expand Down

0 comments on commit 2e8f4e6

Please sign in to comment.