"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "spring-webflux/src/test/java/org/springframework/web/reactive/result/view/script/ScriptTemplateViewTests.java" between
spring-framework-5.3.23.tar.gz and spring-framework-5.3.24.tar.gz

About: Spring Framework is an application framework for the Java platform and .NET Framework. Community edition.

ScriptTemplateViewTests.java  (spring-framework-5.3.23):ScriptTemplateViewTests.java  (spring-framework-5.3.24)
skipping to change at line 175 skipping to change at line 175
this.view.setApplicationContext(this.context)); this.view.setApplicationContext(this.context));
} }
@Test @Test
public void engineAndEngineNameBothDefined() { public void engineAndEngineNameBothDefined() {
this.view.setEngine(mock(InvocableScriptEngine.class)); this.view.setEngine(mock(InvocableScriptEngine.class));
this.view.setEngineName("test"); this.view.setEngineName("test");
this.view.setRenderFunction("render"); this.view.setRenderFunction("render");
assertThatIllegalArgumentException().isThrownBy(() -> assertThatIllegalArgumentException().isThrownBy(() ->
this.view.setApplicationContext(this.context)) this.view.setApplicationContext(this.context))
.withMessageContaining("You should define either 'engine' , 'engineSupplier' or 'engineName'."); .withMessageContaining("You should define either 'engine' , 'engineSupplier', or 'engineName'.");
} }
@Test // gh-23258 @Test // gh-23258
public void engineAndEngineSupplierBothDefined() { public void engineAndEngineSupplierBothDefined() {
ScriptEngine engine = mock(InvocableScriptEngine.class); ScriptEngine engine = mock(InvocableScriptEngine.class);
this.view.setEngineSupplier(() -> engine); this.view.setEngineSupplier(() -> engine);
this.view.setEngine(engine); this.view.setEngine(engine);
this.view.setRenderFunction("render"); this.view.setRenderFunction("render");
assertThatIllegalArgumentException().isThrownBy(() -> assertThatIllegalArgumentException().isThrownBy(() ->
this.view.setApplicationContext(this.context)) this.view.setApplicationContext(this.context))
.withMessageContaining("You should define either 'engine', 'engineSupplier' or 'engineName'."); .withMessageContaining("You should define either 'engine', 'engineSupplier', or 'engineName'.");
} }
@Test // gh-23258 @Test // gh-23258
public void engineNameAndEngineSupplierBothDefined() { public void engineNameAndEngineSupplierBothDefined() {
this.view.setEngineSupplier(() -> mock(InvocableScriptEngine.clas s)); this.view.setEngineSupplier(() -> mock(InvocableScriptEngine.clas s));
this.view.setEngineName("test"); this.view.setEngineName("test");
this.view.setRenderFunction("render"); this.view.setRenderFunction("render");
assertThatIllegalArgumentException().isThrownBy(() -> assertThatIllegalArgumentException().isThrownBy(() ->
this.view.setApplicationContext(this.context)) this.view.setApplicationContext(this.context))
.withMessageContaining("You should define either 'engine', 'engineSupplier' or 'engineName'."); .withMessageContaining("You should define either 'engine', 'engineSupplier', or 'engineName'.");
} }
@Test @Test
public void engineSetterAndNonSharedEngine() { public void engineSetterAndNonSharedEngine() {
this.view.setEngine(mock(InvocableScriptEngine.class)); this.view.setEngine(mock(InvocableScriptEngine.class));
this.view.setRenderFunction("render"); this.view.setRenderFunction("render");
this.view.setSharedEngine(false); this.view.setSharedEngine(false);
assertThatIllegalArgumentException().isThrownBy(() -> assertThatIllegalArgumentException().isThrownBy(() ->
this.view.setApplicationContext(this.context)) this.view.setApplicationContext(this.context))
.withMessageContaining("sharedEngine"); .withMessageContaining("sharedEngine");
 End of changes. 3 change blocks. 
3 lines changed or deleted 3 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)