Skip to content

Commit

Permalink
Polish JmsAccessorTests
Browse files Browse the repository at this point in the history
This commit reduces the visibility of JmsAccessorTests and its test
methods to package-private and removes unnecessary throws declarations.
  • Loading branch information
vpavic committed Jun 9, 2023
1 parent 9b590a0 commit db2f1d6
Showing 1 changed file with 5 additions and 5 deletions.
Expand Up @@ -31,33 +31,33 @@
* @author Chris Beams
* @author Vedran Pavic
*/
public class JmsAccessorTests {
class JmsAccessorTests {

@Test
public void testChokesIfConnectionFactoryIsNotSupplied() throws Exception {
void testChokesIfConnectionFactoryIsNotSupplied() {
JmsAccessor accessor = new StubJmsAccessor();
assertThatIllegalArgumentException().isThrownBy(
accessor::afterPropertiesSet);
}

@Test
public void testSessionTransactedModeReallyDoesDefaultToFalse() throws Exception {
void testSessionTransactedModeReallyDoesDefaultToFalse() {
JmsAccessor accessor = new StubJmsAccessor();
assertThat(accessor.isSessionTransacted()).as("The [sessionTransacted] property of JmsAccessor must default to " +
"false. Change this test (and the attendant Javadoc) if you have " +
"changed the default.").isFalse();
}

@Test
public void testAcknowledgeModeReallyDoesDefaultToAutoAcknowledge() throws Exception {
void testAcknowledgeModeReallyDoesDefaultToAutoAcknowledge() {
JmsAccessor accessor = new StubJmsAccessor();
assertThat(accessor.getSessionAcknowledgeMode()).as("The [sessionAcknowledgeMode] property of JmsAccessor must default to " +
"[Session.AUTO_ACKNOWLEDGE]. Change this test (and the attendant " +
"Javadoc) if you have changed the default.").isEqualTo(Session.AUTO_ACKNOWLEDGE);
}

@Test
public void testSetAcknowledgeModeNameChokesIfBadAckModeIsSupplied() throws Exception {
void testSetAcknowledgeModeNameChokesIfBadAckModeIsSupplied() {
assertThatIllegalArgumentException().isThrownBy(() ->
new StubJmsAccessor().setSessionAcknowledgeModeName("Tally ho chaps!"));
}
Expand Down

0 comments on commit db2f1d6

Please sign in to comment.