Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
S
spring-boot
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
DEMO
spring-boot
Commits
48534770
Commit
48534770
authored
May 24, 2018
by
Phillip Webb
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reformat code
parent
625f428a
Changes
95
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
95 changed files
with
321 additions
and
130 deletions
+321
-130
JerseyAutoConfiguration.java
...rk/boot/autoconfigure/jersey/JerseyAutoConfiguration.java
+29
-16
KafkaProperties.java
...ngframework/boot/autoconfigure/kafka/KafkaProperties.java
+67
-41
JerseyAutoConfigurationCustomApplicationTests.java
...jersey/JerseyAutoConfigurationCustomApplicationTests.java
+6
-5
SampleAntApplicationIT.java
...-ant/src/test/java/sample/ant/SampleAntApplicationIT.java
+5
-3
City.java
...e-data-jpa/src/main/java/sample/data/jpa/domain/City.java
+2
-1
Hotel.java
...-data-jpa/src/main/java/sample/data/jpa/domain/Hotel.java
+2
-1
Rating.java
...data-jpa/src/main/java/sample/data/jpa/domain/Rating.java
+3
-1
Review.java
...data-jpa/src/main/java/sample/data/jpa/domain/Review.java
+2
-1
ReviewDetails.java
...a/src/main/java/sample/data/jpa/domain/ReviewDetails.java
+2
-1
TripType.java
...ta-jpa/src/main/java/sample/data/jpa/domain/TripType.java
+3
-1
CitySearchCriteria.java
...main/java/sample/data/jpa/service/CitySearchCriteria.java
+2
-1
CityServiceImpl.java
...rc/main/java/sample/data/jpa/service/CityServiceImpl.java
+2
-1
HotelServiceImpl.java
...c/main/java/sample/data/jpa/service/HotelServiceImpl.java
+3
-1
CityRepositoryIntegrationTests.java
...mple/data/jpa/service/CityRepositoryIntegrationTests.java
+2
-1
HotelRepositoryIntegrationTests.java
...ple/data/jpa/service/HotelRepositoryIntegrationTests.java
+1
-0
Customer.java
...ata-mongodb/src/main/java/sample/data/mongo/Customer.java
+2
-1
Customer.java
...-data-neo4j/src/main/java/sample/data/neo4j/Customer.java
+2
-1
City.java
...data-rest/src/main/java/sample/data/rest/domain/City.java
+2
-1
Hotel.java
...ata-rest/src/main/java/sample/data/rest/domain/Hotel.java
+2
-1
CitySearchCriteria.java
...ain/java/sample/data/rest/service/CitySearchCriteria.java
+2
-1
SampleDataRestApplicationTests.java
...java/sample/data/rest/SampleDataRestApplicationTests.java
+1
-0
CityRepositoryIntegrationTests.java
...ple/data/rest/service/CityRepositoryIntegrationTests.java
+2
-1
Person.java
...oot-sample-flyway/src/main/java/sample/flyway/Person.java
+5
-1
City.java
...bernate4/src/main/java/sample/hibernate4/domain/City.java
+2
-1
Hotel.java
...ernate4/src/main/java/sample/hibernate4/domain/Hotel.java
+2
-1
Rating.java
...rnate4/src/main/java/sample/hibernate4/domain/Rating.java
+3
-1
Review.java
...rnate4/src/main/java/sample/hibernate4/domain/Review.java
+2
-1
ReviewDetails.java
...src/main/java/sample/hibernate4/domain/ReviewDetails.java
+2
-1
TripType.java
...ate4/src/main/java/sample/hibernate4/domain/TripType.java
+3
-1
CitySearchCriteria.java
...in/java/sample/hibernate4/service/CitySearchCriteria.java
+2
-1
CityServiceImpl.java
.../main/java/sample/hibernate4/service/CityServiceImpl.java
+2
-1
HotelServiceImpl.java
...main/java/sample/hibernate4/service/HotelServiceImpl.java
+3
-1
CityRepositoryIntegrationTests.java
...le/hibernate4/service/CityRepositoryIntegrationTests.java
+2
-1
HotelRepositoryIntegrationTests.java
...e/hibernate4/service/HotelRepositoryIntegrationTests.java
+3
-1
City.java
...rnate52/src/main/java/sample/hibernate52/domain/City.java
+2
-1
Hotel.java
...nate52/src/main/java/sample/hibernate52/domain/Hotel.java
+2
-1
Rating.java
...ate52/src/main/java/sample/hibernate52/domain/Rating.java
+3
-1
Review.java
...ate52/src/main/java/sample/hibernate52/domain/Review.java
+2
-1
ReviewDetails.java
...rc/main/java/sample/hibernate52/domain/ReviewDetails.java
+2
-1
TripType.java
...e52/src/main/java/sample/hibernate52/domain/TripType.java
+3
-1
CitySearchCriteria.java
...n/java/sample/hibernate52/service/CitySearchCriteria.java
+2
-1
CityServiceImpl.java
...main/java/sample/hibernate52/service/CityServiceImpl.java
+2
-1
HotelServiceImpl.java
...ain/java/sample/hibernate52/service/HotelServiceImpl.java
+3
-1
CityRepositoryIntegrationTests.java
...e/hibernate52/service/CityRepositoryIntegrationTests.java
+2
-1
HotelRepositoryIntegrationTests.java
.../hibernate52/service/HotelRepositoryIntegrationTests.java
+3
-1
SampleHypermediaUiSecureApplicationTests.java
...a/ui/secure/SampleHypermediaUiSecureApplicationTests.java
+2
-1
SampleHypermediaUiApplication.java
...a/sample/hypermedia/ui/SampleHypermediaUiApplication.java
+2
-1
SampleIntegrationApplicationTests.java
...tegration/consumer/SampleIntegrationApplicationTests.java
+2
-1
JooqExamples.java
...t-sample-jooq/src/main/java/sample/jooq/JooqExamples.java
+2
-1
SampleLiquibaseApplicationTests.java
...ava/sample/liquibase/SampleLiquibaseApplicationTests.java
+2
-1
SampleController.java
...c/main/java/sample/metrics/opentsdb/SampleController.java
+2
-1
SampleController.java
.../src/main/java/sample/metrics/redis/SampleController.java
+2
-1
SampleIntegrationParentApplicationTests.java
...ent/consumer/SampleIntegrationParentApplicationTests.java
+2
-1
SampleSecureApplicationTests.java
...test/java/sample/secure/SampleSecureApplicationTests.java
+2
-1
SampleServletApplicationTests.java
...st/java/sample/servlet/SampleServletApplicationTests.java
+2
-1
VehicleIdentificationNumberNotFoundException.java
...service/VehicleIdentificationNumberNotFoundException.java
+2
-1
SampleTomcatTwoConnectorsApplicationTests.java
...iconnector/SampleTomcatTwoConnectorsApplicationTests.java
+2
-1
WebConfig.java
...al/src/main/java/sample/traditional/config/WebConfig.java
+2
-1
Message.java
...mplates/src/main/java/sample/groovytemplates/Message.java
+2
-1
Message.java
...ymeleaf3/src/main/java/sample/web/thymeleaf3/Message.java
+2
-1
MessageControllerWebTests.java
...java/sample/web/thymeleaf3/MessageControllerWebTests.java
+4
-1
Message.java
...ot-sample-web-ui/src/main/java/sample/web/ui/Message.java
+2
-1
MessageControllerWebTests.java
...rc/test/java/sample/web/ui/MessageControllerWebTests.java
+4
-1
ReverseWebSocketEndpoint.java
...les/websocket/jetty/reverse/ReverseWebSocketEndpoint.java
+2
-1
Direction.java
...rc/main/java/samples/websocket/jetty/snake/Direction.java
+2
-0
Location.java
...src/main/java/samples/websocket/jetty/snake/Location.java
+5
-0
Snake.java
...ty/src/main/java/samples/websocket/jetty/snake/Snake.java
+1
-0
SnakeTimer.java
...c/main/java/samples/websocket/jetty/snake/SnakeTimer.java
+1
-0
SnakeUtils.java
...c/main/java/samples/websocket/jetty/snake/SnakeUtils.java
+2
-0
SnakeWebSocketHandler.java
.../samples/websocket/jetty/snake/SnakeWebSocketHandler.java
+5
-0
SampleWebSocketsApplicationTests.java
...les/websocket/jetty/SampleWebSocketsApplicationTests.java
+2
-1
ReverseWebSocketEndpoint.java
...s/websocket/jetty93/reverse/ReverseWebSocketEndpoint.java
+2
-1
Direction.java
.../main/java/samples/websocket/jetty93/snake/Direction.java
+2
-0
Location.java
...c/main/java/samples/websocket/jetty93/snake/Location.java
+5
-0
Snake.java
.../src/main/java/samples/websocket/jetty93/snake/Snake.java
+1
-0
SnakeTimer.java
...main/java/samples/websocket/jetty93/snake/SnakeTimer.java
+1
-0
SnakeUtils.java
...main/java/samples/websocket/jetty93/snake/SnakeUtils.java
+2
-0
SnakeWebSocketHandler.java
...amples/websocket/jetty93/snake/SnakeWebSocketHandler.java
+5
-0
SampleWebSocketsApplicationTests.java
...s/websocket/jetty93/SampleWebSocketsApplicationTests.java
+2
-1
ReverseWebSocketEndpoint.java
...es/websocket/tomcat/reverse/ReverseWebSocketEndpoint.java
+2
-1
Direction.java
...c/main/java/samples/websocket/tomcat/snake/Direction.java
+2
-0
Location.java
...rc/main/java/samples/websocket/tomcat/snake/Location.java
+5
-0
Snake.java
...t/src/main/java/samples/websocket/tomcat/snake/Snake.java
+1
-0
SnakeTimer.java
.../main/java/samples/websocket/tomcat/snake/SnakeTimer.java
+1
-0
SnakeUtils.java
.../main/java/samples/websocket/tomcat/snake/SnakeUtils.java
+2
-0
SnakeWebSocketHandler.java
...samples/websocket/tomcat/snake/SnakeWebSocketHandler.java
+5
-0
SnakeTimerTests.java
.../java/samples/websocket/tomcat/snake/SnakeTimerTests.java
+2
-1
ReverseWebSocketEndpoint.java
.../websocket/undertow/reverse/ReverseWebSocketEndpoint.java
+2
-1
Direction.java
...main/java/samples/websocket/undertow/snake/Direction.java
+2
-0
Location.java
.../main/java/samples/websocket/undertow/snake/Location.java
+5
-0
Snake.java
...src/main/java/samples/websocket/undertow/snake/Snake.java
+1
-0
SnakeTimer.java
...ain/java/samples/websocket/undertow/snake/SnakeTimer.java
+1
-0
SnakeUtils.java
...ain/java/samples/websocket/undertow/snake/SnakeUtils.java
+2
-0
SnakeWebSocketHandler.java
...mples/websocket/undertow/snake/SnakeWebSocketHandler.java
+5
-0
SnakeTimerTests.java
...ava/samples/websocket/undertow/snake/SnakeTimerTests.java
+2
-1
No files found.
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jersey/JerseyAutoConfiguration.java
View file @
48534770
...
...
@@ -117,8 +117,8 @@ public class JerseyAutoConfiguration implements ServletContextAware {
this
.
path
=
parseApplicationPath
(
this
.
jersey
.
getApplicationPath
());
}
else
{
this
.
path
=
findApplicationPath
(
AnnotationUtils
.
findAnnotation
(
this
.
config
.
getApplication
().
getClass
(),
ApplicationPath
.
class
));
this
.
path
=
findApplicationPath
(
AnnotationUtils
.
findAnnotation
(
this
.
config
.
getApplication
().
getClass
(),
ApplicationPath
.
class
));
}
}
...
...
@@ -149,7 +149,8 @@ public class JerseyAutoConfiguration implements ServletContextAware {
registration
.
setFilter
(
new
ServletContainer
(
this
.
config
));
registration
.
setUrlPatterns
(
Arrays
.
asList
(
this
.
path
));
registration
.
setOrder
(
this
.
jersey
.
getFilter
().
getOrder
());
registration
.
addInitParameter
(
ServletProperties
.
FILTER_CONTEXT_PATH
,
stripPattern
(
this
.
path
));
registration
.
addInitParameter
(
ServletProperties
.
FILTER_CONTEXT_PATH
,
stripPattern
(
this
.
path
));
addInitParameters
(
registration
);
registration
.
setName
(
"jerseyFilter"
);
registration
.
setDispatcherTypes
(
EnumSet
.
allOf
(
DispatcherType
.
class
));
...
...
@@ -167,8 +168,8 @@ public class JerseyAutoConfiguration implements ServletContextAware {
@ConditionalOnMissingBean
(
name
=
"jerseyServletRegistration"
)
@ConditionalOnProperty
(
prefix
=
"spring.jersey"
,
name
=
"type"
,
havingValue
=
"servlet"
,
matchIfMissing
=
true
)
public
ServletRegistrationBean
jerseyServletRegistration
()
{
ServletRegistrationBean
registration
=
new
ServletRegistrationBean
(
new
ServletContainer
(
this
.
config
),
this
.
path
);
ServletRegistrationBean
registration
=
new
ServletRegistrationBean
(
new
ServletContainer
(
this
.
config
),
this
.
path
);
addInitParameters
(
registration
);
registration
.
setName
(
getServletRegistrationName
());
registration
.
setLoadOnStartup
(
this
.
jersey
.
getServlet
().
getLoadOnStartup
());
...
...
@@ -203,18 +204,23 @@ public class JerseyAutoConfiguration implements ServletContextAware {
@Override
public
void
setServletContext
(
ServletContext
servletContext
)
{
String
servletRegistrationName
=
getServletRegistrationName
();
ServletRegistration
registration
=
servletContext
.
getServletRegistration
(
servletRegistrationName
);
ServletRegistration
registration
=
servletContext
.
getServletRegistration
(
servletRegistrationName
);
if
(
registration
!=
null
)
{
if
(
logger
.
isInfoEnabled
())
{
logger
.
info
(
"Configuring existing registration for Jersey servlet '"
+
servletRegistrationName
+
"'"
);
logger
.
info
(
"Configuring existing registration for Jersey servlet '"
+
servletRegistrationName
+
"'"
);
}
registration
.
setInitParameters
(
this
.
jersey
.
getInit
());
registration
.
setInitParameter
(
CommonProperties
.
METAINF_SERVICES_LOOKUP_DISABLE
,
Boolean
.
TRUE
.
toString
());
registration
.
setInitParameter
(
CommonProperties
.
METAINF_SERVICES_LOOKUP_DISABLE
,
Boolean
.
TRUE
.
toString
());
}
}
@Order
(
Ordered
.
HIGHEST_PRECEDENCE
)
public
static
final
class
JerseyWebApplicationInitializer
implements
WebApplicationInitializer
{
public
static
final
class
JerseyWebApplicationInitializer
implements
WebApplicationInitializer
{
@Override
public
void
onStartup
(
ServletContext
servletContext
)
throws
ServletException
{
...
...
@@ -233,19 +239,22 @@ public class JerseyAutoConfiguration implements ServletContextAware {
private
static
final
String
JAXB_ANNOTATION_INTROSPECTOR_CLASS_NAME
=
"com.fasterxml.jackson.module.jaxb.JaxbAnnotationIntrospector"
;
@Bean
public
ResourceConfigCustomizer
resourceConfigCustomizer
(
final
ObjectMapper
objectMapper
)
{
public
ResourceConfigCustomizer
resourceConfigCustomizer
(
final
ObjectMapper
objectMapper
)
{
addJaxbAnnotationIntrospectorIfPresent
(
objectMapper
);
return
new
ResourceConfigCustomizer
()
{
@Override
public
void
customize
(
ResourceConfig
config
)
{
config
.
register
(
JacksonFeature
.
class
);
config
.
register
(
new
ObjectMapperContextResolver
(
objectMapper
),
ContextResolver
.
class
);
config
.
register
(
new
ObjectMapperContextResolver
(
objectMapper
),
ContextResolver
.
class
);
}
};
}
private
void
addJaxbAnnotationIntrospectorIfPresent
(
ObjectMapper
objectMapper
)
{
if
(
ClassUtils
.
isPresent
(
JAXB_ANNOTATION_INTROSPECTOR_CLASS_NAME
,
getClass
().
getClassLoader
()))
{
if
(
ClassUtils
.
isPresent
(
JAXB_ANNOTATION_INTROSPECTOR_CLASS_NAME
,
getClass
().
getClassLoader
()))
{
new
ObjectMapperCustomizer
().
addJaxbAnnotationIntrospector
(
objectMapper
);
}
}
...
...
@@ -256,18 +265,22 @@ public class JerseyAutoConfiguration implements ServletContextAware {
JaxbAnnotationIntrospector
jaxbAnnotationIntrospector
=
new
JaxbAnnotationIntrospector
(
objectMapper
.
getTypeFactory
());
objectMapper
.
setAnnotationIntrospectors
(
createPair
(
objectMapper
.
getSerializationConfig
(),
jaxbAnnotationIntrospector
),
createPair
(
objectMapper
.
getDeserializationConfig
(),
jaxbAnnotationIntrospector
));
createPair
(
objectMapper
.
getSerializationConfig
(),
jaxbAnnotationIntrospector
),
createPair
(
objectMapper
.
getDeserializationConfig
(),
jaxbAnnotationIntrospector
));
}
private
AnnotationIntrospector
createPair
(
MapperConfig
<?>
config
,
JaxbAnnotationIntrospector
jaxbAnnotationIntrospector
)
{
return
AnnotationIntrospector
.
pair
(
config
.
getAnnotationIntrospector
(),
jaxbAnnotationIntrospector
);
return
AnnotationIntrospector
.
pair
(
config
.
getAnnotationIntrospector
(),
jaxbAnnotationIntrospector
);
}
}
private
static
final
class
ObjectMapperContextResolver
implements
ContextResolver
<
ObjectMapper
>
{
private
static
final
class
ObjectMapperContextResolver
implements
ContextResolver
<
ObjectMapper
>
{
private
final
ObjectMapper
objectMapper
;
...
...
spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/kafka/KafkaProperties.java
View file @
48534770
This diff is collapsed.
Click to expand it.
spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jersey/JerseyAutoConfigurationCustomApplicationTests.java
View file @
48534770
...
...
@@ -43,8 +43,7 @@ import org.springframework.test.context.junit4.SpringRunner;
import
static
org
.
assertj
.
core
.
api
.
Assertions
.
assertThat
;
/**
* Tests for {@link JerseyAutoConfiguration} when using a custom
* {@link Application}.
* Tests for {@link JerseyAutoConfiguration} when using a custom {@link Application}.
*
* @author Stephane Nicoll
*/
...
...
@@ -58,7 +57,8 @@ public class JerseyAutoConfigurationCustomApplicationTests {
@Test
public
void
contextLoads
()
{
ResponseEntity
<
String
>
entity
=
this
.
restTemplate
.
getForEntity
(
"/test/hello"
,
String
.
class
);
ResponseEntity
<
String
>
entity
=
this
.
restTemplate
.
getForEntity
(
"/test/hello"
,
String
.
class
);
assertThat
(
entity
.
getStatusCode
()).
isEqualTo
(
HttpStatus
.
OK
);
}
...
...
@@ -78,8 +78,9 @@ public class JerseyAutoConfigurationCustomApplicationTests {
}
@Configuration
@Import
({
EmbeddedServletContainerAutoConfiguration
.
class
,
ServerPropertiesAutoConfiguration
.
class
,
JerseyAutoConfiguration
.
class
,
PropertyPlaceholderAutoConfiguration
.
class
})
@Import
({
EmbeddedServletContainerAutoConfiguration
.
class
,
ServerPropertiesAutoConfiguration
.
class
,
JerseyAutoConfiguration
.
class
,
PropertyPlaceholderAutoConfiguration
.
class
})
static
class
TestConfiguration
{
@Configuration
...
...
spring-boot-samples/spring-boot-sample-ant/src/test/java/sample/ant/SampleAntApplicationIT.java
View file @
48534770
/*
* Copyright 2012-201
6
the original author or authors.
* Copyright 2012-201
8
the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
@@ -47,10 +47,12 @@ public class SampleAntApplicationIT {
});
assertThat
(
jarFiles
).
hasSize
(
1
);
Process
process
=
new
JavaExecutable
().
processBuilder
(
"-jar"
,
jarFiles
[
0
].
getName
()).
directory
(
target
).
start
();
Process
process
=
new
JavaExecutable
()
.
processBuilder
(
"-jar"
,
jarFiles
[
0
].
getName
()).
directory
(
target
).
start
();
process
.
waitFor
(
5
,
TimeUnit
.
MINUTES
);
assertThat
(
process
.
exitValue
()).
isEqualTo
(
0
);
String
output
=
FileCopyUtils
.
copyToString
(
new
InputStreamReader
(
process
.
getInputStream
()));
String
output
=
FileCopyUtils
.
copyToString
(
new
InputStreamReader
(
process
.
getInputStream
()));
assertThat
(
output
).
contains
(
"Spring Boot Ant Example"
);
}
...
...
spring-boot-samples/spring-boot-sample-data-jpa/src/main/java/sample/data/jpa/domain/City.java
View file @
48534770
/*
* Copyright 2012-201
3
the original author or authors.
* Copyright 2012-201
8
the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
@@ -73,4 +73,5 @@ public class City implements Serializable {
public
String
toString
()
{
return
getName
()
+
","
+
getState
()
+
","
+
getCountry
();
}
}
spring-boot-samples/spring-boot-sample-data-jpa/src/main/java/sample/data/jpa/domain/Hotel.java
View file @
48534770
/*
* Copyright 2012-201
3
the original author or authors.
* Copyright 2012-201
8
the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
@@ -78,4 +78,5 @@ public class Hotel implements Serializable {
public
String
getZip
()
{
return
this
.
zip
;
}
}
spring-boot-samples/spring-boot-sample-data-jpa/src/main/java/sample/data/jpa/domain/Rating.java
View file @
48534770
/*
* Copyright 2012-201
3
the original author or authors.
* Copyright 2012-201
8
the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
@@ -17,5 +17,7 @@
package
sample
.
data
.
jpa
.
domain
;
public
enum
Rating
{
TERRIBLE
,
POOR
,
AVERAGE
,
GOOD
,
EXCELLENT
,
}
spring-boot-samples/spring-boot-sample-data-jpa/src/main/java/sample/data/jpa/domain/Review.java
View file @
48534770
/*
* Copyright 2012-201
3
the original author or authors.
* Copyright 2012-201
8
the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
@@ -126,4 +126,5 @@ public class Review implements Serializable {
public
void
setDetails
(
String
details
)
{
this
.
details
=
details
;
}
}
spring-boot-samples/spring-boot-sample-data-jpa/src/main/java/sample/data/jpa/domain/ReviewDetails.java
View file @
48534770
/*
* Copyright 2012-201
3
the original author or authors.
* Copyright 2012-201
8
the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
@@ -75,4 +75,5 @@ public class ReviewDetails implements Serializable {
public
void
setDetails
(
String
details
)
{
this
.
details
=
details
;
}
}
spring-boot-samples/spring-boot-sample-data-jpa/src/main/java/sample/data/jpa/domain/TripType.java
View file @
48534770
/*
* Copyright 2012-201
3
the original author or authors.
* Copyright 2012-201
8
the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
@@ -17,5 +17,7 @@
package
sample
.
data
.
jpa
.
domain
;
public
enum
TripType
{
BUSINESS
,
COUPLES
,
FAMILY
,
FRIENDS
,
SOLO
}
spring-boot-samples/spring-boot-sample-data-jpa/src/main/java/sample/data/jpa/service/CitySearchCriteria.java
View file @
48534770
/*
* Copyright 2012-201
3
the original author or authors.
* Copyright 2012-201
8
the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
@@ -41,4 +41,5 @@ public class CitySearchCriteria implements Serializable {
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
}
}
spring-boot-samples/spring-boot-sample-data-jpa/src/main/java/sample/data/jpa/service/CityServiceImpl.java
View file @
48534770
/*
* Copyright 2012-201
6
the original author or authors.
* Copyright 2012-201
8
the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
@@ -75,4 +75,5 @@ class CityServiceImpl implements CityService {
Assert
.
notNull
(
city
,
"City must not be null"
);
return
this
.
hotelRepository
.
findByCity
(
city
,
pageable
);
}
}
spring-boot-samples/spring-boot-sample-data-jpa/src/main/java/sample/data/jpa/service/HotelServiceImpl.java
View file @
48534770
/*
* Copyright 2012-201
6
the original author or authors.
* Copyright 2012-201
8
the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
@@ -94,5 +94,7 @@ class HotelServiceImpl implements HotelService {
Long
count
=
this
.
ratingCount
.
get
(
rating
);
return
count
==
null
?
0
:
count
;
}
}
}
spring-boot-samples/spring-boot-sample-data-jpa/src/test/java/sample/data/jpa/service/CityRepositoryIntegrationTests.java
View file @
48534770
/*
* Copyright 2012-201
6
the original author or authors.
* Copyright 2012-201
8
the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
@@ -45,4 +45,5 @@ public class CityRepositoryIntegrationTests {
Page
<
City
>
cities
=
this
.
repository
.
findAll
(
new
PageRequest
(
0
,
10
));
assertThat
(
cities
.
getTotalElements
()).
isGreaterThan
(
20L
);
}
}
spring-boot-samples/spring-boot-sample-data-jpa/src/test/java/sample/data/jpa/service/HotelRepositoryIntegrationTests.java
View file @
48534770
...
...
@@ -67,4 +67,5 @@ public class HotelRepositoryIntegrationTests {
assertThat
(
counts
.
get
(
0
).
getRating
()).
isEqualTo
(
Rating
.
AVERAGE
);
assertThat
(
counts
.
get
(
0
).
getCount
()).
isGreaterThan
(
1L
);
}
}
spring-boot-samples/spring-boot-sample-data-mongodb/src/main/java/sample/data/mongo/Customer.java
View file @
48534770
/*
* Copyright 2012-201
3
the original author or authors.
* Copyright 2012-201
8
the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
@@ -24,6 +24,7 @@ public class Customer {
private
String
id
;
private
String
firstName
;
private
String
lastName
;
public
Customer
()
{
...
...
spring-boot-samples/spring-boot-sample-data-neo4j/src/main/java/sample/data/neo4j/Customer.java
View file @
48534770
/*
* Copyright 2012-201
6
the original author or authors.
* Copyright 2012-201
8
the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
@@ -26,6 +26,7 @@ public class Customer {
private
Long
id
;
private
String
firstName
;
private
String
lastName
;
public
Customer
()
{
...
...
spring-boot-samples/spring-boot-sample-data-rest/src/main/java/sample/data/rest/domain/City.java
View file @
48534770
/*
* Copyright 2012-201
5
the original author or authors.
* Copyright 2012-201
8
the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
@@ -73,4 +73,5 @@ public class City implements Serializable {
public
String
toString
()
{
return
getName
()
+
","
+
getState
()
+
","
+
getCountry
();
}
}
spring-boot-samples/spring-boot-sample-data-rest/src/main/java/sample/data/rest/domain/Hotel.java
View file @
48534770
/*
* Copyright 2012-201
5
the original author or authors.
* Copyright 2012-201
8
the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
@@ -72,4 +72,5 @@ public class Hotel implements Serializable {
public
String
getZip
()
{
return
this
.
zip
;
}
}
spring-boot-samples/spring-boot-sample-data-rest/src/main/java/sample/data/rest/service/CitySearchCriteria.java
View file @
48534770
/*
* Copyright 2012-201
5
the original author or authors.
* Copyright 2012-201
8
the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
@@ -41,4 +41,5 @@ public class CitySearchCriteria implements Serializable {
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
}
}
spring-boot-samples/spring-boot-sample-data-rest/src/test/java/sample/data/rest/SampleDataRestApplicationTests.java
View file @
48534770
...
...
@@ -83,4 +83,5 @@ public class SampleDataRestApplicationTests {
.
andExpect
(
status
().
isOk
())
.
andExpect
(
jsonPath
(
"_embedded.cities"
,
hasSize
(
3
)));
}
}
spring-boot-samples/spring-boot-sample-data-rest/src/test/java/sample/data/rest/service/CityRepositoryIntegrationTests.java
View file @
48534770
/*
* Copyright 2012-201
6
the original author or authors.
* Copyright 2012-201
8
the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
@@ -63,4 +63,5 @@ public class CityRepositoryIntegrationTests {
new
PageRequest
(
0
,
10
));
assertThat
(
cities
.
getTotalElements
()).
isEqualTo
(
3L
);
}
}
spring-boot-samples/spring-boot-sample-flyway/src/main/java/sample/flyway/Person.java
View file @
48534770
/*
* Copyright 2012-201
5
the original author or authors.
* Copyright 2012-201
8
the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
@@ -22,10 +22,13 @@ import javax.persistence.Id;
@Entity
public
class
Person
{
@Id
@GeneratedValue
private
Long
id
;
private
String
firstName
;
private
String
lastName
;
public
String
getFirstName
()
{
...
...
@@ -49,4 +52,5 @@ public class Person {
return
"Person [firstName="
+
this
.
firstName
+
", lastName="
+
this
.
lastName
+
"]"
;
}
}
spring-boot-samples/spring-boot-sample-hibernate4/src/main/java/sample/hibernate4/domain/City.java
View file @
48534770
/*
* Copyright 2012-201
6
the original author or authors.
* Copyright 2012-201
8
the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
@@ -74,4 +74,5 @@ public class City implements Serializable {
public
String
toString
()
{
return
getName
()
+
","
+
getState
()
+
","
+
getCountry
();
}
}
spring-boot-samples/spring-boot-sample-hibernate4/src/main/java/sample/hibernate4/domain/Hotel.java
View file @
48534770
/*
* Copyright 2012-201
6
the original author or authors.
* Copyright 2012-201
8
the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
@@ -79,4 +79,5 @@ public class Hotel implements Serializable {
public
String
getZip
()
{
return
this
.
zip
;
}
}
spring-boot-samples/spring-boot-sample-hibernate4/src/main/java/sample/hibernate4/domain/Rating.java
View file @
48534770
/*
* Copyright 2012-201
6
the original author or authors.
* Copyright 2012-201
8
the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
@@ -17,5 +17,7 @@
package
sample
.
hibernate4
.
domain
;
public
enum
Rating
{
TERRIBLE
,
POOR
,
AVERAGE
,
GOOD
,
EXCELLENT
,
}
spring-boot-samples/spring-boot-sample-hibernate4/src/main/java/sample/hibernate4/domain/Review.java
View file @
48534770
/*
* Copyright 2012-201
6
the original author or authors.
* Copyright 2012-201
8
the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
@@ -127,4 +127,5 @@ public class Review implements Serializable {
public
void
setDetails
(
String
details
)
{
this
.
details
=
details
;
}
}
spring-boot-samples/spring-boot-sample-hibernate4/src/main/java/sample/hibernate4/domain/ReviewDetails.java
View file @
48534770
/*
* Copyright 2012-201
6
the original author or authors.
* Copyright 2012-201
8
the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
@@ -75,4 +75,5 @@ public class ReviewDetails implements Serializable {
public
void
setDetails
(
String
details
)
{
this
.
details
=
details
;
}
}
spring-boot-samples/spring-boot-sample-hibernate4/src/main/java/sample/hibernate4/domain/TripType.java
View file @
48534770
/*
* Copyright 2012-201
6
the original author or authors.
* Copyright 2012-201
8
the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
@@ -17,5 +17,7 @@
package
sample
.
hibernate4
.
domain
;
public
enum
TripType
{
BUSINESS
,
COUPLES
,
FAMILY
,
FRIENDS
,
SOLO
}
spring-boot-samples/spring-boot-sample-hibernate4/src/main/java/sample/hibernate4/service/CitySearchCriteria.java
View file @
48534770
/*
* Copyright 2012-201
6
the original author or authors.
* Copyright 2012-201
8
the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
@@ -41,4 +41,5 @@ public class CitySearchCriteria implements Serializable {
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
}
}
spring-boot-samples/spring-boot-sample-hibernate4/src/main/java/sample/hibernate4/service/CityServiceImpl.java
View file @
48534770
/*
* Copyright 2012-201
6
the original author or authors.
* Copyright 2012-201
8
the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
@@ -75,4 +75,5 @@ class CityServiceImpl implements CityService {
Assert
.
notNull
(
city
,
"City must not be null"
);
return
this
.
hotelRepository
.
findByCity
(
city
,
pageable
);
}
}
spring-boot-samples/spring-boot-sample-hibernate4/src/main/java/sample/hibernate4/service/HotelServiceImpl.java
View file @
48534770
/*
* Copyright 2012-201
6
the original author or authors.
* Copyright 2012-201
8
the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
@@ -94,5 +94,7 @@ class HotelServiceImpl implements HotelService {
Long
count
=
this
.
ratingCount
.
get
(
rating
);
return
count
==
null
?
0
:
count
;
}
}
}
spring-boot-samples/spring-boot-sample-hibernate4/src/test/java/sample/hibernate4/service/CityRepositoryIntegrationTests.java
View file @
48534770
/*
* Copyright 2012-201
6
the original author or authors.
* Copyright 2012-201
8
the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
@@ -45,4 +45,5 @@ public class CityRepositoryIntegrationTests {
Page
<
City
>
cities
=
this
.
repository
.
findAll
(
new
PageRequest
(
0
,
10
));
assertThat
(
cities
.
getTotalElements
()).
isGreaterThan
(
20L
);
}
}
spring-boot-samples/spring-boot-sample-hibernate4/src/test/java/sample/hibernate4/service/HotelRepositoryIntegrationTests.java
View file @
48534770
/*
* Copyright 2012-201
6
the original author or authors.
* Copyright 2012-201
8
the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
@@ -45,6 +45,7 @@ public class HotelRepositoryIntegrationTests {
@Autowired
CityRepository
cityRepository
;
@Autowired
HotelRepository
repository
;
...
...
@@ -66,4 +67,5 @@ public class HotelRepositoryIntegrationTests {
assertThat
(
counts
.
get
(
0
).
getRating
()).
isEqualTo
(
Rating
.
AVERAGE
);
assertThat
(
counts
.
get
(
0
).
getCount
()).
isGreaterThan
(
1L
);
}
}
spring-boot-samples/spring-boot-sample-hibernate52/src/main/java/sample/hibernate52/domain/City.java
View file @
48534770
/*
* Copyright 2012-201
6
the original author or authors.
* Copyright 2012-201
8
the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
@@ -74,4 +74,5 @@ public class City implements Serializable {
public
String
toString
()
{
return
getName
()
+
","
+
getState
()
+
","
+
getCountry
();
}
}
spring-boot-samples/spring-boot-sample-hibernate52/src/main/java/sample/hibernate52/domain/Hotel.java
View file @
48534770
/*
* Copyright 2012-201
6
the original author or authors.
* Copyright 2012-201
8
the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
@@ -79,4 +79,5 @@ public class Hotel implements Serializable {
public
String
getZip
()
{
return
this
.
zip
;
}
}
spring-boot-samples/spring-boot-sample-hibernate52/src/main/java/sample/hibernate52/domain/Rating.java
View file @
48534770
/*
* Copyright 2012-201
6
the original author or authors.
* Copyright 2012-201
8
the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
@@ -17,5 +17,7 @@
package
sample
.
hibernate52
.
domain
;
public
enum
Rating
{
TERRIBLE
,
POOR
,
AVERAGE
,
GOOD
,
EXCELLENT
,
}
spring-boot-samples/spring-boot-sample-hibernate52/src/main/java/sample/hibernate52/domain/Review.java
View file @
48534770
/*
* Copyright 2012-201
6
the original author or authors.
* Copyright 2012-201
8
the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
@@ -127,4 +127,5 @@ public class Review implements Serializable {
public
void
setDetails
(
String
details
)
{
this
.
details
=
details
;
}
}
spring-boot-samples/spring-boot-sample-hibernate52/src/main/java/sample/hibernate52/domain/ReviewDetails.java
View file @
48534770
/*
* Copyright 2012-201
6
the original author or authors.
* Copyright 2012-201
8
the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
@@ -75,4 +75,5 @@ public class ReviewDetails implements Serializable {
public
void
setDetails
(
String
details
)
{
this
.
details
=
details
;
}
}
spring-boot-samples/spring-boot-sample-hibernate52/src/main/java/sample/hibernate52/domain/TripType.java
View file @
48534770
/*
* Copyright 2012-201
6
the original author or authors.
* Copyright 2012-201
8
the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
@@ -17,5 +17,7 @@
package
sample
.
hibernate52
.
domain
;
public
enum
TripType
{
BUSINESS
,
COUPLES
,
FAMILY
,
FRIENDS
,
SOLO
}
spring-boot-samples/spring-boot-sample-hibernate52/src/main/java/sample/hibernate52/service/CitySearchCriteria.java
View file @
48534770
/*
* Copyright 2012-201
6
the original author or authors.
* Copyright 2012-201
8
the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
@@ -41,4 +41,5 @@ public class CitySearchCriteria implements Serializable {
public
void
setName
(
String
name
)
{
this
.
name
=
name
;
}
}
spring-boot-samples/spring-boot-sample-hibernate52/src/main/java/sample/hibernate52/service/CityServiceImpl.java
View file @
48534770
/*
* Copyright 2012-201
6
the original author or authors.
* Copyright 2012-201
8
the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
@@ -75,4 +75,5 @@ class CityServiceImpl implements CityService {
Assert
.
notNull
(
city
,
"City must not be null"
);
return
this
.
hotelRepository
.
findByCity
(
city
,
pageable
);
}
}
spring-boot-samples/spring-boot-sample-hibernate52/src/main/java/sample/hibernate52/service/HotelServiceImpl.java
View file @
48534770
/*
* Copyright 2012-201
6
the original author or authors.
* Copyright 2012-201
8
the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
@@ -94,5 +94,7 @@ class HotelServiceImpl implements HotelService {
Long
count
=
this
.
ratingCount
.
get
(
rating
);
return
count
==
null
?
0
:
count
;
}
}
}
spring-boot-samples/spring-boot-sample-hibernate52/src/test/java/sample/hibernate52/service/CityRepositoryIntegrationTests.java
View file @
48534770
/*
* Copyright 2012-201
6
the original author or authors.
* Copyright 2012-201
8
the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
@@ -45,4 +45,5 @@ public class CityRepositoryIntegrationTests {
Page
<
City
>
cities
=
this
.
repository
.
findAll
(
new
PageRequest
(
0
,
10
));
assertThat
(
cities
.
getTotalElements
()).
isGreaterThan
(
20L
);
}
}
spring-boot-samples/spring-boot-sample-hibernate52/src/test/java/sample/hibernate52/service/HotelRepositoryIntegrationTests.java
View file @
48534770
/*
* Copyright 2012-201
6
the original author or authors.
* Copyright 2012-201
8
the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
@@ -45,6 +45,7 @@ public class HotelRepositoryIntegrationTests {
@Autowired
CityRepository
cityRepository
;
@Autowired
HotelRepository
repository
;
...
...
@@ -66,4 +67,5 @@ public class HotelRepositoryIntegrationTests {
assertThat
(
counts
.
get
(
0
).
getRating
()).
isEqualTo
(
Rating
.
AVERAGE
);
assertThat
(
counts
.
get
(
0
).
getCount
()).
isGreaterThan
(
1L
);
}
}
spring-boot-samples/spring-boot-sample-hypermedia-ui-secure/src/test/java/sample/hypermedia/ui/secure/SampleHypermediaUiSecureApplicationTests.java
View file @
48534770
/*
* Copyright 2012-201
7
the original author or authors.
* Copyright 2012-201
8
the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
@@ -59,4 +59,5 @@ public class SampleHypermediaUiSecureApplicationTests {
String
.
class
);
assertThat
(
entity
.
getStatusCode
()).
isEqualTo
(
HttpStatus
.
UNAUTHORIZED
);
}
}
spring-boot-samples/spring-boot-sample-hypermedia-ui/src/main/java/sample/hypermedia/ui/SampleHypermediaUiApplication.java
View file @
48534770
/*
* Copyright 2012-201
5
the original author or authors.
* Copyright 2012-201
8
the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
@@ -25,4 +25,5 @@ public class SampleHypermediaUiApplication {
public
static
void
main
(
String
[]
args
)
{
SpringApplication
.
run
(
SampleHypermediaUiApplication
.
class
,
args
);
}
}
spring-boot-samples/spring-boot-sample-integration/src/test/java/sample/integration/consumer/SampleIntegrationApplicationTests.java
View file @
48534770
/*
* Copyright 2012-201
7
the original author or authors.
* Copyright 2012-201
8
the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
@@ -123,4 +123,5 @@ public class SampleIntegrationApplicationTests {
}
return
candidates
;
}
}
spring-boot-samples/spring-boot-sample-jooq/src/main/java/sample/jooq/JooqExamples.java
View file @
48534770
/*
* Copyright 2012-201
6
the original author or authors.
* Copyright 2012-201
8
the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
@@ -76,4 +76,5 @@ public class JooqExamples implements CommandLineRunner {
});
System
.
out
.
println
(
"jOOQ SQL "
+
list
);
}
}
spring-boot-samples/spring-boot-sample-liquibase/src/test/java/sample/liquibase/SampleLiquibaseApplicationTests.java
View file @
48534770
/*
* Copyright 2012-201
6
the original author or authors.
* Copyright 2012-201
8
the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
@@ -68,4 +68,5 @@ public class SampleLiquibaseApplicationTests {
}
return
false
;
}
}
spring-boot-samples/spring-boot-sample-metrics-opentsdb/src/main/java/sample/metrics/opentsdb/SampleController.java
View file @
48534770
/*
* Copyright 2012-201
7
the original author or authors.
* Copyright 2012-201
8
the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
@@ -55,6 +55,7 @@ public class SampleController {
public
void
setValue
(
String
value
)
{
this
.
value
=
value
;
}
}
}
spring-boot-samples/spring-boot-sample-metrics-redis/src/main/java/sample/metrics/redis/SampleController.java
View file @
48534770
/*
* Copyright 2012-201
7
the original author or authors.
* Copyright 2012-201
8
the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
@@ -55,6 +55,7 @@ public class SampleController {
public
void
setValue
(
String
value
)
{
this
.
value
=
value
;
}
}
}
spring-boot-samples/spring-boot-sample-parent-context/src/test/java/sample/parent/consumer/SampleIntegrationParentApplicationTests.java
View file @
48534770
/*
* Copyright 2012-201
5
the original author or authors.
* Copyright 2012-201
8
the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
@@ -99,4 +99,5 @@ public class SampleIntegrationParentApplicationTests {
}
return
builder
.
toString
();
}
}
spring-boot-samples/spring-boot-sample-secure/src/test/java/sample/secure/SampleSecureApplicationTests.java
View file @
48534770
/*
* Copyright 2012-201
6
the original author or authors.
* Copyright 2012-201
8
the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
@@ -93,6 +93,7 @@ public class SampleSecureApplicationTests {
@PropertySource
(
"classpath:test.properties"
)
@Configuration
protected
static
class
TestConfiguration
{
}
}
spring-boot-samples/spring-boot-sample-servlet/src/test/java/sample/servlet/SampleServletApplicationTests.java
View file @
48534770
/*
* Copyright 2012-201
6
the original author or authors.
* Copyright 2012-201
8
the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
@@ -64,4 +64,5 @@ public class SampleServletApplicationTests {
private
String
getPassword
()
{
return
this
.
security
.
getUser
().
getPassword
();
}
}
spring-boot-samples/spring-boot-sample-test/src/main/java/sample/test/service/VehicleIdentificationNumberNotFoundException.java
View file @
48534770
/*
* Copyright 2012-201
6
the original author or authors.
* Copyright 2012-201
8
the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
@@ -40,4 +40,5 @@ public class VehicleIdentificationNumberNotFoundException extends RuntimeExcepti
public
VehicleIdentificationNumber
getVehicleIdentificationNumber
()
{
return
this
.
vehicleIdentificationNumber
;
}
}
spring-boot-samples/spring-boot-sample-tomcat-multi-connectors/src/test/java/sample/tomcat/multiconnector/SampleTomcatTwoConnectorsApplicationTests.java
View file @
48534770
/*
* Copyright 2012-201
6
the original author or authors.
* Copyright 2012-201
8
the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
@@ -139,6 +139,7 @@ public class SampleTomcatTwoConnectorsApplicationTests {
}
super
.
prepareConnection
(
connection
,
httpMethod
);
}
}
}
spring-boot-samples/spring-boot-sample-traditional/src/main/java/sample/traditional/config/WebConfig.java
View file @
48534770
/*
* Copyright 2012-201
3
the original author or authors.
* Copyright 2012-201
8
the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
@@ -55,4 +55,5 @@ public class WebConfig extends WebMvcConfigurerAdapter {
DefaultServletHandlerConfigurer
configurer
)
{
configurer
.
enable
();
}
}
spring-boot-samples/spring-boot-sample-web-groovy-templates/src/main/java/sample/groovytemplates/Message.java
View file @
48534770
/*
* Copyright 2012-201
5
the original author or authors.
* Copyright 2012-201
8
the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
@@ -63,4 +63,5 @@ public class Message {
public
void
setSummary
(
String
summary
)
{
this
.
summary
=
summary
;
}
}
spring-boot-samples/spring-boot-sample-web-thymeleaf3/src/main/java/sample/web/thymeleaf3/Message.java
View file @
48534770
/*
* Copyright 2012-201
6
the original author or authors.
* Copyright 2012-201
8
the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
@@ -66,4 +66,5 @@ public class Message {
public
void
setSummary
(
String
summary
)
{
this
.
summary
=
summary
;
}
}
spring-boot-samples/spring-boot-sample-web-thymeleaf3/src/test/java/sample/web/thymeleaf3/MessageControllerWebTests.java
View file @
48534770
/*
* Copyright 2012-201
6
the original author or authors.
* Copyright 2012-201
8
the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
@@ -81,6 +81,7 @@ public class MessageControllerWebTests {
}
private
static
class
RegexMatcher
extends
TypeSafeMatcher
<
String
>
{
private
final
String
regex
;
public
RegexMatcher
(
String
regex
)
{
...
...
@@ -106,5 +107,7 @@ public class MessageControllerWebTests {
description
.
appendText
(
"a string that matches regex: "
)
.
appendText
(
this
.
regex
);
}
}
}
spring-boot-samples/spring-boot-sample-web-ui/src/main/java/sample/web/ui/Message.java
View file @
48534770
/*
* Copyright 2012-201
5
the original author or authors.
* Copyright 2012-201
8
the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
...
...
@@ -63,4 +63,5 @@ public class Message {
public
void
setSummary
(
String
summary
)
{
this
.
summary
=
summary
;
}
}
spring-boot-samples/spring-boot-sample-web-ui/src/test/java/sample/web/ui/MessageControllerWebTests.java
View file @
48534770
/*
* Copyright 2012-201
6
the original author or authors.
* Copyright 2012-201
8
the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
@@ -81,6 +81,7 @@ public class MessageControllerWebTests {
}
private
static
class
RegexMatcher
extends
TypeSafeMatcher
<
String
>
{
private
final
String
regex
;
public
RegexMatcher
(
String
regex
)
{
...
...
@@ -106,5 +107,7 @@ public class MessageControllerWebTests {
description
.
appendText
(
"a string that matches regex: "
)
.
appendText
(
this
.
regex
);
}
}
}
spring-boot-samples/spring-boot-sample-websocket-jetty/src/main/java/samples/websocket/jetty/reverse/ReverseWebSocketEndpoint.java
View file @
48534770
/*
* Copyright 2012-201
5
the original author or authors.
* Copyright 2012-201
8
the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
@@ -30,4 +30,5 @@ public class ReverseWebSocketEndpoint {
session
.
getBasicRemote
()
.
sendText
(
"Reversed: "
+
new
StringBuilder
(
message
).
reverse
());
}
}
spring-boot-samples/spring-boot-sample-websocket-jetty/src/main/java/samples/websocket/jetty/snake/Direction.java
View file @
48534770
...
...
@@ -18,5 +18,7 @@
package
samples
.
websocket
.
jetty
.
snake
;
public
enum
Direction
{
NONE
,
NORTH
,
SOUTH
,
EAST
,
WEST
}
spring-boot-samples/spring-boot-sample-websocket-jetty/src/main/java/samples/websocket/jetty/snake/Location.java
View file @
48534770
...
...
@@ -20,9 +20,13 @@ package samples.websocket.jetty.snake;
public
class
Location
{
public
int
x
;
public
int
y
;
public
static
final
int
GRID_SIZE
=
10
;
public
static
final
int
PLAYFIELD_HEIGHT
=
480
;
public
static
final
int
PLAYFIELD_WIDTH
=
640
;
public
Location
(
int
x
,
int
y
)
{
...
...
@@ -74,4 +78,5 @@ public class Location {
result
=
31
*
result
+
this
.
y
;
return
result
;
}
}
spring-boot-samples/spring-boot-sample-websocket-jetty/src/main/java/samples/websocket/jetty/snake/Snake.java
View file @
48534770
...
...
@@ -157,4 +157,5 @@ public class Snake {
public
String
getHexColor
()
{
return
this
.
hexColor
;
}
}
spring-boot-samples/spring-boot-sample-websocket-jetty/src/main/java/samples/websocket/jetty/snake/SnakeTimer.java
View file @
48534770
...
...
@@ -112,4 +112,5 @@ public class SnakeTimer {
gameTimer
.
cancel
();
}
}
}
spring-boot-samples/spring-boot-sample-websocket-jetty/src/main/java/samples/websocket/jetty/snake/SnakeUtils.java
View file @
48534770
...
...
@@ -23,7 +23,9 @@ import java.util.Random;
public
class
SnakeUtils
{
public
static
final
int
PLAYFIELD_WIDTH
=
640
;
public
static
final
int
PLAYFIELD_HEIGHT
=
480
;
public
static
final
int
GRID_SIZE
=
10
;
private
static
final
Random
random
=
new
Random
();
...
...
spring-boot-samples/spring-boot-sample-websocket-jetty/src/main/java/samples/websocket/jetty/snake/SnakeWebSocketHandler.java
View file @
48534770
...
...
@@ -30,13 +30,17 @@ import org.springframework.web.socket.handler.TextWebSocketHandler;
public
class
SnakeWebSocketHandler
extends
TextWebSocketHandler
{
public
static
final
int
PLAYFIELD_WIDTH
=
640
;
public
static
final
int
PLAYFIELD_HEIGHT
=
480
;
public
static
final
int
GRID_SIZE
=
10
;
private
static
final
AtomicInteger
snakeIds
=
new
AtomicInteger
(
0
);
private
static
final
Random
random
=
new
Random
();
private
final
int
id
;
private
Snake
snake
;
public
static
String
getRandomHexColor
()
{
...
...
@@ -109,4 +113,5 @@ public class SnakeWebSocketHandler extends TextWebSocketHandler {
SnakeTimer
.
broadcast
(
String
.
format
(
"{'type': 'leave', 'id': %d}"
,
Integer
.
valueOf
(
this
.
id
)));
}
}
spring-boot-samples/spring-boot-sample-websocket-jetty/src/test/java/samples/websocket/jetty/SampleWebSocketsApplicationTests.java
View file @
48534770
/*
* Copyright 2012-201
7
the original author or authors.
* Copyright 2012-201
8
the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
@@ -132,6 +132,7 @@ public class SampleWebSocketsApplicationTests {
public
GreetingService
greetingService
()
{
return
new
SimpleGreetingService
();
}
}
}
spring-boot-samples/spring-boot-sample-websocket-jetty93/src/main/java/samples/websocket/jetty93/reverse/ReverseWebSocketEndpoint.java
View file @
48534770
/*
* Copyright 2012-201
6
the original author or authors.
* Copyright 2012-201
8
the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
@@ -30,4 +30,5 @@ public class ReverseWebSocketEndpoint {
session
.
getBasicRemote
()
.
sendText
(
"Reversed: "
+
new
StringBuilder
(
message
).
reverse
());
}
}
spring-boot-samples/spring-boot-sample-websocket-jetty93/src/main/java/samples/websocket/jetty93/snake/Direction.java
View file @
48534770
...
...
@@ -18,5 +18,7 @@
package
samples
.
websocket
.
jetty93
.
snake
;
public
enum
Direction
{
NONE
,
NORTH
,
SOUTH
,
EAST
,
WEST
}
spring-boot-samples/spring-boot-sample-websocket-jetty93/src/main/java/samples/websocket/jetty93/snake/Location.java
View file @
48534770
...
...
@@ -20,9 +20,13 @@ package samples.websocket.jetty93.snake;
public
class
Location
{
public
int
x
;
public
int
y
;
public
static
final
int
GRID_SIZE
=
10
;
public
static
final
int
PLAYFIELD_HEIGHT
=
480
;
public
static
final
int
PLAYFIELD_WIDTH
=
640
;
public
Location
(
int
x
,
int
y
)
{
...
...
@@ -74,4 +78,5 @@ public class Location {
result
=
31
*
result
+
this
.
y
;
return
result
;
}
}
spring-boot-samples/spring-boot-sample-websocket-jetty93/src/main/java/samples/websocket/jetty93/snake/Snake.java
View file @
48534770
...
...
@@ -157,4 +157,5 @@ public class Snake {
public
String
getHexColor
()
{
return
this
.
hexColor
;
}
}
spring-boot-samples/spring-boot-sample-websocket-jetty93/src/main/java/samples/websocket/jetty93/snake/SnakeTimer.java
View file @
48534770
...
...
@@ -112,4 +112,5 @@ public class SnakeTimer {
gameTimer
.
cancel
();
}
}
}
spring-boot-samples/spring-boot-sample-websocket-jetty93/src/main/java/samples/websocket/jetty93/snake/SnakeUtils.java
View file @
48534770
...
...
@@ -23,7 +23,9 @@ import java.util.Random;
public
class
SnakeUtils
{
public
static
final
int
PLAYFIELD_WIDTH
=
640
;
public
static
final
int
PLAYFIELD_HEIGHT
=
480
;
public
static
final
int
GRID_SIZE
=
10
;
private
static
final
Random
random
=
new
Random
();
...
...
spring-boot-samples/spring-boot-sample-websocket-jetty93/src/main/java/samples/websocket/jetty93/snake/SnakeWebSocketHandler.java
View file @
48534770
...
...
@@ -30,13 +30,17 @@ import org.springframework.web.socket.handler.TextWebSocketHandler;
public
class
SnakeWebSocketHandler
extends
TextWebSocketHandler
{
public
static
final
int
PLAYFIELD_WIDTH
=
640
;
public
static
final
int
PLAYFIELD_HEIGHT
=
480
;
public
static
final
int
GRID_SIZE
=
10
;
private
static
final
AtomicInteger
snakeIds
=
new
AtomicInteger
(
0
);
private
static
final
Random
random
=
new
Random
();
private
final
int
id
;
private
Snake
snake
;
public
static
String
getRandomHexColor
()
{
...
...
@@ -109,4 +113,5 @@ public class SnakeWebSocketHandler extends TextWebSocketHandler {
SnakeTimer
.
broadcast
(
String
.
format
(
"{'type': 'leave', 'id': %d}"
,
Integer
.
valueOf
(
this
.
id
)));
}
}
spring-boot-samples/spring-boot-sample-websocket-jetty93/src/test/java/samples/websocket/jetty93/SampleWebSocketsApplicationTests.java
View file @
48534770
/*
* Copyright 2012-201
7
the original author or authors.
* Copyright 2012-201
8
the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
@@ -132,6 +132,7 @@ public class SampleWebSocketsApplicationTests {
public
GreetingService
greetingService
()
{
return
new
SimpleGreetingService
();
}
}
}
spring-boot-samples/spring-boot-sample-websocket-tomcat/src/main/java/samples/websocket/tomcat/reverse/ReverseWebSocketEndpoint.java
View file @
48534770
/*
* Copyright 2012-201
5
the original author or authors.
* Copyright 2012-201
8
the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
@@ -30,4 +30,5 @@ public class ReverseWebSocketEndpoint {
session
.
getBasicRemote
()
.
sendText
(
"Reversed: "
+
new
StringBuilder
(
message
).
reverse
());
}
}
spring-boot-samples/spring-boot-sample-websocket-tomcat/src/main/java/samples/websocket/tomcat/snake/Direction.java
View file @
48534770
...
...
@@ -18,5 +18,7 @@
package
samples
.
websocket
.
tomcat
.
snake
;
public
enum
Direction
{
NONE
,
NORTH
,
SOUTH
,
EAST
,
WEST
}
spring-boot-samples/spring-boot-sample-websocket-tomcat/src/main/java/samples/websocket/tomcat/snake/Location.java
View file @
48534770
...
...
@@ -20,9 +20,13 @@ package samples.websocket.tomcat.snake;
public
class
Location
{
public
int
x
;
public
int
y
;
public
static
final
int
GRID_SIZE
=
10
;
public
static
final
int
PLAYFIELD_HEIGHT
=
480
;
public
static
final
int
PLAYFIELD_WIDTH
=
640
;
public
Location
(
int
x
,
int
y
)
{
...
...
@@ -74,4 +78,5 @@ public class Location {
result
=
31
*
result
+
this
.
y
;
return
result
;
}
}
spring-boot-samples/spring-boot-sample-websocket-tomcat/src/main/java/samples/websocket/tomcat/snake/Snake.java
View file @
48534770
...
...
@@ -157,4 +157,5 @@ public class Snake {
public
String
getHexColor
()
{
return
this
.
hexColor
;
}
}
spring-boot-samples/spring-boot-sample-websocket-tomcat/src/main/java/samples/websocket/tomcat/snake/SnakeTimer.java
View file @
48534770
...
...
@@ -112,4 +112,5 @@ public class SnakeTimer {
gameTimer
.
cancel
();
}
}
}
spring-boot-samples/spring-boot-sample-websocket-tomcat/src/main/java/samples/websocket/tomcat/snake/SnakeUtils.java
View file @
48534770
...
...
@@ -23,7 +23,9 @@ import java.util.Random;
public
class
SnakeUtils
{
public
static
final
int
PLAYFIELD_WIDTH
=
640
;
public
static
final
int
PLAYFIELD_HEIGHT
=
480
;
public
static
final
int
GRID_SIZE
=
10
;
private
static
final
Random
random
=
new
Random
();
...
...
spring-boot-samples/spring-boot-sample-websocket-tomcat/src/main/java/samples/websocket/tomcat/snake/SnakeWebSocketHandler.java
View file @
48534770
...
...
@@ -30,13 +30,17 @@ import org.springframework.web.socket.handler.TextWebSocketHandler;
public
class
SnakeWebSocketHandler
extends
TextWebSocketHandler
{
public
static
final
int
PLAYFIELD_WIDTH
=
640
;
public
static
final
int
PLAYFIELD_HEIGHT
=
480
;
public
static
final
int
GRID_SIZE
=
10
;
private
static
final
AtomicInteger
snakeIds
=
new
AtomicInteger
(
0
);
private
static
final
Random
random
=
new
Random
();
private
final
int
id
;
private
Snake
snake
;
public
static
String
getRandomHexColor
()
{
...
...
@@ -109,4 +113,5 @@ public class SnakeWebSocketHandler extends TextWebSocketHandler {
SnakeTimer
.
broadcast
(
String
.
format
(
"{'type': 'leave', 'id': %d}"
,
Integer
.
valueOf
(
this
.
id
)));
}
}
spring-boot-samples/spring-boot-sample-websocket-tomcat/src/test/java/samples/websocket/tomcat/snake/SnakeTimerTests.java
View file @
48534770
/*
* Copyright 2012-201
6
the original author or authors.
* Copyright 2012-201
8
the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
@@ -36,4 +36,5 @@ public class SnakeTimerTests {
SnakeTimer
.
broadcast
(
""
);
assertThat
(
SnakeTimer
.
getSnakes
()).
hasSize
(
0
);
}
}
spring-boot-samples/spring-boot-sample-websocket-undertow/src/main/java/samples/websocket/undertow/reverse/ReverseWebSocketEndpoint.java
View file @
48534770
/*
* Copyright 2012-201
5
the original author or authors.
* Copyright 2012-201
8
the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
@@ -30,4 +30,5 @@ public class ReverseWebSocketEndpoint {
session
.
getBasicRemote
()
.
sendText
(
"Reversed: "
+
new
StringBuilder
(
message
).
reverse
());
}
}
spring-boot-samples/spring-boot-sample-websocket-undertow/src/main/java/samples/websocket/undertow/snake/Direction.java
View file @
48534770
...
...
@@ -18,5 +18,7 @@
package
samples
.
websocket
.
undertow
.
snake
;
public
enum
Direction
{
NONE
,
NORTH
,
SOUTH
,
EAST
,
WEST
}
spring-boot-samples/spring-boot-sample-websocket-undertow/src/main/java/samples/websocket/undertow/snake/Location.java
View file @
48534770
...
...
@@ -20,9 +20,13 @@ package samples.websocket.undertow.snake;
public
class
Location
{
public
int
x
;
public
int
y
;
public
static
final
int
GRID_SIZE
=
10
;
public
static
final
int
PLAYFIELD_HEIGHT
=
480
;
public
static
final
int
PLAYFIELD_WIDTH
=
640
;
public
Location
(
int
x
,
int
y
)
{
...
...
@@ -74,4 +78,5 @@ public class Location {
result
=
31
*
result
+
this
.
y
;
return
result
;
}
}
spring-boot-samples/spring-boot-sample-websocket-undertow/src/main/java/samples/websocket/undertow/snake/Snake.java
View file @
48534770
...
...
@@ -157,4 +157,5 @@ public class Snake {
public
String
getHexColor
()
{
return
this
.
hexColor
;
}
}
spring-boot-samples/spring-boot-sample-websocket-undertow/src/main/java/samples/websocket/undertow/snake/SnakeTimer.java
View file @
48534770
...
...
@@ -112,4 +112,5 @@ public class SnakeTimer {
gameTimer
.
cancel
();
}
}
}
spring-boot-samples/spring-boot-sample-websocket-undertow/src/main/java/samples/websocket/undertow/snake/SnakeUtils.java
View file @
48534770
...
...
@@ -23,7 +23,9 @@ import java.util.Random;
public
class
SnakeUtils
{
public
static
final
int
PLAYFIELD_WIDTH
=
640
;
public
static
final
int
PLAYFIELD_HEIGHT
=
480
;
public
static
final
int
GRID_SIZE
=
10
;
private
static
final
Random
random
=
new
Random
();
...
...
spring-boot-samples/spring-boot-sample-websocket-undertow/src/main/java/samples/websocket/undertow/snake/SnakeWebSocketHandler.java
View file @
48534770
...
...
@@ -30,13 +30,17 @@ import org.springframework.web.socket.handler.TextWebSocketHandler;
public
class
SnakeWebSocketHandler
extends
TextWebSocketHandler
{
public
static
final
int
PLAYFIELD_WIDTH
=
640
;
public
static
final
int
PLAYFIELD_HEIGHT
=
480
;
public
static
final
int
GRID_SIZE
=
10
;
private
static
final
AtomicInteger
snakeIds
=
new
AtomicInteger
(
0
);
private
static
final
Random
random
=
new
Random
();
private
final
int
id
;
private
Snake
snake
;
public
static
String
getRandomHexColor
()
{
...
...
@@ -109,4 +113,5 @@ public class SnakeWebSocketHandler extends TextWebSocketHandler {
SnakeTimer
.
broadcast
(
String
.
format
(
"{'type': 'leave', 'id': %d}"
,
Integer
.
valueOf
(
this
.
id
)));
}
}
spring-boot-samples/spring-boot-sample-websocket-undertow/src/test/java/samples/websocket/undertow/snake/SnakeTimerTests.java
View file @
48534770
/*
* Copyright 2012-201
6
the original author or authors.
* Copyright 2012-201
8
the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
...
...
@@ -36,4 +36,5 @@ public class SnakeTimerTests {
SnakeTimer
.
broadcast
(
""
);
assertThat
(
SnakeTimer
.
getSnakes
()).
hasSize
(
0
);
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment