31
31
import org .apache .activemq .artemis .api .core .TransportConfiguration ;
32
32
import org .apache .activemq .artemis .core .remoting .impl .invm .InVMConnectorFactory ;
33
33
import org .apache .activemq .artemis .core .remoting .impl .netty .NettyConnectorFactory ;
34
+ import org .apache .activemq .artemis .core .server .ActiveMQServer ;
34
35
import org .apache .activemq .artemis .core .server .BindingQueryResult ;
36
+ import org .apache .activemq .artemis .core .server .embedded .EmbeddedActiveMQ ;
35
37
import org .apache .activemq .artemis .jms .client .ActiveMQConnectionFactory ;
36
38
import org .apache .activemq .artemis .jms .server .config .JMSConfiguration ;
37
39
import org .apache .activemq .artemis .jms .server .config .JMSQueueConfiguration ;
38
40
import org .apache .activemq .artemis .jms .server .config .TopicConfiguration ;
39
41
import org .apache .activemq .artemis .jms .server .config .impl .JMSConfigurationImpl ;
40
42
import org .apache .activemq .artemis .jms .server .config .impl .JMSQueueConfigurationImpl ;
41
43
import org .apache .activemq .artemis .jms .server .config .impl .TopicConfigurationImpl ;
42
- import org .apache .activemq .artemis .jms .server .embedded .EmbeddedJMS ;
43
44
import org .junit .jupiter .api .Test ;
44
45
import org .junit .jupiter .api .io .TempDir ;
45
46
import org .messaginghub .pooled .jms .JmsPoolConnectionFactory ;
@@ -151,7 +152,7 @@ void embeddedConnectionFactory() {
151
152
.withPropertyValues ("spring.artemis.mode:embedded" ).run ((context ) -> {
152
153
ArtemisProperties properties = context .getBean (ArtemisProperties .class );
153
154
assertThat (properties .getMode ()).isEqualTo (ArtemisMode .EMBEDDED );
154
- assertThat (context ).hasSingleBean (EmbeddedJMS .class );
155
+ assertThat (context ).hasSingleBean (EmbeddedActiveMQ .class );
155
156
org .apache .activemq .artemis .core .config .Configuration configuration = context
156
157
.getBean (org .apache .activemq .artemis .core .config .Configuration .class );
157
158
assertThat (configuration .isPersistenceEnabled ()).isFalse ();
@@ -164,7 +165,7 @@ void embeddedConnectionFactory() {
164
165
void embeddedConnectionFactoryByDefault () {
165
166
// No mode is specified
166
167
this .contextRunner .withUserConfiguration (EmptyConfiguration .class ).run ((context ) -> {
167
- assertThat (context ).hasSingleBean (EmbeddedJMS .class );
168
+ assertThat (context ).hasSingleBean (EmbeddedActiveMQ .class );
168
169
org .apache .activemq .artemis .core .config .Configuration configuration = context
169
170
.getBean (org .apache .activemq .artemis .core .config .Configuration .class );
170
171
assertThat (configuration .isPersistenceEnabled ()).isFalse ();
@@ -178,7 +179,7 @@ void nativeConnectionFactoryIfEmbeddedServiceDisabledExplicitly() {
178
179
// No mode is specified
179
180
this .contextRunner .withUserConfiguration (EmptyConfiguration .class )
180
181
.withPropertyValues ("spring.artemis.embedded.enabled:false" ).run ((context ) -> {
181
- assertThat (context ).doesNotHaveBean (EmbeddedJMS .class );
182
+ assertThat (context ).doesNotHaveBean (ActiveMQServer .class );
182
183
assertNettyConnectionFactory (getActiveMQConnectionFactory (context .getBean (ConnectionFactory .class )),
183
184
"localhost" , 61616 );
184
185
});
@@ -190,7 +191,7 @@ void embeddedConnectionFactoryEvenIfEmbeddedServiceDisabled() {
190
191
this .contextRunner .withUserConfiguration (EmptyConfiguration .class )
191
192
.withPropertyValues ("spring.artemis.mode:embedded" , "spring.artemis.embedded.enabled:false" )
192
193
.run ((context ) -> {
193
- assertThat (context .getBeansOfType (EmbeddedJMS .class )).isEmpty ();
194
+ assertThat (context .getBeansOfType (ActiveMQServer .class )).isEmpty ();
194
195
assertInVmConnectionFactory (getActiveMQConnectionFactory (context .getBean (ConnectionFactory .class )));
195
196
});
196
197
}
@@ -379,10 +380,10 @@ private TransportConfiguration getSingleTransportConfiguration(ActiveMQConnectio
379
380
380
381
private static final class DestinationChecker {
381
382
382
- private final EmbeddedJMS embeddedJms ;
383
+ private final ActiveMQServer server ;
383
384
384
385
private DestinationChecker (ApplicationContext applicationContext ) {
385
- this .embeddedJms = applicationContext .getBean (EmbeddedJMS .class );
386
+ this .server = applicationContext .getBean (EmbeddedActiveMQ .class ). getActiveMQServer ( );
386
387
}
387
388
388
389
void checkQueue (String name , boolean shouldExist ) {
@@ -395,7 +396,7 @@ void checkTopic(String name, boolean shouldExist) {
395
396
396
397
void checkDestination (String name , RoutingType routingType , boolean shouldExist ) {
397
398
try {
398
- BindingQueryResult result = this .embeddedJms . getActiveMQServer () .bindingQuery (new SimpleString (name ));
399
+ BindingQueryResult result = this .server .bindingQuery (new SimpleString (name ));
399
400
assertThat (result .isExists ()).isEqualTo (shouldExist );
400
401
if (shouldExist ) {
401
402
assertThat (result .getAddressInfo ().getRoutingType ()).isEqualTo (routingType );
0 commit comments