Last active
July 3, 2022 19:27
-
-
Save atesibrahim/9c50c6ace83048eaaff1a41934344643 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@RunWith(MockitoJUnitRunner.class) | |
public class RabbitMqConfigurationTest { | |
@InjectMocks | |
private RabbitMqConfiguration queueConfiguration; | |
@Test | |
public void it_should_get_queue() { | |
//Given && //When | |
final Queue queue = queueConfiguration.queue(); | |
//Then | |
assertThat(queue.isDurable()).isTrue(); | |
assertThat(queue.getName()).isEqualTo("queue"); | |
assertThat(queue.getArguments()).containsEntry(X_DEAD_LETTER_EXCHANGE, ""); | |
assertThat(queue.getArguments()).containsEntry(X_DEAD_LETTER_ROUTING_KEY, "queue.dead-letter"); | |
} | |
@Test | |
public void it_should_get_exchange() { | |
//Given && //When | |
final TopicExchange topicExchange = queueConfiguration.exchange(); | |
//Then | |
assertThat(topicExchange.getName()).isEqualTo("queue"); | |
} | |
@Test | |
public void it_should_get_queue_dead_letter() { | |
//Given && //When | |
final Queue queue = queueConfiguration.deadLetter(); | |
//Then | |
assertThat(queue.isDurable()).isTrue(); | |
assertThat(queue.getName()).isEqualTo("queue.dead-letter"); | |
} | |
@Test | |
public void it_should_get_binding() { | |
//Given && //When | |
final Binding binding = queueConfiguration.queueBinding(); | |
//Then | |
assertThat(binding.getExchange()).isEqualTo("queue"); | |
assertThat(binding.getDestination()).isEqualTo("queue"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment