|
15 | 15 | */ |
16 | 16 | package org.springframework.batch.core; |
17 | 17 |
|
18 | | -import static org.junit.jupiter.api.Assertions.assertEquals; |
19 | | -import static org.junit.jupiter.api.Assertions.assertTrue; |
20 | | - |
21 | 18 | import java.util.Date; |
22 | 19 |
|
23 | 20 | import org.junit.jupiter.api.Test; |
24 | 21 |
|
25 | 22 | import org.springframework.batch.core.job.parameters.JobParameter; |
26 | 23 |
|
| 24 | +import static org.junit.jupiter.api.Assertions.*; |
| 25 | + |
27 | 26 | /** |
28 | 27 | * @author Lucas Ward |
29 | 28 | * @author Mahmoud Ben Hassine |
30 | 29 | * |
31 | 30 | */ |
32 | 31 | class JobParameterTests { |
33 | 32 |
|
| 33 | + @Test |
| 34 | + void testConstructorNameNotNull() { |
| 35 | + IllegalArgumentException exception = assertThrows(IllegalArgumentException.class, |
| 36 | + () -> new JobParameter<>(null, "test", String.class, true)); |
| 37 | + assertEquals("name must not be null", exception.getMessage()); |
| 38 | + } |
| 39 | + |
| 40 | + @Test |
| 41 | + void testConstructorValueNotNull() { |
| 42 | + IllegalArgumentException exception = assertThrows(IllegalArgumentException.class, |
| 43 | + () -> new JobParameter<>("param", null, String.class, true)); |
| 44 | + assertEquals("value must not be null", exception.getMessage()); |
| 45 | + } |
| 46 | + |
| 47 | + @Test |
| 48 | + void testConstructorTypeNotNull() { |
| 49 | + IllegalArgumentException exception = assertThrows(IllegalArgumentException.class, |
| 50 | + () -> new JobParameter<>("param", "test", null, true)); |
| 51 | + assertEquals("type must not be null", exception.getMessage()); |
| 52 | + } |
| 53 | + |
34 | 54 | @Test |
35 | 55 | void testStringParameter() { |
36 | 56 | JobParameter<String> jobParameter = new JobParameter<>("param", "test", String.class, true); |
|
0 commit comments