Skip to content

Commit

Permalink
Dummy bean for aggregatingAttributeRepository too
Browse files Browse the repository at this point in the history
  • Loading branch information
ilgrosso committed May 2, 2024
1 parent 481458c commit 0ca9a3f
Showing 1 changed file with 31 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@
import org.apereo.cas.authentication.principal.Service;
import org.apereo.cas.services.RegisteredService;
import org.apereo.services.persondir.IPersonAttributeDao;
import org.apereo.services.persondir.support.MergingPersonAttributeDaoImpl;
import org.apereo.services.persondir.IPersonAttributeDaoFilter;
import org.apereo.services.persondir.IPersonAttributes;
import org.apereo.services.persondir.support.merger.IAttributeMerger;
import org.junit.jupiter.api.BeforeEach;
import org.springframework.beans.factory.annotation.Autowired;
Expand Down Expand Up @@ -178,12 +179,36 @@ public IPersonAttributeDao aggregatingAttributeRepository(
@Qualifier("attributeRepositoryAttributeMerger")
final IAttributeMerger attributeRepositoryAttributeMerger) {

Check notice

Code scanning / CodeQL

Useless parameter Note test

The parameter 'attributeRepositoryAttributeMerger' is never used.

var aggregate = new MergingPersonAttributeDaoImpl();
aggregate.setMerger(attributeRepositoryAttributeMerger);
aggregate.setPersonAttributeDaos(List.of());
aggregate.setRecoverExceptions(true);
return new IPersonAttributeDao() {

Check warning

Code scanning / CodeQL

Inconsistent compareTo Warning test

This class declares
compareTo
but inherits equals; the two could be inconsistent.

return aggregate;
@Override
public IPersonAttributes getPerson(
final String string,
final Set<IPersonAttributes> set,
final IPersonAttributeDaoFilter ipadf) {

return null;
}

@Override
public Set<IPersonAttributes> getPeople(
final Map<String, Object> map,
final IPersonAttributeDaoFilter ipadf,
final Set<IPersonAttributes> set) {

return Set.of();
}

@Override
public Map<String, Object> getTags() {
return Map.of();
}

@Override
public int compareTo(final IPersonAttributeDao o) {
return 0;
}
};
}
}

Expand Down

0 comments on commit 0ca9a3f

Please sign in to comment.