Skip to content

Conversation

ngocnhan-tran1996
Copy link
Contributor

No description provided.

Signed-off-by: Tran Ngoc Nhan <ngocnhan.tran1996@gmail.com>
Signed-off-by: Tran Ngoc Nhan <ngocnhan.tran1996@gmail.com>
@artembilan artembilan added this to the 7.0.0-RC1 milestone Oct 13, 2025
"</beans>";
// Load context from a String to avoid IDEs reporting the invalid configuration
String badContext =
"<?xml version=\"1.0\" encoding=\"UTF-8\"?>" +
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, since we are already here, please, consider to use Java text block instead of concatenations.

}
Resource resource = new ByteArrayResource(badContext.getBytes());
assertThatExceptionOfType(BeanDefinitionParsingException.class)
.isThrownBy(() -> new GenericXmlApplicationContext(resource).close())
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need close() since we are going to fail.

}
Resource resource = new ByteArrayResource(badContext.getBytes());
assertThatExceptionOfType(BeanDefinitionParsingException.class)
.isThrownBy(() -> new GenericXmlApplicationContext(resource).close())
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DITTO

}
Resource resource = new ByteArrayResource(badContext.getBytes());
assertThatExceptionOfType(BeanDefinitionParsingException.class)
.isThrownBy(() -> new GenericXmlApplicationContext(resource).close())
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DITTO

public void testProcedureNameAndExpressionExclusivity() {

assertThatExceptionOfType(BeanDefinitionParsingException.class)
.isThrownBy(() -> this.bootStrap("nameAndExpressionExclusivity"))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now we prefer to not use this. prefix for method calls.

assertThatIllegalStateException()
.isThrownBy(() -> {
gateway.afterPropertiesSet();
gateway.handleRequestMessage(message);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We fail here just after gateway.afterPropertiesSet();, therefore second call is not reachable, redundant and misleading.
Plus, this second call is not asserted anyhow.
Well, it just has to go.

Signed-off-by: Tran Ngoc Nhan <ngocnhan.tran1996@gmail.com>
Signed-off-by: Tran Ngoc Nhan <ngocnhan.tran1996@gmail.com>
@artembilan artembilan merged commit b162e2b into spring-projects:main Oct 14, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants