generated from pagopa/template-payments-java-repository
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
447b895
commit 6bbfda1
Showing
5 changed files
with
47 additions
and
5 deletions.
There are no files selected for viewing
17 changes: 17 additions & 0 deletions
17
src/main/java/it/gov/pagopa/pu/debtpositions/connector/config/ClientConfig.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package it.gov.pagopa.pu.debtpositions.connector.config; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Data; | ||
import lombok.NoArgsConstructor; | ||
import lombok.experimental.SuperBuilder; | ||
|
||
@Data | ||
@SuperBuilder | ||
@NoArgsConstructor | ||
@AllArgsConstructor | ||
public class ClientConfig { | ||
private String baseUrl; | ||
private int maxAttempts; | ||
private long waitTimeMillis; | ||
private boolean printBodyWhenError; | ||
} |
3 changes: 1 addition & 2 deletions
3
...ava/it/gov/pagopa/pu/debtpositions/performancelogger/ApiRequestPerformanceLoggerTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 1 addition & 2 deletions
3
...ava/it/gov/pagopa/pu/debtpositions/performancelogger/RestInvokePerformanceLoggerTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
src/test/java/it/gov/pagopa/pu/debtpositions/util/MemoryAppender.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package it.gov.pagopa.pu.debtpositions.util; | ||
|
||
import ch.qos.logback.classic.spi.ILoggingEvent; | ||
import ch.qos.logback.core.read.ListAppender; | ||
|
||
import java.util.Collections; | ||
import java.util.List; | ||
|
||
public class MemoryAppender extends ListAppender<ILoggingEvent> { | ||
public void reset() { | ||
this.list.clear(); | ||
} | ||
|
||
public boolean contains(ch.qos.logback.classic.Level level, String string) { | ||
return this.list.stream() | ||
.anyMatch(event -> event.toString().contains(string) | ||
&& event.getLevel().equals(level)); | ||
} | ||
|
||
public int getSize() { | ||
return this.list.size(); | ||
} | ||
|
||
public List<ILoggingEvent> getLoggedEvents() { | ||
return Collections.unmodifiableList(this.list); | ||
} | ||
} |