AuthServiceImpl.java

1
package org.cardanofoundation.explorer.api.service.impl;
2
3
import lombok.RequiredArgsConstructor;
4
5
import org.springframework.stereotype.Service;
6
7
import org.cardanofoundation.explorer.api.repository.explorer.TokenAuthRepository;
8
import org.cardanofoundation.explorer.api.service.AuthService;
9
import org.cardanofoundation.explorer.common.entity.enumeration.TokenAuthType;
10
import org.cardanofoundation.explorer.common.entity.explorer.TokenAuth;
11
12
@Service
13
@RequiredArgsConstructor
14
public class AuthServiceImpl implements AuthService {
15
16
  private final TokenAuthRepository tokenAuthRepository;
17
18
  @Override
19
  public Boolean isBlacklistToken(String token, TokenAuthType tokenAuthType) {
20
    try {
21 2 1. isBlacklistToken : replaced Boolean return with True for org/cardanofoundation/explorer/api/service/impl/AuthServiceImpl::isBlacklistToken → NO_COVERAGE
2. isBlacklistToken : replaced Boolean return with False for org/cardanofoundation/explorer/api/service/impl/AuthServiceImpl::isBlacklistToken → NO_COVERAGE
      return tokenAuthRepository
22
          .findByToken(token, tokenAuthType)
23
          .map(TokenAuth::getBlackList)
24
          .orElse(Boolean.FALSE);
25
    } catch (Exception e) {
26 1 1. isBlacklistToken : replaced Boolean return with True for org/cardanofoundation/explorer/api/service/impl/AuthServiceImpl::isBlacklistToken → NO_COVERAGE
      return Boolean.FALSE;
27
    }
28
  }
29
}

Mutations

21

1.1
Location : isBlacklistToken
Killed by : none
replaced Boolean return with True for org/cardanofoundation/explorer/api/service/impl/AuthServiceImpl::isBlacklistToken → NO_COVERAGE

2.2
Location : isBlacklistToken
Killed by : none
replaced Boolean return with False for org/cardanofoundation/explorer/api/service/impl/AuthServiceImpl::isBlacklistToken → NO_COVERAGE

26

1.1
Location : isBlacklistToken
Killed by : none
replaced Boolean return with True for org/cardanofoundation/explorer/api/service/impl/AuthServiceImpl::isBlacklistToken → NO_COVERAGE

Active mutators

Tests examined


Report generated by PIT 1.14.2