|
6 | 6 | import org.junit.Test;
|
7 | 7 |
|
8 | 8 | import static org.junit.Assert.assertNotNull;
|
| 9 | +import static org.junit.Assert.assertEquals; |
9 | 10 |
|
10 | 11 |
|
11 | 12 | public class AccessAutoConfigurationTests {
|
12 |
| - private AccessAutoConfiguration aac; |
| 13 | + private AccessAutoConfiguration sut; |
13 | 14 |
|
14 | 15 | @Test
|
15 | 16 | public void constructor_with_valid_property_should_create_object() throws Exception{
|
16 | 17 | AccessProperties properties = new AccessProperties();
|
17 | 18 | properties.setInput(new AccessProperties.PluginConfig());
|
18 | 19 | properties.setOutput(new AccessProperties.PluginConfig());
|
19 |
| - aac = new AccessAutoConfiguration(properties); |
20 |
| - assertNotNull(aac ); |
| 20 | + sut = new AccessAutoConfiguration(properties); |
| 21 | + assertNotNull(sut ); |
21 | 22 | }
|
22 | 23 |
|
23 | 24 | @Test(expected = InputConfigMissingException.class)
|
24 | 25 | public void constructor_with_null_input_property_should_throw_InputConfigMissingException() throws InvalidConfigException{
|
25 | 26 | AccessProperties properties = new AccessProperties();
|
26 | 27 | properties.setOutput(new AccessProperties.PluginConfig());
|
27 | 28 | properties.setInput(null);
|
28 |
| - aac = new AccessAutoConfiguration(properties); |
| 29 | + sut = new AccessAutoConfiguration(properties); |
29 | 30 | }
|
30 | 31 |
|
31 | 32 | @Test(expected = OutputConfigMissingException.class)
|
32 | 33 | public void constructor_with_null_output_property_should_throw_OutputConfigMissingException() throws InvalidConfigException{
|
33 | 34 | AccessProperties properties = new AccessProperties();
|
34 | 35 | properties.setInput(new AccessProperties.PluginConfig());
|
35 | 36 | properties.setOutput(null);
|
36 |
| - aac = new AccessAutoConfiguration(properties); |
| 37 | + sut = new AccessAutoConfiguration(properties); |
| 38 | + } |
| 39 | + |
| 40 | + @Test |
| 41 | + public void input_config_returns_valid_input_plugin_config() throws InvalidConfigException { |
| 42 | + AccessProperties properties = new AccessProperties(); |
| 43 | + properties.setInput(new AccessProperties.PluginConfig()); |
| 44 | + properties.setOutput(new AccessProperties.PluginConfig()); |
| 45 | + sut = new AccessAutoConfiguration(properties); |
| 46 | + assertEquals(sut.inputConfig(), properties.getInput()); |
37 | 47 | }
|
38 | 48 | }
|
0 commit comments