GH-350 Fixed NPE due to missing main class
Fixed NPE due to the missing main class - a condition that could be cause my missconfiguration Added additional assertions Added more descriptive error message Added MAIN_CLASS system property to the search path Added tests Resolves #350
This commit is contained in:
@@ -54,6 +54,26 @@ public class SpringFunctionAdapterInitializerTests {
|
||||
}
|
||||
}
|
||||
|
||||
@Test(expected = IllegalArgumentException.class)
|
||||
public void nullSource() {
|
||||
this.initializer = new AbstractSpringFunctionAdapterInitializer<Object>(null) {
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
@Test
|
||||
public void sourceAsMainClassProperty() {
|
||||
try {
|
||||
System.setProperty("MAIN_CLASS", FluxFunctionConfig.class.getName());
|
||||
this.initializer = new AbstractSpringFunctionAdapterInitializer<Object>() {
|
||||
|
||||
};
|
||||
}
|
||||
finally {
|
||||
System.clearProperty("MAIN_CLASS");
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void functionBean() {
|
||||
this.initializer = new AbstractSpringFunctionAdapterInitializer<Object>(FluxFunctionConfig.class) {
|
||||
|
||||
Reference in New Issue
Block a user