Skip to content

Commit

Permalink
refactor(test): use logback in test
Browse files Browse the repository at this point in the history
  • Loading branch information
zero88 committed Oct 27, 2023
1 parent 654db25 commit 0ddfe89
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 8 deletions.
1 change: 1 addition & 0 deletions core/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ dependencies {
codeGenerator(VertxLibs.rx3)
codeGenerator(MutinyLibs.core)

testImplementation(LogLibs.logback)
testImplementation(TestLibs.junit5Params)
testImplementation(JacksonLibs.databind)
testImplementation(JacksonLibs.jsr310)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.junit.jupiter.api.extension.RegisterExtension;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.MethodSource;

Expand All @@ -21,12 +22,16 @@
import io.github.zero88.schedulerx.trigger.TriggerCondition.ReasonCode;
import io.vertx.core.Vertx;
import io.vertx.junit5.Checkpoint;
import io.vertx.junit5.RunTestOnContext;
import io.vertx.junit5.VertxExtension;
import io.vertx.junit5.VertxTestContext;

@ExtendWith(VertxExtension.class)
class IntervalSchedulerTest {

@RegisterExtension
static RunTestOnContext rtoc = new RunTestOnContext();

private static Stream<Object> provide_invalid_interval() {
return Stream.of(arguments(IntervalTrigger.builder().interval(-1).build(), "Invalid interval value"),
arguments(IntervalTrigger.builder().repeat(0).interval(3).build(), "Invalid repeat value"),
Expand Down
12 changes: 12 additions & 0 deletions core/src/test/resources/logback.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<configuration>
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%d{"yyyy-MM-dd'T'HH:mm:ss.SSSXXX", UTC} [%-24.24thread] %-5level %-24.24logger{24} - %msg%n</pattern>
</encoder>
</appender>

<root level="info">
<appender-ref ref="STDOUT" />
</root>
<logger name="io.github.zero88" level="trace" />
</configuration>

This file was deleted.

0 comments on commit 0ddfe89

Please sign in to comment.