Skip to content

Commit 997e733

Browse files
committed
build(test): Add unit tests, update some dependencies
1 parent 24f378b commit 997e733

File tree

12 files changed

+184
-31
lines changed

12 files changed

+184
-31
lines changed

async/async-commons/async-commons.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ dependencies {
1010
compileOnly 'io.projectreactor:reactor-core'
1111
api 'com.fasterxml.jackson.core:jackson-databind'
1212
api 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310'
13-
implementation 'commons-io:commons-io:2.16.1'
13+
implementation 'commons-io:commons-io:2.17.0'
1414
implementation 'io.cloudevents:cloudevents-json-jackson:4.0.1'
1515

1616
testImplementation 'io.projectreactor:reactor-test'
17-
}
17+
}

build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ buildscript {
1313
plugins {
1414
id 'jacoco'
1515
id 'org.sonarqube' version '5.1.0.4882'
16-
id 'org.springframework.boot' version '3.3.1' apply false
16+
id 'org.springframework.boot' version '3.3.4' apply false
1717
id 'io.github.gradle-nexus.publish-plugin' version '2.0.0'
18-
id 'co.com.bancolombia.cleanArchitecture' version '3.17.13'
18+
id 'co.com.bancolombia.cleanArchitecture' version '3.17.26'
1919
}
2020

2121
repositories {

gradle/wrapper/gradle-wrapper.jar

121 Bytes
Binary file not shown.

gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-bin.zip
44
networkTimeout=10000
55
validateDistributionUrl=true
66
zipStoreBase=GRADLE_USER_HOME

gradlew

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
# See the License for the specific language governing permissions and
1616
# limitations under the License.
1717
#
18+
# SPDX-License-Identifier: Apache-2.0
19+
#
1820

1921
##############################################################################
2022
#
@@ -55,7 +57,7 @@
5557
# Darwin, MinGW, and NonStop.
5658
#
5759
# (3) This script is generated from the Groovy template
58-
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
60+
# https://github.com/gradle/gradle/blob/HEAD/platforms/jvm/plugins-application/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
5961
# within the Gradle project.
6062
#
6163
# You can find Gradle at https://github.com/gradle/gradle/.
@@ -84,7 +86,8 @@ done
8486
# shellcheck disable=SC2034
8587
APP_BASE_NAME=${0##*/}
8688
# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
87-
APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
89+
APP_HOME=$( cd -P "${APP_HOME:-./}" > /dev/null && printf '%s
90+
' "$PWD" ) || exit
8891

8992
# Use the maximum available, or set MAX_FD != -1 to use that value.
9093
MAX_FD=maximum

gradlew.bat

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
@rem See the License for the specific language governing permissions and
1414
@rem limitations under the License.
1515
@rem
16+
@rem SPDX-License-Identifier: Apache-2.0
17+
@rem
1618

1719
@if "%DEBUG%"=="" @echo off
1820
@rem ##########################################################################
@@ -43,11 +45,11 @@ set JAVA_EXE=java.exe
4345
%JAVA_EXE% -version >NUL 2>&1
4446
if %ERRORLEVEL% equ 0 goto execute
4547

46-
echo.
47-
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
48-
echo.
49-
echo Please set the JAVA_HOME variable in your environment to match the
50-
echo location of your Java installation.
48+
echo. 1>&2
49+
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
50+
echo. 1>&2
51+
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
52+
echo location of your Java installation. 1>&2
5153

5254
goto fail
5355

@@ -57,11 +59,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe
5759

5860
if exist "%JAVA_EXE%" goto execute
5961

60-
echo.
61-
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
62-
echo.
63-
echo Please set the JAVA_HOME variable in your environment to match the
64-
echo location of your Java installation.
62+
echo. 1>&2
63+
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
64+
echo. 1>&2
65+
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
66+
echo location of your Java installation. 1>&2
6567

6668
goto fail
6769

main.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ subprojects {
8080

8181
dependencyManagement {
8282
imports {
83-
mavenBom 'org.springframework.boot:spring-boot-dependencies:3.3.1'
83+
mavenBom 'org.springframework.boot:spring-boot-dependencies:3.3.4'
8484
}
8585
}
8686

@@ -176,5 +176,5 @@ tasks.register('generateMergedReport', JacocoReport) {
176176
}
177177

178178
tasks.named('wrapper') {
179-
gradleVersion = '8.8'
179+
gradleVersion = '8.10.2'
180180
}

starters/async-commons-starter/src/main/java/org/reactivecommons/async/starter/broker/Status.java

Lines changed: 0 additions & 12 deletions
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
package org.reactivecommons.async.starter.listeners;
2+
3+
import org.junit.jupiter.api.BeforeEach;
4+
import org.junit.jupiter.api.Test;
5+
import org.junit.jupiter.api.extension.ExtendWith;
6+
import org.mockito.Mock;
7+
import org.mockito.junit.jupiter.MockitoExtension;
8+
import org.reactivecommons.async.commons.HandlerResolver;
9+
import org.reactivecommons.async.starter.broker.BrokerProvider;
10+
import org.reactivecommons.async.starter.config.ConnectionManager;
11+
import org.reactivecommons.async.starter.config.DomainHandlers;
12+
13+
import static org.mockito.Mockito.verify;
14+
import static org.reactivecommons.async.api.HandlerRegistry.DEFAULT_DOMAIN;
15+
16+
@ExtendWith(MockitoExtension.class)
17+
class CommandsListenerConfigTest {
18+
@Mock
19+
private BrokerProvider<?> provider;
20+
@Mock
21+
private HandlerResolver resolver;
22+
23+
@BeforeEach
24+
void setUp() {
25+
ConnectionManager manager = new ConnectionManager();
26+
manager.addDomain(DEFAULT_DOMAIN, provider);
27+
DomainHandlers handlers = new DomainHandlers();
28+
handlers.add(DEFAULT_DOMAIN, resolver);
29+
new CommandsListenerConfig(manager, handlers);
30+
}
31+
32+
@Test
33+
void shouldListen() {
34+
// Arrange
35+
// Act
36+
// Assert
37+
verify(provider).listenCommands(resolver);
38+
}
39+
40+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
package org.reactivecommons.async.starter.listeners;
2+
3+
import org.junit.jupiter.api.BeforeEach;
4+
import org.junit.jupiter.api.Test;
5+
import org.junit.jupiter.api.extension.ExtendWith;
6+
import org.mockito.Mock;
7+
import org.mockito.junit.jupiter.MockitoExtension;
8+
import org.reactivecommons.async.commons.HandlerResolver;
9+
import org.reactivecommons.async.starter.broker.BrokerProvider;
10+
import org.reactivecommons.async.starter.config.ConnectionManager;
11+
import org.reactivecommons.async.starter.config.DomainHandlers;
12+
13+
import static org.mockito.Mockito.verify;
14+
import static org.reactivecommons.async.api.HandlerRegistry.DEFAULT_DOMAIN;
15+
16+
@ExtendWith(MockitoExtension.class)
17+
class EventsListenerConfigTest {
18+
@Mock
19+
private BrokerProvider<?> provider;
20+
@Mock
21+
private HandlerResolver resolver;
22+
23+
@BeforeEach
24+
void setUp() {
25+
ConnectionManager manager = new ConnectionManager();
26+
manager.addDomain(DEFAULT_DOMAIN, provider);
27+
DomainHandlers handlers = new DomainHandlers();
28+
handlers.add(DEFAULT_DOMAIN, resolver);
29+
new EventsListenerConfig(manager, handlers);
30+
}
31+
32+
@Test
33+
void shouldListen() {
34+
// Arrange
35+
// Act
36+
// Assert
37+
verify(provider).listenDomainEvents(resolver);
38+
}
39+
40+
}

0 commit comments

Comments
 (0)