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:
Josh Cummings 2019-12-27 21:59:14 -07:00 committed by GitHub
commit b557a478d1
57 changed files with 129 additions and 138 deletions

View File

@ -1,4 +1,4 @@
package org.baeldung.spring43.attributeannotations; package com.baeldung.spring43.attributeannotations;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;

View File

@ -1,4 +1,4 @@
package org.baeldung.spring43.attributeannotations; package com.baeldung.spring43.attributeannotations;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;

View File

@ -1,4 +1,4 @@
package org.baeldung.spring43.cache; package com.baeldung.spring43.cache;
import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicInteger;

View File

@ -1,4 +1,4 @@
package org.baeldung.spring43.cache; package com.baeldung.spring43.cache;
import org.springframework.cache.annotation.Cacheable; import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;

View File

@ -0,0 +1,5 @@
package com.baeldung.spring43.composedmapping;
public class Appointment {
}

View File

@ -1,4 +1,4 @@
package org.baeldung.spring43.composedmapping; package com.baeldung.spring43.composedmapping;
import java.util.Map; import java.util.Map;

View File

@ -1,4 +1,4 @@
package org.baeldung.spring43.composedmapping; package com.baeldung.spring43.composedmapping;
import java.util.Map; import java.util.Map;

View File

@ -0,0 +1,5 @@
package com.baeldung.spring43.ctor;
public class FooRepository {
}

View File

