minor fixes:
fixed method naming added dirtiesContext annotation to classes that shouldnt share the app context state using SpringApplication instead of unnecessary SpringApplicationBuilder
This commit is contained in:
parent
832a3dc176
commit
cb259f6f6c
|
@ -35,7 +35,7 @@ public class SpringAmqpConfig {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
SimpleMessageListenerContainer SpringAmqpContainer(ConnectionFactory connectionFactory,
|
SimpleMessageListenerContainer springAmqpContainer(ConnectionFactory connectionFactory,
|
||||||
MessageListenerAdapter listenerAdapter) {
|
MessageListenerAdapter listenerAdapter) {
|
||||||
SimpleMessageListenerContainer container = new SimpleMessageListenerContainer();
|
SimpleMessageListenerContainer container = new SimpleMessageListenerContainer();
|
||||||
container.setConnectionFactory(connectionFactory);
|
container.setConnectionFactory(connectionFactory);
|
||||||
|
|
|
@ -61,7 +61,7 @@ public class BroadcastConfig {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
public SimpleRabbitListenerContainerFactory BroadcastContainer(ConnectionFactory connectionFactory, SimpleRabbitListenerContainerFactoryConfigurer configurer) {
|
public SimpleRabbitListenerContainerFactory broadcastContainer(ConnectionFactory connectionFactory, SimpleRabbitListenerContainerFactoryConfigurer configurer) {
|
||||||
SimpleRabbitListenerContainerFactory factory = new SimpleRabbitListenerContainerFactory();
|
SimpleRabbitListenerContainerFactory factory = new SimpleRabbitListenerContainerFactory();
|
||||||
configurer.configure(factory, connectionFactory);
|
configurer.configure(factory, connectionFactory);
|
||||||
return factory;
|
return factory;
|
||||||
|
|
|
@ -1,27 +1,27 @@
|
||||||
package com.baeldung.protobuf;
|
package com.baeldung.protobuf;
|
||||||
|
|
||||||
import com.baeldung.protobuf.BaeldungTraining.Course;
|
|
||||||
import com.baeldung.protobuf.BaeldungTraining.Student;
|
|
||||||
import com.baeldung.protobuf.BaeldungTraining.Student.PhoneNumber;
|
|
||||||
import com.baeldung.protobuf.BaeldungTraining.Student.PhoneType;
|
|
||||||
|
|
||||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
|
||||||
import org.springframework.boot.builder.SpringApplicationBuilder;
|
|
||||||
import org.springframework.context.annotation.Bean;
|
|
||||||
import org.springframework.http.converter.protobuf.ProtobufHttpMessageConverter;
|
|
||||||
import org.springframework.web.client.RestTemplate;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
import org.springframework.boot.SpringApplication;
|
||||||
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
|
import org.springframework.context.annotation.Bean;
|
||||||
|
import org.springframework.http.converter.protobuf.ProtobufHttpMessageConverter;
|
||||||
|
import org.springframework.web.client.RestTemplate;
|
||||||
|
|
||||||
|
import com.baeldung.protobuf.BaeldungTraining.Course;
|
||||||
|
import com.baeldung.protobuf.BaeldungTraining.Student;
|
||||||
|
import com.baeldung.protobuf.BaeldungTraining.Student.PhoneNumber;
|
||||||
|
import com.baeldung.protobuf.BaeldungTraining.Student.PhoneType;
|
||||||
|
|
||||||
@SpringBootApplication
|
@SpringBootApplication
|
||||||
public class Application {
|
public class Application {
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
new SpringApplicationBuilder(Application.class).run(args);
|
SpringApplication.run(Application.class, args);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Bean
|
@Bean
|
||||||
|
|
|
@ -16,12 +16,14 @@ import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.boot.test.context.SpringBootTest;
|
import org.springframework.boot.test.context.SpringBootTest;
|
||||||
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
|
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
|
||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.http.ResponseEntity;
|
||||||
|
import org.springframework.test.annotation.DirtiesContext;
|
||||||
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
|
||||||
import org.springframework.web.client.RestTemplate;
|
import org.springframework.web.client.RestTemplate;
|
||||||
|
|
||||||
import com.baeldung.protobuf.BaeldungTraining.Course;
|
import com.baeldung.protobuf.BaeldungTraining.Course;
|
||||||
import com.googlecode.protobuf.format.JsonFormat;
|
import com.googlecode.protobuf.format.JsonFormat;
|
||||||
|
|
||||||
|
@DirtiesContext
|
||||||
@RunWith(SpringJUnit4ClassRunner.class)
|
@RunWith(SpringJUnit4ClassRunner.class)
|
||||||
@SpringBootTest(classes = Application.class, webEnvironment = WebEnvironment.DEFINED_PORT)
|
@SpringBootTest(classes = Application.class, webEnvironment = WebEnvironment.DEFINED_PORT)
|
||||||
public class ApplicationIntegrationTest {
|
public class ApplicationIntegrationTest {
|
||||||
|
|
|
@ -3,10 +3,12 @@ package org.baeldung;
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.junit.runner.RunWith;
|
import org.junit.runner.RunWith;
|
||||||
import org.springframework.boot.test.context.SpringBootTest;
|
import org.springframework.boot.test.context.SpringBootTest;
|
||||||
|
import org.springframework.test.annotation.DirtiesContext;
|
||||||
import org.springframework.test.context.junit4.SpringRunner;
|
import org.springframework.test.context.junit4.SpringRunner;
|
||||||
|
|
||||||
import com.baeldung.protobuf.Application;
|
import com.baeldung.protobuf.Application;
|
||||||
|
|
||||||
|
@DirtiesContext
|
||||||
@RunWith(SpringRunner.class)
|
@RunWith(SpringRunner.class)
|
||||||
@SpringBootTest(classes = Application.class)
|
@SpringBootTest(classes = Application.class)
|
||||||
public class SpringContextIntegrationTest {
|
public class SpringContextIntegrationTest {
|
||||||
|
|
Loading…
Reference in New Issue