Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit43e7ca5

Browse files
refactor:iluwatar#1012 - Resolve Sonar report: missing assertions in several AppTest classes (iluwatar#1784)
Co-authored-by: Subhrodip Mohanta <hello@subho.xyz>
1 parentf6d4397 commit43e7ca5

File tree

7 files changed

+34
-21
lines changed

7 files changed

+34
-21
lines changed

‎filterer/src/test/java/com/iluwatar/filterer/AppTest.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,14 @@
2323

2424
packagecom.iluwatar.filterer;
2525

26+
importstaticorg.junit.jupiter.api.Assertions.assertDoesNotThrow;
27+
2628
importorg.junit.jupiter.api.Test;
2729

2830
classAppTest {
31+
2932
@Test
3033
voidshouldLaunchApp() {
31-
App.main(newString[]{});
34+
assertDoesNotThrow(() ->App.main(newString[]{}));
3235
}
3336
}

‎monad/src/test/java/com/iluwatar/monad/AppTest.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,19 @@
2323

2424
packagecom.iluwatar.monad;
2525

26+
importstaticorg.junit.jupiter.api.Assertions.assertDoesNotThrow;
27+
2628
importorg.junit.jupiter.api.Test;
2729

2830
/**
2931
* Application Test
3032
*/
31-
publicclassAppTest {
33+
34+
classAppTest {
3235

3336
@Test
34-
voidtestMain() {
35-
App.main(newString[]{});
37+
voidshouldExecuteApplicationWithoutException() {
38+
assertDoesNotThrow(() ->App.main(newString[]{}));
3639
}
3740

3841
}

‎monostate/src/test/java/com/iluwatar/monostate/AppTest.java

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,19 @@
2323

2424
packagecom.iluwatar.monostate;
2525

26+
importstaticorg.junit.jupiter.api.Assertions.assertDoesNotThrow;
27+
2628
importorg.junit.jupiter.api.Test;
2729

2830
/**
2931
* Application Test Entry
3032
*/
31-
publicclassAppTest {
33+
34+
classAppTest {
3235

3336
@Test
34-
voidtestMain() {
35-
App.main(newString[]{});
37+
voidshouldExecuteApplicationWithoutException() {
38+
assertDoesNotThrow(() ->App.main(newString[]{}));
3639
}
3740

3841
}

‎multiton/src/test/java/com/iluwatar/multiton/AppTest.java

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,18 @@
2323

2424
packagecom.iluwatar.multiton;
2525

26+
importstaticorg.junit.jupiter.api.Assertions.assertDoesNotThrow;
27+
2628
importorg.junit.jupiter.api.Test;
2729

2830
/**
29-
*Application test
31+
*Test if the application starts without throwing an exception.
3032
*/
31-
publicclassAppTest {
33+
34+
classAppTest {
3235

3336
@Test
34-
voidtest() {
35-
App.main(newString[]{});
37+
voidshouldExecuteApplicationWithoutException() {
38+
assertDoesNotThrow(() ->App.main(newString[]{}));
3639
}
3740
}

‎object-pool/src/test/java/com/iluwatar/object/pool/AppTest.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323

2424
packagecom.iluwatar.object.pool;
2525

26+
importstaticorg.junit.jupiter.api.Assertions.assertDoesNotThrow;
27+
2628
importorg.junit.jupiter.api.Test;
2729

2830
/**
@@ -34,6 +36,6 @@ class AppTest {
3436

3537
@Test
3638
voidshouldExecuteApplicationWithoutException() {
37-
App.main(newString[]{});
39+
assertDoesNotThrow(() ->App.main(newString[]{}));
3840
}
3941
}

‎parameter-object/src/test/java/com/iluwatar/parameter/object/AppTest.java

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,19 +23,16 @@
2323

2424
packagecom.iluwatar.parameter.object;
2525

26+
importstaticorg.junit.jupiter.api.Assertions.assertDoesNotThrow;
27+
2628
importorg.junit.jupiter.api.Test;
27-
importorg.slf4j.Logger;
28-
importorg.slf4j.LoggerFactory;
2929

3030
/**
3131
* Application test
3232
*/
3333
classAppTest {
34-
privatestaticfinalLoggerLOGGER =LoggerFactory.getLogger(AppTest.class);
35-
3634
@Test
3735
voidshouldExecuteApplicationWithoutException() {
38-
App.main(newString[]{});
39-
LOGGER.info("Executed successfully without exception.");
36+
assertDoesNotThrow(() ->App.main(newString[]{}));
4037
}
4138
}

‎saga/src/test/java/com/iluwatar/saga/orchestration/SagaApplicationTest.java

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,17 @@
2323

2424
packagecom.iluwatar.saga.orchestration;
2525

26+
importstaticorg.junit.jupiter.api.Assertions.assertDoesNotThrow;
27+
2628
importorg.junit.jupiter.api.Test;
2729

2830
/**
29-
*empty test
31+
*Test if the application starts without throwing an exception.
3032
*/
3133
classSagaApplicationTest {
3234

3335
@Test
34-
voidmainTest() {
35-
SagaApplication.main(newString[]{});
36+
voidshouldExecuteApplicationWithoutException() {
37+
assertDoesNotThrow(() ->SagaApplication.main(newString[]{}));
3638
}
3739
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp