Skip to content

Commit 1c79e93

Browse files
committed
complementation
1 parent 6dd29d2 commit 1c79e93

File tree

4 files changed

+35
-29
lines changed

4 files changed

+35
-29
lines changed

lombok.config

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
lombok.addLombokGeneratedAnnotation = true

src/main/java/sham/study/functionvalidation/App.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,9 @@
33
import sham.study.functionvalidation.interfaces.MainController;
44

55
public class App {
6+
67
public static void main(final String[] args) {
7-
final MainController mainController = new MainController();
8-
mainController.run();
8+
MainController.run(true);
99
}
10+
1011
}

src/main/java/sham/study/functionvalidation/interfaces/MainController.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,11 @@
1313
@UtilityClass
1414
public class MainController {
1515

16-
public static void run(final boolean isDebug) {
16+
public static List<Item> run(final boolean isDebug) {
1717
final List<BruteItem> bruteItems = ItemGenerator.generate(10);
1818
final List<Item> items = CustomValidationFacade.validate(bruteItems);
1919
activateLog(items, isDebug);
20+
return items;
2021

2122
}
2223

Lines changed: 29 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,41 @@
11
package sham.study.functionvalidation;
22

3+
import java.util.List;
4+
35
import junit.framework.Test;
46
import junit.framework.TestCase;
57
import junit.framework.TestSuite;
8+
import sham.study.functionvalidation.domain.management.ExceptionManager;
9+
import sham.study.functionvalidation.domain.model.Item;
10+
import sham.study.functionvalidation.interfaces.MainController;
611

712
/**
813
* Unit test for simple App.
914
*/
10-
public class AppTest
11-
extends TestCase
12-
{
13-
/**
14-
* Create the test case
15-
*
16-
* @param testName name of the test case
17-
*/
18-
public AppTest( String testName )
19-
{
20-
super( testName );
21-
}
15+
public class AppTest extends TestCase {
16+
/**
17+
* Create the test case
18+
*
19+
* @param testName name of the test case
20+
*/
21+
public AppTest(final String testName) {
22+
super(testName);
23+
}
2224

23-
/**
24-
* @return the suite of tests being tested
25-
*/
26-
public static Test suite()
27-
{
28-
return new TestSuite( AppTest.class );
29-
}
25+
/**
26+
* @return the suite of tests being tested
27+
*/
28+
public static Test suite() {
29+
return new TestSuite(AppTest.class);
30+
}
3031

31-
/**
32-
* Rigourous Test :-)
33-
*/
34-
public void testApp()
35-
{
36-
assertTrue( true );
37-
}
32+
/**
33+
* Rigourous Test :-)
34+
*/
35+
public void testApp() {
36+
final List<Item> items = MainController.run(true);
37+
assertEquals(10, items.size());
38+
final List<String> errors = ExceptionManager.messages;
39+
assertEquals(10, errors.size());
40+
}
3841
}

0 commit comments

Comments
 (0)