diff options
author | Thomas <> | 2024-02-01 07:39:57 +0100 |
---|---|---|
committer | Thomas <> | 2024-02-01 07:39:57 +0100 |
commit | 7bb4a6638ab04a19172dc303d1d6b387fa064aa0 (patch) | |
tree | dfd2691a641ffabca497e96ae08ac7f0464568f0 /eaaf_core/src/test/java | |
parent | 362a880eeaee7eaf8e190ac0a97a3d585a071f13 (diff) | |
download | EAAF-Components-7bb4a6638ab04a19172dc303d1d6b387fa064aa0.tar.gz EAAF-Components-7bb4a6638ab04a19172dc303d1d6b387fa064aa0.tar.bz2 EAAF-Components-7bb4a6638ab04a19172dc303d1d6b387fa064aa0.zip |
feat(errorhandling): update configuration-model to exclude stake-trace logging
# Conflicts:
# eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/auth/service/TicketErrorServiceTest.java
Diffstat (limited to 'eaaf_core/src/test/java')
2 files changed, 25 insertions, 0 deletions
diff --git a/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/auth/dummy/DummyDefaultErrorService.java b/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/auth/dummy/DummyDefaultErrorService.java index ad7e9bdc..a331d382 100644 --- a/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/auth/dummy/DummyDefaultErrorService.java +++ b/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/auth/dummy/DummyDefaultErrorService.java @@ -107,6 +107,10 @@ public class DummyDefaultErrorService implements IErrorService { @Getter private LogLevel logLevel; + + @Getter + @Builder.Default + private boolean writeThrowable = true; @Getter private Map<String, String> additionalGuiModelElements; diff --git a/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/auth/service/TicketErrorServiceTest.java b/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/auth/service/TicketErrorServiceTest.java index d30f5a95..3391e109 100644 --- a/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/auth/service/TicketErrorServiceTest.java +++ b/eaaf_core/src/test/java/at/gv/egiz/eaaf/core/impl/idp/auth/service/TicketErrorServiceTest.java @@ -34,6 +34,7 @@ import at.gv.egiz.eaaf.core.impl.idp.auth.dummy.DummyPendingRequest; import at.gv.egiz.eaaf.core.impl.idp.auth.services.IErrorService; import at.gv.egiz.eaaf.core.impl.idp.auth.services.IErrorService.LogLevel; import ch.qos.logback.classic.spi.ILoggingEvent; +import lombok.SneakyThrows; import lombok.val; @RunWith(SpringJUnit4ClassRunner.class) @@ -68,6 +69,26 @@ public class TicketErrorServiceTest { } @Test + @SneakyThrows + public void checkWriteThrowableFlag() { + + DummyPendingRequest pendingReq = new DummyPendingRequest(); + pendingReq.setPendingRequestId("324"); + pendingReq.setSpEntityId(RandomStringUtils.randomAlphabetic(5)); + + Assert.assertTrue(ticketErrorService.createHandleData(new EaafException("module.binding.14"), pendingReq) + .isWriteThrowable()); + + Assert.assertTrue(ticketErrorService.createHandleData(new EaafException("internal.pendingreqid.06"), + pendingReq) + .isWriteThrowable()); + + Assert.assertFalse(ticketErrorService.createHandleData(new EaafException("module.binding.33"), pendingReq) + .isWriteThrowable()); + + } + + @Test public void coverDifferentExceptions() throws EaafException { DummyPendingRequest pendingReq = new DummyPendingRequest(); |