Merge pull request #8440 from kwoyke/BAEL-20552
BAEL-20552: Standardize packages for spring-4, spring-vault and spring-webflux-amqp modules
This commit is contained in:
commit
b557a478d1
@ -1,4 +1,4 @@
|
||||
package org.baeldung.spring43.attributeannotations;
|
||||
package com.baeldung.spring43.attributeannotations;
|
||||
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
@ -1,4 +1,4 @@
|
||||
package org.baeldung.spring43.attributeannotations;
|
||||
package com.baeldung.spring43.attributeannotations;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
@ -1,4 +1,4 @@
|
||||
package org.baeldung.spring43.cache;
|
||||
package com.baeldung.spring43.cache;
|
||||
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
@ -1,4 +1,4 @@
|
||||
package org.baeldung.spring43.cache;
|
||||
package com.baeldung.spring43.cache;
|
||||
|
||||
import org.springframework.cache.annotation.Cacheable;
|
||||
import org.springframework.stereotype.Service;
|
@ -0,0 +1,5 @@
|
||||
package com.baeldung.spring43.composedmapping;
|
||||
|
||||
public class Appointment {
|
||||
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
package org.baeldung.spring43.composedmapping;
|
||||
package com.baeldung.spring43.composedmapping;
|
||||
|
||||
import java.util.Map;
|
||||
|
@ -1,4 +1,4 @@
|
||||
package org.baeldung.spring43.composedmapping;
|
||||
package com.baeldung.spring43.composedmapping;
|
||||
|
||||
import java.util.Map;
|
||||
|
@ -0,0 +1,5 @@
|
||||
package com.baeldung.spring43.ctor;
|
||||
|
||||
public class FooRepository {
|
||||
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
package org.baeldung.spring43.ctor;
|
||||
package com.baeldung.spring43.ctor;
|
||||
|
||||
public class FooService {
|
||||
|
@ -1,4 +1,4 @@
|
||||
package org.baeldung.spring43.defaultmethods;
|
||||
package com.baeldung.spring43.defaultmethods;
|
||||
|
||||
import java.time.LocalDate;
|
||||
|
@ -1,4 +1,4 @@
|
||||
package org.baeldung.spring43.defaultmethods;
|
||||
package com.baeldung.spring43.defaultmethods;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.time.format.DateTimeFormatter;
|
@ -1,4 +1,4 @@
|
||||
package org.baeldung.spring43.depresolution;
|
||||
package com.baeldung.spring43.depresolution;
|
||||
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
@ -1,4 +1,4 @@
|
||||
package org.baeldung.spring43.depresolution;
|
||||
package com.baeldung.spring43.depresolution;
|
||||
|
||||
import org.springframework.beans.factory.ObjectProvider;
|
||||
import org.springframework.stereotype.Service;
|
@ -1,4 +1,4 @@
|
||||
package org.baeldung.spring43.scopeannotations;
|
||||
package com.baeldung.spring43.scopeannotations;
|
||||
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.web.context.annotation.ApplicationScope;
|
@ -1,4 +1,4 @@
|
||||
package org.baeldung.spring43.scopeannotations;
|
||||
package com.baeldung.spring43.scopeannotations;
|
||||
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
@ -1,4 +1,4 @@
|
||||
package org.baeldung.spring43.scopeannotations;
|
||||
package com.baeldung.spring43.scopeannotations;
|
||||
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.web.context.annotation.RequestScope;
|
@ -1,4 +1,4 @@
|
||||
package org.baeldung.spring43.scopeannotations;
|
||||
package com.baeldung.spring43.scopeannotations;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
@ -1,4 +1,4 @@
|
||||
package org.baeldung.spring43.scopeannotations;
|
||||
package com.baeldung.spring43.scopeannotations;
|
||||
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.web.context.annotation.SessionScope;
|
@ -1,5 +0,0 @@
|
||||
package org.baeldung.spring43.composedmapping;
|
||||
|
||||
public class Appointment {
|
||||
|
||||
}
|
@ -1,5 +0,0 @@
|
||||
package org.baeldung.spring43.ctor;
|
||||
|
||||
public class FooRepository {
|
||||
|
||||
}
|
@ -3,7 +3,7 @@
|
||||
xmlns="http://www.springframework.org/schema/beans"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
|
||||
|
||||
<bean id="dateHolder" class="org.baeldung.spring43.defaultmethods.DateHolder">
|
||||
<bean id="dateHolder" class="com.baeldung.spring43.defaultmethods.DateHolder">
|
||||
<property name="stringDate" value="15.10.1982"/>
|
||||
</bean>
|
||||
|
||||
|
@ -3,8 +3,8 @@
|
||||
xmlns="http://www.springframework.org/schema/beans"
|
||||
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
|
||||
|
||||
<bean class="org.baeldung.spring43.ctor.FooRepository"/>
|
||||
<bean class="com.baeldung.spring43.ctor.FooRepository"/>
|
||||
|
||||
<bean class="org.baeldung.spring43.ctor.FooService"/>
|
||||
<bean class="com.baeldung.spring43.ctor.FooService"/>
|
||||
|
||||
</beans>
|
||||
|
@ -1,4 +1,4 @@
|
||||
package org.baeldung;
|
||||
package com.baeldung;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
@ -1,4 +1,4 @@
|
||||
package org.baeldung.spring43.attributeannotations;
|
||||
package com.baeldung.spring43.attributeannotations;
|
||||
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.ComponentScan;
|
@ -1,4 +1,4 @@
|
||||
package org.baeldung.spring43.attributeannotations;
|
||||
package com.baeldung.spring43.attributeannotations;
|
||||
|
||||
import org.junit.Assert;
|
||||
import org.junit.Before;
|
@ -1,4 +1,4 @@
|
||||
package org.baeldung.spring43.cache;
|
||||
package com.baeldung.spring43.cache;
|
||||
|
||||
import java.util.Collections;
|
||||
|
@ -1,4 +1,4 @@
|
||||
package org.baeldung.spring43.cache;
|
||||
package com.baeldung.spring43.cache;
|
||||
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.Executors;
|
@ -1,4 +1,4 @@
|
||||
package org.baeldung.spring43.composedmapping;
|
||||
package com.baeldung.spring43.composedmapping;
|
||||
|
||||
import java.util.Collections;
|
||||
|
@ -1,4 +1,4 @@
|
||||
package org.baeldung.spring43.composedmapping;
|
||||
package com.baeldung.spring43.composedmapping;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
@ -1,4 +1,4 @@
|
||||
package org.baeldung.spring43.ctor;
|
||||
package com.baeldung.spring43.ctor;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
@ -1,4 +1,4 @@
|
||||
package org.baeldung.spring43.ctor;
|
||||
package com.baeldung.spring43.ctor;
|
||||
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
@ -1,4 +1,4 @@
|
||||
package org.baeldung.spring43.ctor;
|
||||
package com.baeldung.spring43.ctor;
|
||||
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
@ -1,4 +1,4 @@
|
||||
package org.baeldung.spring43.ctor;
|
||||
package com.baeldung.spring43.ctor;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
@ -1,4 +1,4 @@
|
||||
package org.baeldung.spring43.defaultmethods;
|
||||
package com.baeldung.spring43.defaultmethods;
|
||||
|
||||
import java.time.LocalDate;
|
||||
|
@ -1,4 +1,4 @@
|
||||
package org.baeldung.spring43.defaultmethods;
|
||||
package com.baeldung.spring43.defaultmethods;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
@ -1,4 +1,4 @@
|
||||
package org.baeldung.spring43.defaultmethods;
|
||||
package com.baeldung.spring43.defaultmethods;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.springframework.test.context.ContextConfiguration;
|
@ -1,4 +1,4 @@
|
||||
package org.baeldung.spring43.defaultmethods;
|
||||
package com.baeldung.spring43.defaultmethods;
|
||||
|
||||
import javax.sql.DataSource;
|
||||
|
@ -1,4 +1,4 @@
|
||||
package org.baeldung.spring43.depresolution;
|
||||
package com.baeldung.spring43.depresolution;
|
||||
|
||||
import org.springframework.context.annotation.ComponentScan;
|
||||
import org.springframework.context.annotation.Configuration;
|
@ -1,4 +1,4 @@
|
||||
package org.baeldung.spring43.depresolution;
|
||||
package com.baeldung.spring43.depresolution;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
@ -1,4 +1,4 @@
|
||||
package org.baeldung.spring43.scopeannotations;
|
||||
package com.baeldung.spring43.scopeannotations;
|
||||
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.ComponentScan;
|
@ -1,4 +1,4 @@
|
||||
package org.baeldung.spring43.scopeannotations;
|
||||
package com.baeldung.spring43.scopeannotations;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
@ -1,4 +1,4 @@
|
||||
package org.baeldung.springvault;
|
||||
package com.baeldung.springvault;
|
||||
|
||||
public class Credentials {
|
||||
|
@ -1,16 +1,10 @@
|
||||
package org.baeldung.springvault;
|
||||
package com.baeldung.springvault;
|
||||
|
||||
import java.net.URI;
|
||||
import java.net.URISyntaxException;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Value;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.vault.authentication.TokenAuthentication;
|
||||
import org.springframework.vault.client.VaultEndpoint;
|
||||
import org.springframework.vault.core.VaultTemplate;
|
||||
import org.springframework.vault.core.env.VaultPropertySource;
|
||||
import org.springframework.vault.support.VaultResponse;
|
||||
import org.springframework.vault.support.VaultResponseSupport;
|
||||
|
||||
/**
|
@ -1,4 +1,4 @@
|
||||
package org.baeldung.springvault;
|
||||
package com.baeldung.springvault;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
@ -1,4 +1,4 @@
|
||||
package org.baeldung.springvault;
|
||||
package com.baeldung.springvault;
|
||||
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.vault.authentication.ClientAuthentication;
|
@ -1,4 +1,4 @@
|
||||
package org.baeldung.springvault;
|
||||
package com.baeldung.springvault;
|
||||
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.annotation.Import;
|
@ -1,6 +1,6 @@
|
||||
package org.baeldung;
|
||||
package com.baeldung.springvault;
|
||||
|
||||
import org.baeldung.springvault.SpringVaultApplication;
|
||||
import com.baeldung.springvault.SpringVaultApplication;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
@ -1,4 +1,4 @@
|
||||
package org.baeldung.springvault;
|
||||
package com.baeldung.springvault;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.Closeable;
|
@ -1,4 +1,4 @@
|
||||
package org.baeldung.springvault;
|
||||
package com.baeldung.springvault;
|
||||
|
||||
import org.junit.FixMethodOrder;
|
||||
import org.junit.Ignore;
|
@ -1,4 +1,4 @@
|
||||
package org.baeldung.springvault;
|
||||
package com.baeldung.springvault;
|
||||
|
||||
import java.net.URI;
|
||||
import java.net.URISyntaxException;
|
@ -2,7 +2,7 @@
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>org.baeldung.spring</groupId>
|
||||
<groupId>com.baeldung.spring</groupId>
|
||||
<artifactId>spring-webflux-amqp</artifactId>
|
||||
<version>1.0.0-SNAPSHOT</version>
|
||||
<name>spring-webflux-amqp</name>
|
||||
|
@ -1,11 +1,9 @@
|
||||
package org.baeldung.spring.amqp;
|
||||
package com.baeldung.spring.amqp;
|
||||
|
||||
import java.time.Duration;
|
||||
import java.util.Date;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
|
||||
import org.baeldung.spring.amqp.DestinationsConfig.DestinationInfo;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.amqp.core.AmqpAdmin;
|
||||
@ -29,7 +27,6 @@ import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import reactor.core.publisher.Flux;
|
||||
import reactor.core.publisher.Mono;
|
||||
import reactor.core.scheduler.Schedulers;
|
||||
|
||||
@RestController
|
||||
public class AmqpReactiveController {
|
||||
@ -105,7 +102,7 @@ public class AmqpReactiveController {
|
||||
public Mono<ResponseEntity<?>> sendMessageToQueue(@PathVariable String name, @RequestBody String payload) {
|
||||
|
||||
// Lookup exchange details
|
||||
final DestinationInfo d = destinationsConfig.getQueues()
|
||||
final DestinationsConfig.DestinationInfo d = destinationsConfig.getQueues()
|
||||
.get(name);
|
||||
|
||||
if (d == null) {
|
||||
@ -135,7 +132,7 @@ public class AmqpReactiveController {
|
||||
@GetMapping(value = "/queue/{name}", produces = MediaType.TEXT_EVENT_STREAM_VALUE)
|
||||
public Flux<?> receiveMessagesFromQueue(@PathVariable String name) {
|
||||
|
||||
DestinationInfo d = destinationsConfig.getQueues()
|
||||
DestinationsConfig.DestinationInfo d = destinationsConfig.getQueues()
|
||||
.get(name);
|
||||
|
||||
if (d == null) {
|
||||
@ -201,7 +198,7 @@ public class AmqpReactiveController {
|
||||
public Mono<ResponseEntity<?>> sendMessageToTopic(@PathVariable String name, @RequestBody String payload) {
|
||||
|
||||
// Lookup exchange details
|
||||
final DestinationInfo d = destinationsConfig.getTopics()
|
||||
final DestinationsConfig.DestinationInfo d = destinationsConfig.getTopics()
|
||||
.get(name);
|
||||
if (d == null) {
|
||||
// Destination not found.
|
||||
@ -223,7 +220,7 @@ public class AmqpReactiveController {
|
||||
@GetMapping(value = "/topic/{name}", produces = MediaType.TEXT_EVENT_STREAM_VALUE)
|
||||
public Flux<?> receiveMessagesFromTopic(@PathVariable String name) {
|
||||
|
||||
DestinationInfo d = destinationsConfig.getTopics()
|
||||
DestinationsConfig.DestinationInfo d = destinationsConfig.getTopics()
|
||||
.get(name);
|
||||
|
||||
if (d == null) {
|
||||
@ -281,7 +278,7 @@ public class AmqpReactiveController {
|
||||
|
||||
}
|
||||
|
||||
private Queue createTopicQueue(DestinationInfo destination) {
|
||||
private Queue createTopicQueue(DestinationsConfig.DestinationInfo destination) {
|
||||
|
||||
Exchange ex = ExchangeBuilder.topicExchange(destination.getExchange())
|
||||
.durable(true)
|
@ -1,59 +1,59 @@
|
||||
package org.baeldung.spring.amqp;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
|
||||
@ConfigurationProperties("destinations")
|
||||
public class DestinationsConfig {
|
||||
|
||||
|
||||
private Map<String,DestinationInfo> queues = new HashMap<>();
|
||||
|
||||
private Map<String,DestinationInfo> topics = new HashMap<>();
|
||||
|
||||
|
||||
|
||||
public Map<String, DestinationInfo> getQueues() {
|
||||
return queues;
|
||||
}
|
||||
|
||||
public void setQueues(Map<String, DestinationInfo> queues) {
|
||||
this.queues = queues;
|
||||
}
|
||||
|
||||
public Map<String, DestinationInfo> getTopics() {
|
||||
return topics;
|
||||
}
|
||||
|
||||
public void setTopics(Map<String, DestinationInfo> topics) {
|
||||
this.topics = topics;
|
||||
}
|
||||
|
||||
// DestinationInfo stores the Exchange name and routing key used
|
||||
// by our producers when posting messages
|
||||
static class DestinationInfo {
|
||||
|
||||
private String exchange;
|
||||
private String routingKey;
|
||||
|
||||
|
||||
public String getExchange() {
|
||||
return exchange;
|
||||
}
|
||||
public void setExchange(String exchange) {
|
||||
this.exchange = exchange;
|
||||
}
|
||||
public String getRoutingKey() {
|
||||
return routingKey;
|
||||
}
|
||||
public void setRoutingKey(String routingKey) {
|
||||
this.routingKey = routingKey;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
package com.baeldung.spring.amqp;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
import org.springframework.boot.context.properties.ConfigurationProperties;
|
||||
|
||||
@ConfigurationProperties("destinations")
|
||||
public class DestinationsConfig {
|
||||
|
||||
|
||||
private Map<String,DestinationInfo> queues = new HashMap<>();
|
||||
|
||||
private Map<String,DestinationInfo> topics = new HashMap<>();
|
||||
|
||||
|
||||
|
||||
public Map<String, DestinationInfo> getQueues() {
|
||||
return queues;
|
||||
}
|
||||
|
||||
public void setQueues(Map<String, DestinationInfo> queues) {
|
||||
this.queues = queues;
|
||||
}
|
||||
|
||||
public Map<String, DestinationInfo> getTopics() {
|
||||
return topics;
|
||||
}
|
||||
|
||||
public void setTopics(Map<String, DestinationInfo> topics) {
|
||||
this.topics = topics;
|
||||
}
|
||||
|
||||
// DestinationInfo stores the Exchange name and routing key used
|
||||
// by our producers when posting messages
|
||||
static class DestinationInfo {
|
||||
|
||||
private String exchange;
|
||||
private String routingKey;
|
||||
|
||||
|
||||
public String getExchange() {
|
||||
return exchange;
|
||||
}
|
||||
public void setExchange(String exchange) {
|
||||
this.exchange = exchange;
|
||||
}
|
||||
public String getRoutingKey() {
|
||||
return routingKey;
|
||||
}
|
||||
public void setRoutingKey(String routingKey) {
|
||||
this.routingKey = routingKey;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
@ -1,4 +1,4 @@
|
||||
package org.baeldung.spring.amqp;
|
||||
package com.baeldung.spring.amqp;
|
||||
|
||||
import org.springframework.amqp.core.AcknowledgeMode;
|
||||
import org.springframework.amqp.rabbit.connection.ConnectionFactory;
|
@ -1,4 +1,4 @@
|
||||
package org.baeldung.spring.amqp;
|
||||
package com.baeldung.spring.amqp;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
@ -1,6 +1,6 @@
|
||||
package org.baeldung;
|
||||
package com.baeldung;
|
||||
|
||||
import org.baeldung.spring.amqp.SpringWebfluxAmqpApplication;
|
||||
import com.baeldung.spring.amqp.SpringWebfluxAmqpApplication;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
@ -1,4 +1,4 @@
|
||||
package org.baeldung.spring.amqp;
|
||||
package com.baeldung.spring.amqp;
|
||||
|
||||
import org.junit.Test;
|
||||
import org.springframework.test.web.reactive.server.WebTestClient;
|
Loading…
x
Reference in New Issue
Block a user