Skip to content
Snippets Groups Projects

Feature/GAIAXAUTH-26

Merged Cristina Pauna requested to merge feature/GAIAXAUTH-26-part-3 into main
All threads resolved!
4 files
+ 34
11
Compare changes
  • Side-by-side
  • Inline
Files
4
@@ -8,13 +8,16 @@ import java.util.UUID;
import org.springframework.beans.factory.annotation.Autowired;
import static eu.gaiax.difs.aas.generated.model.AccessRequestStatusDto.ACCEPTED;
import static eu.gaiax.difs.aas.generated.model.AccessRequestStatusDto.*;
public class LocalTrustServiceClientImpl implements TrustServiceClient {
@Autowired
private LocalTrustServiceClientProperties config;
// TODO: replace with <requestId, count> map for multi-threaded tests
private int sendAcceptedStatusCountdown = 1;
@Override
public Map<String, Object> evaluate(String policyName, Map<String, Object> bodyParams) {
Map<String, Object> map = new HashMap<>(Map.copyOf(config.getPolicyMocks().get(policyName)));
@@ -31,7 +34,12 @@ public class LocalTrustServiceClientImpl implements TrustServiceClient {
}
if ("GetLoginProofResult".equals(policyName) || "GetIatProofResult".equals(policyName)) {
map.put("status", ACCEPTED);
if (sendAcceptedStatusCountdown-- > 0) {
map.put("status", PENDING);
} else {
map.put("status", ACCEPTED);
sendAcceptedStatusCountdown = 1;
}
}
return map;
Loading