Skip to content

Commit a1b5d77

Browse files
committed
Migrated the following modules, nos using parent-boot-2:
spring-protobuf spring-mockito spring-mustache spring-kafka spring-jooq spring-cucumber spring-aop spring-amqp-simple
1 parent 29b4110 commit a1b5d77

File tree

9 files changed

+23
-24
lines changed

9 files changed

+23
-24
lines changed

spring-amqp-simple/src/main/java/com/baeldung/springamqpsimple/SpringAmqpConfig.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ Binding binding(Queue queue, DirectExchange exchange) {
3535
}
3636

3737
@Bean
38-
SimpleMessageListenerContainer container(ConnectionFactory connectionFactory,
38+
SimpleMessageListenerContainer SpringAmqpContainer(ConnectionFactory connectionFactory,
3939
MessageListenerAdapter listenerAdapter) {
4040
SimpleMessageListenerContainer container = new SimpleMessageListenerContainer();
4141
container.setConnectionFactory(connectionFactory);

spring-amqp-simple/src/main/java/com/baeldung/springamqpsimple/broadcast/BroadcastConfig.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ public List<Declarable> fanoutBindings() {
6161
}
6262

6363
@Bean
64-
public SimpleRabbitListenerContainerFactory container(ConnectionFactory connectionFactory, SimpleRabbitListenerContainerFactoryConfigurer configurer) {
64+
public SimpleRabbitListenerContainerFactory BroadcastContainer(ConnectionFactory connectionFactory, SimpleRabbitListenerContainerFactoryConfigurer configurer) {
6565
SimpleRabbitListenerContainerFactory factory = new SimpleRabbitListenerContainerFactory();
6666
configurer.configure(factory, connectionFactory);
6767
return factory;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
spring:
2+
rabbitmq:
3+
username: guest
4+
password: guest
5+
host: localhost

spring-jooq/pom.xml

+4-3
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,9 @@
129129
<packageName>com.baeldung.jooq.introduction.db</packageName>
130130
<directory>src/main/java</directory>
131131
</target>
132+
<database>
133+
<inputCatalog></inputCatalog>
134+
</database>
132135
</generator>
133136
</configuration>
134137
</execution>
@@ -185,14 +188,12 @@
185188
</dependencyManagement>
186189

187190
<properties>
188-
<org.jooq.version>3.8.6</org.jooq.version>
191+
<org.jooq.version>3.11.7</org.jooq.version>
189192
<com.h2database.version>1.4.193</com.h2database.version>
190-
<org.springframework.version>4.3.17.RELEASE</org.springframework.version>
191193

192194
<lifecycle-mapping.version>1.0.0</lifecycle-mapping.version>
193195
<sql-maven-plugin.version>1.5</sql-maven-plugin.version>
194196
<properties-maven-plugin.version>1.0.0</properties-maven-plugin.version>
195-
<spring-boot.version>1.5.13.RELEASE</spring-boot.version>
196197
<start-class>org.jooq.example.spring.Application</start-class>
197198
</properties>
198199

spring-kafka/pom.xml

-2
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,9 @@
3030
<groupId>com.fasterxml.jackson.core</groupId>
3131
<artifactId>jackson-databind</artifactId>
3232
</dependency>
33-
3433
</dependencies>
3534

3635
<properties>
37-
<spring-kafka.version>1.1.3.RELEASE</spring-kafka.version>
3836
<jackson.version>2.6.7</jackson.version>
3937
</properties>
4038

spring-kafka/src/main/java/com/baeldung/spring/kafka/KafkaApplication.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public class KafkaApplication {
2222
public static void main(String[] args) throws Exception {
2323

2424
ConfigurableApplicationContext context = SpringApplication.run(KafkaApplication.class, args);
25-
25+
2626
MessageProducer producer = context.getBean(MessageProducer.class);
2727
MessageListener listener = context.getBean(MessageListener.class);
2828
/*
@@ -102,7 +102,7 @@ public void sendMessage(String message) {
102102
}
103103

104104
public void sendMessageToPartion(String message, int partition) {
105-
kafkaTemplate.send(partionedTopicName, partition, message);
105+
kafkaTemplate.send(partionedTopicName, partition, null, message);
106106
}
107107

108108
public void sendMessageToFiltered(String message) {
@@ -124,13 +124,13 @@ public static class MessageListener {
124124

125125
private CountDownLatch greetingLatch = new CountDownLatch(1);
126126

127-
@KafkaListener(topics = "${message.topic.name}", group = "foo", containerFactory = "fooKafkaListenerContainerFactory")
127+
@KafkaListener(topics = "${message.topic.name}", groupId = "foo", containerFactory = "fooKafkaListenerContainerFactory")
128128
public void listenGroupFoo(String message) {
129129
System.out.println("Received Messasge in group 'foo': " + message);
130130
latch.countDown();
131131
}
132132

133-
@KafkaListener(topics = "${message.topic.name}", group = "bar", containerFactory = "barKafkaListenerContainerFactory")
133+
@KafkaListener(topics = "${message.topic.name}", groupId = "bar", containerFactory = "barKafkaListenerContainerFactory")
134134
public void listenGroupBar(String message) {
135135
System.out.println("Received Messasge in group 'bar': " + message);
136136
latch.countDown();

spring-mockito/src/test/java/com/baeldung/NameServiceTestConfiguration.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
public class NameServiceTestConfiguration {
1212
@Bean
1313
@Primary
14-
public NameService nameService() {
14+
public NameService nameServiceTest() {
1515
return Mockito.mock(NameService.class);
1616
}
1717
}

spring-protobuf/pom.xml

+1-12
Original file line numberDiff line numberDiff line change
@@ -36,21 +36,10 @@
3636
</dependency>
3737
</dependencies>
3838

39-
<build>
40-
<plugins>
41-
<plugin>
42-
<groupId>org.springframework.boot</groupId>
43-
<artifactId>spring-boot-maven-plugin</artifactId>
44-
<configuration>
45-
<skip>true</skip>
46-
</configuration>
47-
</plugin>
48-
</plugins>
49-
</build>
50-
5139
<properties>
5240
<protobuf-java.version>3.1.0</protobuf-java.version>
5341
<protobuf-java-format.version>1.4</protobuf-java-format.version>
42+
<start-class>com.baeldung.protobuf.Application</start-class>
5443
</properties>
5544

5645
</project>

spring-protobuf/src/main/java/com/baeldung/protobuf/Application.java

+6
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@
44
import com.baeldung.protobuf.BaeldungTraining.Student;
55
import com.baeldung.protobuf.BaeldungTraining.Student.PhoneNumber;
66
import com.baeldung.protobuf.BaeldungTraining.Student.PhoneType;
7+
78
import org.springframework.boot.autoconfigure.SpringBootApplication;
9+
import org.springframework.boot.builder.SpringApplicationBuilder;
810
import org.springframework.context.annotation.Bean;
911
import org.springframework.http.converter.protobuf.ProtobufHttpMessageConverter;
1012
import org.springframework.web.client.RestTemplate;
@@ -17,6 +19,10 @@
1719

1820
@SpringBootApplication
1921
public class Application {
22+
23+
public static void main(String[] args) {
24+
new SpringApplicationBuilder(Application.class).run(args);
25+
}
2026

2127
@Bean
2228
RestTemplate restTemplate(ProtobufHttpMessageConverter hmc) {

0 commit comments

Comments
 (0)