Skip to content

Commit be72e60

Browse files
authored
Merge pull request bcgov#153 from sdevalapurkar/sd-input-plugin-test
Add InputConfig test case
2 parents 2c0dd74 + cfdaf7c commit be72e60

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

jrcc-access-spring-boot-autoconfigure/src/test/java/ca/bc/gov/open/jrccaccess/autoconfigure/AccessAutoConfigurationTests.java

+15-5
Original file line numberDiff line numberDiff line change
@@ -6,33 +6,43 @@
66
import org.junit.Test;
77

88
import static org.junit.Assert.assertNotNull;
9+
import static org.junit.Assert.assertEquals;
910

1011

1112
public class AccessAutoConfigurationTests {
12-
private AccessAutoConfiguration aac;
13+
private AccessAutoConfiguration sut;
1314

1415
@Test
1516
public void constructor_with_valid_property_should_create_object() throws Exception{
1617
AccessProperties properties = new AccessProperties();
1718
properties.setInput(new AccessProperties.PluginConfig());
1819
properties.setOutput(new AccessProperties.PluginConfig());
19-
aac = new AccessAutoConfiguration(properties);
20-
assertNotNull(aac );
20+
sut = new AccessAutoConfiguration(properties);
21+
assertNotNull(sut );
2122
}
2223

2324
@Test(expected = InputConfigMissingException.class)
2425
public void constructor_with_null_input_property_should_throw_InputConfigMissingException() throws InvalidConfigException{
2526
AccessProperties properties = new AccessProperties();
2627
properties.setOutput(new AccessProperties.PluginConfig());
2728
properties.setInput(null);
28-
aac = new AccessAutoConfiguration(properties);
29+
sut = new AccessAutoConfiguration(properties);
2930
}
3031

3132
@Test(expected = OutputConfigMissingException.class)
3233
public void constructor_with_null_output_property_should_throw_OutputConfigMissingException() throws InvalidConfigException{
3334
AccessProperties properties = new AccessProperties();
3435
properties.setInput(new AccessProperties.PluginConfig());
3536
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());
3747
}
3848
}

0 commit comments

Comments
 (0)