@ -1,4 +1,4 @@
package org.baeldung.spring43.ctor; package com.baeldung.spring43.ctor;
public class FooService { public class FooService {

View File

@ -1,4 +1,4 @@
package org.baeldung.spring43.defaultmethods; package com.baeldung.spring43.defaultmethods;
import java.time.LocalDate; import java.time.LocalDate;

View File

@ -1,4 +1,4 @@
package org.baeldung.spring43.defaultmethods; package com.baeldung.spring43.defaultmethods;
import java.time.LocalDate; import java.time.LocalDate;
import java.time.format.DateTimeFormatter; import java.time.format.DateTimeFormatter;

View File

@ -1,4 +1,4 @@
package org.baeldung.spring43.depresolution; package com.baeldung.spring43.depresolution;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;

View File

@ -1,4 +1,4 @@
package org.baeldung.spring43.depresolution; package com.baeldung.spring43.depresolution;
import org.springframework.beans.factory.ObjectProvider; import org.springframework.beans.factory.ObjectProvider;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;

View File

@ -1,4 +1,4 @@
package org.baeldung.spring43.scopeannotations; package com.baeldung.spring43.scopeannotations;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import org.springframework.web.context.annotation.ApplicationScope; import org.springframework.web.context.annotation.ApplicationScope;

View File

@ -1,4 +1,4 @@
package org.baeldung.spring43.scopeannotations; package com.baeldung.spring43.scopeannotations;
import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicInteger;

View File

@ -1,4 +1,4 @@
package org.baeldung.spring43.scopeannotations; package com.baeldung.spring43.scopeannotations;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import org.springframework.web.context.annotation.RequestScope; import org.springframework.web.context.annotation.RequestScope;

View File

@ -1,4 +1,4 @@
package org.baeldung.spring43.scopeannotations; package com.baeldung.spring43.scopeannotations;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;

View File

@ -1,4 +1,4 @@
package org.baeldung.spring43.scopeannotations; package com.baeldung.spring43.scopeannotations;
import org.springframework.stereotype.Component; import org.springframework.stereotype.Component;
import org.springframework.web.context.annotation.SessionScope; import org.springframework.web.context.annotation.SessionScope;

View File

@ -1,5 +0,0 @@
package org.baeldung.spring43.composedmapping;
public class Appointment {
}

View File

@ -1,5 +0,0 @@
package org.baeldung.spring43.ctor;
public class FooRepository {
}

View File

@ -3,7 +3,7 @@
xmlns="http://www.springframework.org/schema/beans" xmlns="http://www.springframework.org/schema/beans"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd"> 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"/> <property name="stringDate" value="15.10.1982"/>
</bean> </bean>

View File

@ -3,8 +3,8 @@
xmlns="http://www.springframework.org/schema/beans" xmlns="http://www.springframework.org/schema/beans"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd"> 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> </beans>

View File

@ -1,4 +1,4 @@
package org.baeldung; package com.baeldung;
import org.junit.Test; import org.junit.Test;
import org.junit.runner.RunWith; import org.junit.runner.RunWith;

View File

@ -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.Bean;
import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.ComponentScan;

View File

@ -1,4 +1,4 @@
package org.baeldung.spring43.attributeannotations; package com.baeldung.spring43.attributeannotations;
import org.junit.Assert; import org.junit.Assert;
import org.junit.Before; import org.junit.Before;

View File

@ -1,4 +1,4 @@
package org.baeldung.spring43.cache; package com.baeldung.spring43.cache;
import java.util.Collections; import java.util.Collections;

View File

@ -1,4 +1,4 @@
package org.baeldung.spring43.cache; package com.baeldung.spring43.cache;
import java.util.concurrent.ExecutorService; import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors; import java.util.concurrent.Executors;

View File

@ -1,4 +1,4 @@
package org.baeldung.spring43.composedmapping; package com.baeldung.spring43.composedmapping;
import java.util.Collections; import java.util.Collections;

View File

@ -1,4 +1,4 @@
package org.baeldung.spring43.composedmapping; package com.baeldung.spring43.composedmapping;
import org.junit.Before; import org.junit.Before;
import org.junit.Test; import org.junit.Test;

View File

@ -1,4 +1,4 @@
package org.baeldung.spring43.ctor; package com.baeldung.spring43.ctor;
import org.junit.Test; import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;

View File

@ -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.Bean;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;

View File

@ -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.Bean;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;

View File

@ -1,4 +1,4 @@
package org.baeldung.spring43.ctor; package com.baeldung.spring43.ctor;
import org.junit.Test; import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;

View File

@ -1,4 +1,4 @@
package org.baeldung.spring43.defaultmethods; package com.baeldung.spring43.defaultmethods;
import java.time.LocalDate; import java.time.LocalDate;

View File

@ -1,4 +1,4 @@
package org.baeldung.spring43.defaultmethods; package com.baeldung.spring43.defaultmethods;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;

View File

@ -1,4 +1,4 @@
package org.baeldung.spring43.defaultmethods; package com.baeldung.spring43.defaultmethods;
import org.junit.Test; import org.junit.Test;
import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.ContextConfiguration;

View File

@ -1,4 +1,4 @@
package org.baeldung.spring43.defaultmethods; package com.baeldung.spring43.defaultmethods;
import javax.sql.DataSource; import javax.sql.DataSource;

View File

@ -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.ComponentScan;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;

View File

@ -1,4 +1,4 @@
package org.baeldung.spring43.depresolution; package com.baeldung.spring43.depresolution;
import org.junit.Test; import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;

View File

@ -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.Bean;
import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.ComponentScan;

View File

@ -1,4 +1,4 @@
package org.baeldung.spring43.scopeannotations; package com.baeldung.spring43.scopeannotations;
import org.junit.Before; import org.junit.Before;
import org.junit.Test; import org.junit.Test;

View File

@ -1,4 +1,4 @@
package org.baeldung.springvault; package com.baeldung.springvault;
public class Credentials { public class Credentials {

View File

@ -1,16 +1,10 @@
package org.baeldung.springvault; package com.baeldung.springvault;
import java.net.URI;
import java.net.URISyntaxException; import java.net.URISyntaxException;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service; 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.VaultTemplate;
import org.springframework.vault.core.env.VaultPropertySource;
import org.springframework.vault.support.VaultResponse;
import org.springframework.vault.support.VaultResponseSupport; import org.springframework.vault.support.VaultResponseSupport;
/** /**

View File

@ -1,4 +1,4 @@
package org.baeldung.springvault; package com.baeldung.springvault;
import org.springframework.boot.SpringApplication; import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.SpringBootApplication;

View File

@ -1,4 +1,4 @@
package org.baeldung.springvault; package com.baeldung.springvault;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import org.springframework.vault.authentication.ClientAuthentication; import org.springframework.vault.authentication.ClientAuthentication;

View File

@ -1,4 +1,4 @@
package org.baeldung.springvault; package com.baeldung.springvault;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Import; import org.springframework.context.annotation.Import;

View File

@ -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.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;

View File

@ -1,4 +1,4 @@
package org.baeldung.springvault; package com.baeldung.springvault;
import java.io.BufferedReader; import java.io.BufferedReader;
import java.io.Closeable; import java.io.Closeable;

View File

@ -1,4 +1,4 @@
package org.baeldung.springvault; package com.baeldung.springvault;
import org.junit.FixMethodOrder; import org.junit.FixMethodOrder;
import org.junit.Ignore; import org.junit.Ignore;

View File

@ -1,4 +1,4 @@
package org.baeldung.springvault; package com.baeldung.springvault;
import java.net.URI; import java.net.URI;
import java.net.URISyntaxException; import java.net.URISyntaxException;

View File

@ -2,7 +2,7 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" <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"> 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> <modelVersion>4.0.0</modelVersion>
<groupId>org.baeldung.spring</groupId> <groupId>com.baeldung.spring</groupId>
<artifactId>spring-webflux-amqp</artifactId> <artifactId>spring-webflux-amqp</artifactId>
<version>1.0.0-SNAPSHOT</version> <version>1.0.0-SNAPSHOT</version>
<name>spring-webflux-amqp</name> <name>spring-webflux-amqp</name>

View File

@ -1,11 +1,9 @@
package org.baeldung.spring.amqp; package com.baeldung.spring.amqp;
import java.time.Duration; import java.time.Duration;
import java.util.Date;
import javax.annotation.PostConstruct; import javax.annotation.PostConstruct;
import org.baeldung.spring.amqp.DestinationsConfig.DestinationInfo;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.amqp.core.AmqpAdmin; 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.Flux;
import reactor.core.publisher.Mono; import reactor.core.publisher.Mono;
import reactor.core.scheduler.Schedulers;
@RestController @RestController
public class AmqpReactiveController { public class AmqpReactiveController {
@ -105,7 +102,7 @@ public class AmqpReactiveController {
public Mono<ResponseEntity<?>> sendMessageToQueue(@PathVariable String name, @RequestBody String payload) { public Mono<ResponseEntity<?>> sendMessageToQueue(@PathVariable String name, @RequestBody String payload) {
// Lookup exchange details // Lookup exchange details
final DestinationInfo d = destinationsConfig.getQueues() final DestinationsConfig.DestinationInfo d = destinationsConfig.getQueues()
.get(name); .get(name);
if (d == null) { if (d == null) {
@ -135,7 +132,7 @@ public class AmqpReactiveController {
@GetMapping(value = "/queue/{name}", produces = MediaType.TEXT_EVENT_STREAM_VALUE) @GetMapping(value = "/queue/{name}", produces = MediaType.TEXT_EVENT_STREAM_VALUE)
public Flux<?> receiveMessagesFromQueue(@PathVariable String name) { public Flux<?> receiveMessagesFromQueue(@PathVariable String name) {
DestinationInfo d = destinationsConfig.getQueues() DestinationsConfig.DestinationInfo d = destinationsConfig.getQueues()
.get(name); .get(name);
if (d == null) { if (d == null) {
@ -201,7 +198,7 @@ public class AmqpReactiveController {
public Mono<ResponseEntity<?>> sendMessageToTopic(@PathVariable String name, @RequestBody String payload) { public Mono<ResponseEntity<?>> sendMessageToTopic(@PathVariable String name, @RequestBody String payload) {
// Lookup exchange details // Lookup exchange details
final DestinationInfo d = destinationsConfig.getTopics() final DestinationsConfig.DestinationInfo d = destinationsConfig.getTopics()
.get(name); .get(name);
if (d == null) { if (d == null) {
// Destination not found. // Destination not found.
@ -223,7 +220,7 @@ public class AmqpReactiveController {
@GetMapping(value = "/topic/{name}", produces = MediaType.TEXT_EVENT_STREAM_VALUE) @GetMapping(value = "/topic/{name}", produces = MediaType.TEXT_EVENT_STREAM_VALUE)
public Flux<?> receiveMessagesFromTopic(@PathVariable String name) { public Flux<?> receiveMessagesFromTopic(@PathVariable String name) {
DestinationInfo d = destinationsConfig.getTopics() DestinationsConfig.DestinationInfo d = destinationsConfig.getTopics()
.get(name); .get(name);
if (d == null) { 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()) Exchange ex = ExchangeBuilder.topicExchange(destination.getExchange())
.durable(true) .durable(true)

View File

@ -1,4 +1,4 @@
package org.baeldung.spring.amqp; package com.baeldung.spring.amqp;
import java.util.HashMap; import java.util.HashMap;
import java.util.Map; import java.util.Map;

View File

@ -1,4 +1,4 @@
package org.baeldung.spring.amqp; package com.baeldung.spring.amqp;
import org.springframework.amqp.core.AcknowledgeMode; import org.springframework.amqp.core.AcknowledgeMode;
import org.springframework.amqp.rabbit.connection.ConnectionFactory; import org.springframework.amqp.rabbit.connection.ConnectionFactory;

View File

@ -1,4 +1,4 @@
package org.baeldung.spring.amqp; package com.baeldung.spring.amqp;
import org.springframework.boot.SpringApplication; import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.SpringBootApplication;

View File

@ -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.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;

View File

@ -1,4 +1,4 @@
package org.baeldung.spring.amqp; package com.baeldung.spring.amqp;
import org.junit.Test; import org.junit.Test;
import org.springframework.test.web.reactive.server.WebTestClient; import org.springframework.test.web.reactive.server.WebTestClient;