-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updated test to assert on log when publish to error topic is failed
- Loading branch information
1 parent
1c4b52d
commit 94a7e3e
Showing
2 changed files
with
64 additions
and
22 deletions.
There are no files selected for viewing
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
30 changes: 30 additions & 0 deletions
30
pubsub-plus-connector/src/test/java/io/quarkiverse/solace/logging/SolaceTestAppender.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,30 @@ | ||
package io.quarkiverse.solace.logging; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
import org.apache.log4j.AppenderSkeleton; | ||
import org.apache.log4j.spi.LoggingEvent; | ||
|
||
public class SolaceTestAppender extends AppenderSkeleton { | ||
private List<LoggingEvent> log = new ArrayList<>(); | ||
|
||
@Override | ||
protected void append(LoggingEvent loggingEvent) { | ||
log.add(loggingEvent); | ||
} | ||
|
||
@Override | ||
public void close() { | ||
|
||
} | ||
|
||
@Override | ||
public boolean requiresLayout() { | ||
return false; | ||
} | ||
|
||
public List<LoggingEvent> getLog() { | ||
return new ArrayList<LoggingEvent>(log); | ||
} | ||
} |