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
8102dc78
Commit
8102dc78
authored
Dec 29, 2017
by
Madhura Bhave
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove redundant throws declarations
parent
1ab5b833
Changes
20
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
48 additions
and
64 deletions
+48
-64
WebFluxEndpointCorsIntegrationTests.java
.../integrationtest/WebFluxEndpointCorsIntegrationTests.java
+5
-5
FreeMarkerAutoConfigurationReactiveIntegrationTests.java
.../FreeMarkerAutoConfigurationReactiveIntegrationTests.java
+4
-4
JacksonAutoConfigurationTests.java
.../autoconfigure/jackson/JacksonAutoConfigurationTests.java
+1
-1
DataSourceJsonSerializationTests.java
.../autoconfigure/jdbc/DataSourceJsonSerializationTests.java
+1
-2
AuthenticationManagerConfigurationTests.java
...ure/security/AuthenticationManagerConfigurationTests.java
+4
-7
ReactiveAuthenticationManagerConfigurationTests.java
...tive/ReactiveAuthenticationManagerConfigurationTests.java
+4
-7
DefaultErrorAttributesTests.java
...igure/web/reactive/error/DefaultErrorAttributesTests.java
+1
-1
FileSystemWatcherTests.java
...ework/boot/devtools/filewatch/FileSystemWatcherTests.java
+1
-2
OverrideAutoConfigurationEnabledFalseIntegrationTest.java
...OverrideAutoConfigurationEnabledFalseIntegrationTest.java
+1
-1
OverrideAutoConfigurationEnabledTrueIntegrationTest.java
.../OverrideAutoConfigurationEnabledTrueIntegrationTest.java
+1
-1
LocalHostWebClientTests.java
...ework/boot/test/web/htmlunit/LocalHostWebClientTests.java
+2
-3
TestProject.java
...ingframework/boot/configurationprocessor/TestProject.java
+1
-3
TestJarFile.java
...va/org/springframework/boot/loader/tools/TestJarFile.java
+1
-2
TestJarCreator.java
.../java/org/springframework/boot/loader/TestJarCreator.java
+1
-1
TomcatEmbeddedWebappClassLoaderTests.java
...embedded/tomcat/TomcatEmbeddedWebappClassLoaderTests.java
+1
-2
ApplicationBuilder.java
...ngframework/boot/context/embedded/ApplicationBuilder.java
+3
-4
EmbeddedServletContainerJarDevelopmentIntegrationTests.java
...beddedServletContainerJarDevelopmentIntegrationTests.java
+2
-3
EmbeddedServletContainerJarPackagingIntegrationTests.java
...EmbeddedServletContainerJarPackagingIntegrationTests.java
+5
-5
EmbeddedServletContainerWarDevelopmentIntegrationTests.java
...beddedServletContainerWarDevelopmentIntegrationTests.java
+3
-4
EmbeddedServletContainerWarPackagingIntegrationTests.java
...EmbeddedServletContainerWarPackagingIntegrationTests.java
+6
-6
No files found.
spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/integrationtest/WebFluxEndpointCorsIntegrationTests.java
View file @
8102dc78
...
...
@@ -73,7 +73,7 @@ public class WebFluxEndpointCorsIntegrationTests {
}
@Test
public
void
settingAllowedOriginsEnablesCors
()
throws
Exception
{
public
void
settingAllowedOriginsEnablesCors
()
{
TestPropertyValues
.
of
(
"management.endpoints.web.cors.allowed-origins:spring.example.org"
)
.
applyTo
(
this
.
context
);
...
...
@@ -87,7 +87,7 @@ public class WebFluxEndpointCorsIntegrationTests {
}
@Test
public
void
maxAgeDefaultsTo30Minutes
()
throws
Exception
{
public
void
maxAgeDefaultsTo30Minutes
()
{
TestPropertyValues
.
of
(
"management.endpoints.web.cors.allowed-origins:spring.example.org"
)
.
applyTo
(
this
.
context
);
...
...
@@ -96,7 +96,7 @@ public class WebFluxEndpointCorsIntegrationTests {
}
@Test
public
void
maxAgeCanBeConfigured
()
throws
Exception
{
public
void
maxAgeCanBeConfigured
()
{
TestPropertyValues
.
of
(
"management.endpoints.web.cors.allowed-origins:spring.example.org"
,
"management.endpoints.web.cors.max-age: 2400"
)
...
...
@@ -164,7 +164,7 @@ public class WebFluxEndpointCorsIntegrationTests {
}
@Test
public
void
credentialsCanBeAllowed
()
throws
Exception
{
public
void
credentialsCanBeAllowed
()
{
TestPropertyValues
.
of
(
"management.endpoints.web.cors.allowed-origins:spring.example.org"
,
"management.endpoints.web.cors.allow-credentials:true"
)
...
...
@@ -174,7 +174,7 @@ public class WebFluxEndpointCorsIntegrationTests {
}
@Test
public
void
credentialsCanBeDisabled
()
throws
Exception
{
public
void
credentialsCanBeDisabled
()
{
TestPropertyValues
.
of
(
"management.endpoints.web.cors.allowed-origins:spring.example.org"
,
"management.endpoints.web.cors.allow-credentials:false"
)
...
...
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/freemarker/FreeMarkerAutoConfigurationReactiveIntegrationTests.java
View file @
8102dc78
...
...
@@ -62,7 +62,7 @@ public class FreeMarkerAutoConfigurationReactiveIntegrationTests {
}
@Test
public
void
defaultViewResolution
()
throws
Exception
{
public
void
defaultViewResolution
()
{
registerAndRefreshContext
();
MockServerWebExchange
exchange
=
render
(
"home"
);
String
result
=
exchange
.
getResponse
().
getBodyAsString
().
block
();
...
...
@@ -72,7 +72,7 @@ public class FreeMarkerAutoConfigurationReactiveIntegrationTests {
}
@Test
public
void
customPrefix
()
throws
Exception
{
public
void
customPrefix
()
{
registerAndRefreshContext
(
"spring.freemarker.prefix:prefix/"
);
MockServerWebExchange
exchange
=
render
(
"prefixed"
);
String
result
=
exchange
.
getResponse
().
getBodyAsString
().
block
();
...
...
@@ -80,7 +80,7 @@ public class FreeMarkerAutoConfigurationReactiveIntegrationTests {
}
@Test
public
void
customSuffix
()
throws
Exception
{
public
void
customSuffix
()
{
registerAndRefreshContext
(
"spring.freemarker.suffix:.freemarker"
);
MockServerWebExchange
exchange
=
render
(
"suffixed"
);
String
result
=
exchange
.
getResponse
().
getBodyAsString
().
block
();
...
...
@@ -88,7 +88,7 @@ public class FreeMarkerAutoConfigurationReactiveIntegrationTests {
}
@Test
public
void
customTemplateLoaderPath
()
throws
Exception
{
public
void
customTemplateLoaderPath
()
{
registerAndRefreshContext
(
"spring.freemarker.templateLoaderPath:classpath:/custom-templates/"
);
MockServerWebExchange
exchange
=
render
(
"custom"
);
...
...
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jackson/JacksonAutoConfigurationTests.java
View file @
8102dc78
...
...
@@ -514,7 +514,7 @@ public class JacksonAutoConfigurationTests {
@Override
public
void
serialize
(
Foo
value
,
JsonGenerator
jgen
,
SerializerProvider
provider
)
throws
IOException
,
JsonProcessingException
{
throws
IOException
{
jgen
.
writeStartObject
();
jgen
.
writeStringField
(
"foo"
,
"bar"
);
jgen
.
writeEndObject
();
...
...
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/jdbc/DataSourceJsonSerializationTests.java
View file @
8102dc78
...
...
@@ -23,7 +23,6 @@ import java.util.ArrayList;
import
java.util.List
;
import
com.fasterxml.jackson.core.JsonGenerator
;
import
com.fasterxml.jackson.core.JsonProcessingException
;
import
com.fasterxml.jackson.databind.BeanDescription
;
import
com.fasterxml.jackson.databind.JsonSerializer
;
import
com.fasterxml.jackson.databind.ObjectMapper
;
...
...
@@ -85,7 +84,7 @@ public class DataSourceJsonSerializationTests {
@Override
public
void
serialize
(
DataSource
value
,
JsonGenerator
jgen
,
SerializerProvider
provider
)
throws
IOException
,
JsonProcessingException
{
SerializerProvider
provider
)
throws
IOException
{
jgen
.
writeStartObject
();
for
(
PropertyDescriptor
property
:
BeanUtils
.
getPropertyDescriptors
(
DataSource
.
class
))
{
...
...
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/AuthenticationManagerConfigurationTests.java
View file @
8102dc78
...
...
@@ -40,8 +40,7 @@ public class AuthenticationManagerConfigurationTests {
private
final
ApplicationContextRunner
contextRunner
=
new
ApplicationContextRunner
();
@Test
public
void
userDetailsServiceWhenPasswordEncoderAbsentAndDefaultPassword
()
throws
Exception
{
public
void
userDetailsServiceWhenPasswordEncoderAbsentAndDefaultPassword
()
{
this
.
contextRunner
.
withUserConfiguration
(
TestSecurityConfiguration
.
class
,
AuthenticationManagerConfiguration
.
class
).
run
((
context
->
{
InMemoryUserDetailsManager
userDetailsService
=
context
...
...
@@ -53,20 +52,18 @@ public class AuthenticationManagerConfigurationTests {
}
@Test
public
void
userDetailsServiceWhenPasswordEncoderAbsentAndRawPassword
()
throws
Exception
{
public
void
userDetailsServiceWhenPasswordEncoderAbsentAndRawPassword
()
{
testPasswordEncoding
(
TestSecurityConfiguration
.
class
,
"secret"
,
"{noop}secret"
);
}
@Test
public
void
userDetailsServiceWhenPasswordEncoderAbsentAndEncodedPassword
()
throws
Exception
{
public
void
userDetailsServiceWhenPasswordEncoderAbsentAndEncodedPassword
()
{
String
password
=
"{bcrypt}$2a$10$sCBi9fy9814vUPf2ZRbtp.fR5/VgRk2iBFZ.ypu5IyZ28bZgxrVDa"
;
testPasswordEncoding
(
TestSecurityConfiguration
.
class
,
password
,
password
);
}
@Test
public
void
userDetailsServiceWhenPasswordEncoderBeanPresent
()
throws
Exception
{
public
void
userDetailsServiceWhenPasswordEncoderBeanPresent
()
{
testPasswordEncoding
(
TestConfigWithPasswordEncoder
.
class
,
"secret"
,
"secret"
);
}
...
...
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/security/reactive/ReactiveAuthenticationManagerConfigurationTests.java
View file @
8102dc78
...
...
@@ -41,8 +41,7 @@ public class ReactiveAuthenticationManagerConfigurationTests {
private
final
ReactiveWebApplicationContextRunner
contextRunner
=
new
ReactiveWebApplicationContextRunner
();
@Test
public
void
userDetailsServiceWhenPasswordEncoderAbsentAndDefaultPassword
()
throws
Exception
{
public
void
userDetailsServiceWhenPasswordEncoderAbsentAndDefaultPassword
()
{
this
.
contextRunner
.
withUserConfiguration
(
TestSecurityConfiguration
.
class
,
ReactiveAuthenticationManagerConfiguration
.
class
)
...
...
@@ -56,20 +55,18 @@ public class ReactiveAuthenticationManagerConfigurationTests {
}
@Test
public
void
userDetailsServiceWhenPasswordEncoderAbsentAndRawPassword
()
throws
Exception
{
public
void
userDetailsServiceWhenPasswordEncoderAbsentAndRawPassword
()
{
testPasswordEncoding
(
TestSecurityConfiguration
.
class
,
"secret"
,
"{noop}secret"
);
}
@Test
public
void
userDetailsServiceWhenPasswordEncoderAbsentAndEncodedPassword
()
throws
Exception
{
public
void
userDetailsServiceWhenPasswordEncoderAbsentAndEncodedPassword
()
{
String
password
=
"{bcrypt}$2a$10$sCBi9fy9814vUPf2ZRbtp.fR5/VgRk2iBFZ.ypu5IyZ28bZgxrVDa"
;
testPasswordEncoding
(
TestSecurityConfiguration
.
class
,
password
,
password
);
}
@Test
public
void
userDetailsServiceWhenPasswordEncoderBeanPresent
()
throws
Exception
{
public
void
userDetailsServiceWhenPasswordEncoderBeanPresent
()
{
testPasswordEncoding
(
TestConfigWithPasswordEncoder
.
class
,
"secret"
,
"secret"
);
}
...
...
spring-boot-project/spring-boot-autoconfigure/src/test/java/org/springframework/boot/autoconfigure/web/reactive/error/DefaultErrorAttributesTests.java
View file @
8102dc78
...
...
@@ -176,7 +176,7 @@ public class DefaultErrorAttributesTests {
return
ServerRequest
.
create
(
exchange
,
this
.
readers
);
}
public
int
method
(
String
firstParam
)
{
public
int
method
()
{
return
42
;
}
...
...
spring-boot-project/spring-boot-devtools/src/test/java/org/springframework/boot/devtools/filewatch/FileSystemWatcherTests.java
View file @
8102dc78
...
...
@@ -17,7 +17,6 @@
package
org
.
springframework
.
boot
.
devtools
.
filewatch
;
import
java.io.File
;
import
java.io.FileNotFoundException
;
import
java.io.FileOutputStream
;
import
java.io.IOException
;
import
java.time.Duration
;
...
...
@@ -297,7 +296,7 @@ public class FileSystemWatcherTests {
return
this
.
changes
.
get
(
0
);
}
private
File
touch
(
File
file
)
throws
FileNotFoundException
,
IOException
{
private
File
touch
(
File
file
)
throws
IOException
{
file
.
getParentFile
().
mkdirs
();
FileOutputStream
fileOutputStream
=
new
FileOutputStream
(
file
);
fileOutputStream
.
close
();
...
...
spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/OverrideAutoConfigurationEnabledFalseIntegrationTest.java
View file @
8102dc78
...
...
@@ -51,7 +51,7 @@ public class OverrideAutoConfigurationEnabledFalseIntegrationTest {
private
ApplicationContext
context
;
@Test
public
void
disabledAutoConfiguration
()
throws
Exception
{
public
void
disabledAutoConfiguration
()
{
ApplicationContext
context
=
this
.
context
;
assertThat
(
context
.
getBean
(
ExampleTestConfig
.
class
)).
isNotNull
();
this
.
thrown
.
expect
(
NoSuchBeanDefinitionException
.
class
);
...
...
spring-boot-project/spring-boot-test-autoconfigure/src/test/java/org/springframework/boot/test/autoconfigure/OverrideAutoConfigurationEnabledTrueIntegrationTest.java
View file @
8102dc78
...
...
@@ -45,7 +45,7 @@ public class OverrideAutoConfigurationEnabledTrueIntegrationTest {
private
ApplicationContext
context
;
@Test
public
void
autoConfiguredContext
()
throws
Exception
{
public
void
autoConfiguredContext
()
{
ApplicationContext
context
=
this
.
context
;
assertThat
(
context
.
getBean
(
ExampleSpringBootApplication
.
class
)).
isNotNull
();
assertThat
(
context
.
getBean
(
ConfigurationPropertiesBindingPostProcessor
.
class
))
...
...
spring-boot-project/spring-boot-test/src/test/java/org/springframework/boot/test/web/htmlunit/LocalHostWebClientTests.java
View file @
8102dc78
...
...
@@ -17,7 +17,6 @@
package
org
.
springframework
.
boot
.
test
.
web
.
htmlunit
;
import
java.io.IOException
;
import
java.net.MalformedURLException
;
import
java.net.URL
;
import
com.gargoylesoftware.htmlunit.StringWebResponse
;
...
...
@@ -91,10 +90,10 @@ public class LocalHostWebClientTests {
.
isEqualTo
(
new
URL
(
"http://localhost:8181/test"
));
}
private
WebConnection
mockConnection
()
throws
MalformedURLException
,
IOException
{
private
WebConnection
mockConnection
()
throws
IOException
{
WebConnection
connection
=
mock
(
WebConnection
.
class
);
WebResponse
response
=
new
StringWebResponse
(
"test"
,
new
URL
(
"http://localhost"
));
given
(
connection
.
getResponse
(
(
WebRequest
)
any
())).
willReturn
(
response
);
given
(
connection
.
getResponse
(
any
())).
willReturn
(
response
);
return
connection
;
}
...
...
spring-boot-project/spring-boot-tools/spring-boot-configuration-processor/src/test/java/org/springframework/boot/configurationprocessor/TestProject.java
View file @
8102dc78
...
...
@@ -17,14 +17,12 @@
package
org
.
springframework
.
boot
.
configurationprocessor
;
import
java.io.File
;
import
java.io.FileNotFoundException
;
import
java.io.FileReader
;
import
java.io.FileWriter
;
import
java.io.IOException
;
import
java.io.InputStream
;
import
java.io.InputStreamReader
;
import
java.io.StringReader
;
import
java.io.UnsupportedEncodingException
;
import
java.util.Arrays
;
import
java.util.HashSet
;
import
java.util.LinkedHashSet
;
...
...
@@ -194,7 +192,7 @@ public class TestProject {
}
private
static
void
putContents
(
File
targetFile
,
String
contents
)
throws
FileNotFoundException
,
IOException
,
UnsupportedEncoding
Exception
{
throws
IO
Exception
{
FileCopyUtils
.
copy
(
new
StringReader
(
contents
),
new
FileWriter
(
targetFile
));
}
...
...
spring-boot-project/spring-boot-tools/spring-boot-loader-tools/src/test/java/org/springframework/boot/loader/tools/TestJarFile.java
View file @
8102dc78
...
...
@@ -18,7 +18,6 @@ package org.springframework.boot.loader.tools;
import
java.io.File
;
import
java.io.FileInputStream
;
import
java.io.FileNotFoundException
;
import
java.io.FileOutputStream
;
import
java.io.IOException
;
import
java.io.InputStream
;
...
...
@@ -88,7 +87,7 @@ public class TestJarFile {
}
private
void
copyToFile
(
InputStream
inputStream
,
File
file
)
throws
FileNotFoundException
,
IOException
{
throws
IOException
{
try
(
OutputStream
outputStream
=
new
FileOutputStream
(
file
))
{
copy
(
inputStream
,
outputStream
);
}
...
...
spring-boot-project/spring-boot-tools/spring-boot-loader/src/test/java/org/springframework/boot/loader/TestJarCreator.java
View file @
8102dc78
...
...
@@ -55,7 +55,7 @@ public abstract class TestJarCreator {
}
private
static
void
writeNestedEntry
(
String
name
,
boolean
unpackNested
,
JarOutputStream
jarOutputStream
)
throws
Exception
,
IOException
{
JarOutputStream
jarOutputStream
)
throws
Exception
{
JarEntry
nestedEntry
=
new
JarEntry
(
name
);
byte
[]
nestedJarData
=
getNestedJarData
();
nestedEntry
.
setSize
(
nestedJarData
.
length
);
...
...
spring-boot-project/spring-boot/src/test/java/org/springframework/boot/web/embedded/tomcat/TomcatEmbeddedWebappClassLoaderTests.java
View file @
8102dc78
...
...
@@ -17,7 +17,6 @@
package
org
.
springframework
.
boot
.
web
.
embedded
.
tomcat
;
import
java.io.File
;
import
java.io.FileNotFoundException
;
import
java.io.FileOutputStream
;
import
java.io.IOException
;
import
java.net.URL
;
...
...
@@ -92,7 +91,7 @@ public class TomcatEmbeddedWebappClassLoaderTests {
return
"jar:file:"
+
war
.
getAbsolutePath
()
+
"!/WEB-INF/classes/"
;
}
private
File
createWar
()
throws
IOException
,
FileNotFoundException
{
private
File
createWar
()
throws
IOException
{
File
warFile
=
this
.
temp
.
newFile
(
"test.war"
);
try
(
JarOutputStream
warOut
=
new
JarOutputStream
(
new
FileOutputStream
(
warFile
)))
{
...
...
spring-boot-tests/spring-boot-integration-tests/spring-boot-server-tests/src/test/java/org/springframework/boot/context/embedded/ApplicationBuilder.java
View file @
8102dc78
...
...
@@ -17,7 +17,6 @@
package
org
.
springframework
.
boot
.
context
.
embedded
;
import
java.io.File
;
import
java.io.FileNotFoundException
;
import
java.io.FileOutputStream
;
import
java.io.FileReader
;
import
java.io.FileWriter
;
...
...
@@ -71,7 +70,7 @@ class ApplicationBuilder {
}
private
File
doBuildApplication
(
File
containerFolder
)
throws
IOException
,
FileNotFoundException
,
MavenInvocationException
{
throws
IOException
,
MavenInvocationException
{
File
resourcesJar
=
createResourcesJar
();
File
appFolder
=
new
File
(
containerFolder
,
"app"
);
appFolder
.
mkdirs
();
...
...
@@ -81,7 +80,7 @@ class ApplicationBuilder {
return
new
File
(
appFolder
,
"target/app-0.0.1."
+
this
.
packaging
);
}
private
File
createResourcesJar
()
throws
IOException
,
FileNotFoundException
{
private
File
createResourcesJar
()
throws
IOException
{
File
resourcesJar
=
new
File
(
this
.
temp
.
getRoot
(),
"resources.jar"
);
if
(
resourcesJar
.
exists
())
{
return
resourcesJar
;
...
...
@@ -99,7 +98,7 @@ class ApplicationBuilder {
}
private
void
writePom
(
File
appFolder
,
File
resourcesJar
)
throws
FileNotFoundException
,
IOException
{
throws
IOException
{
Map
<
String
,
Object
>
context
=
new
HashMap
<>();
context
.
put
(
"packaging"
,
this
.
packaging
);
context
.
put
(
"container"
,
this
.
container
);
...
...
spring-boot-tests/spring-boot-integration-tests/spring-boot-server-tests/src/test/java/org/springframework/boot/context/embedded/EmbeddedServletContainerJarDevelopmentIntegrationTests.java
View file @
8102dc78
...
...
@@ -50,15 +50,14 @@ public class EmbeddedServletContainerJarDevelopmentIntegrationTests
}
@Test
public
void
metaInfResourceFromDependencyIsAvailableViaHttp
()
throws
Exception
{
public
void
metaInfResourceFromDependencyIsAvailableViaHttp
()
{
ResponseEntity
<
String
>
entity
=
this
.
rest
.
getForEntity
(
"/nested-meta-inf-resource.txt"
,
String
.
class
);
assertThat
(
entity
.
getStatusCode
()).
isEqualTo
(
HttpStatus
.
OK
);
}
@Test
public
void
metaInfResourceFromDependencyIsAvailableViaServletContext
()
throws
Exception
{
public
void
metaInfResourceFromDependencyIsAvailableViaServletContext
()
{
ResponseEntity
<
String
>
entity
=
this
.
rest
.
getForEntity
(
"/servletContext?/nested-meta-inf-resource.txt"
,
String
.
class
);
assertThat
(
entity
.
getStatusCode
()).
isEqualTo
(
HttpStatus
.
OK
);
...
...
spring-boot-tests/spring-boot-integration-tests/spring-boot-server-tests/src/test/java/org/springframework/boot/context/embedded/EmbeddedServletContainerJarPackagingIntegrationTests.java
View file @
8102dc78
...
...
@@ -51,28 +51,28 @@ public class EmbeddedServletContainerJarPackagingIntegrationTests
}
@Test
public
void
nestedMetaInfResourceIsAvailableViaHttp
()
throws
Exception
{
public
void
nestedMetaInfResourceIsAvailableViaHttp
()
{
ResponseEntity
<
String
>
entity
=
this
.
rest
.
getForEntity
(
"/nested-meta-inf-resource.txt"
,
String
.
class
);
assertThat
(
entity
.
getStatusCode
()).
isEqualTo
(
HttpStatus
.
OK
);
}
@Test
public
void
nestedMetaInfResourceIsAvailableViaServletContext
()
throws
Exception
{
public
void
nestedMetaInfResourceIsAvailableViaServletContext
()
{
ResponseEntity
<
String
>
entity
=
this
.
rest
.
getForEntity
(
"/servletContext?/nested-meta-inf-resource.txt"
,
String
.
class
);
assertThat
(
entity
.
getStatusCode
()).
isEqualTo
(
HttpStatus
.
OK
);
}
@Test
public
void
nestedJarIsNotAvailableViaHttp
()
throws
Exception
{
public
void
nestedJarIsNotAvailableViaHttp
()
{
ResponseEntity
<
String
>
entity
=
this
.
rest
.
getForEntity
(
"/BOOT-INF/lib/resources-1.0.jar"
,
String
.
class
);
assertThat
(
entity
.
getStatusCode
()).
isEqualTo
(
HttpStatus
.
NOT_FOUND
);
}
@Test
public
void
applicationClassesAreNotAvailableViaHttp
()
throws
Exception
{
public
void
applicationClassesAreNotAvailableViaHttp
()
{
ResponseEntity
<
String
>
entity
=
this
.
rest
.
getForEntity
(
"/BOOT-INF/classes/com/example/ResourceHandlingApplication.class"
,
String
.
class
);
...
...
@@ -80,7 +80,7 @@ public class EmbeddedServletContainerJarPackagingIntegrationTests
}
@Test
public
void
launcherIsNotAvailableViaHttp
()
throws
Exception
{
public
void
launcherIsNotAvailableViaHttp
()
{
ResponseEntity
<
String
>
entity
=
this
.
rest
.
getForEntity
(
"/org/springframework/boot/loader/Launcher.class"
,
String
.
class
);
assertThat
(
entity
.
getStatusCode
()).
isEqualTo
(
HttpStatus
.
NOT_FOUND
);
...
...
spring-boot-tests/spring-boot-integration-tests/spring-boot-server-tests/src/test/java/org/springframework/boot/context/embedded/EmbeddedServletContainerWarDevelopmentIntegrationTests.java
View file @
8102dc78
...
...
@@ -50,22 +50,21 @@ public class EmbeddedServletContainerWarDevelopmentIntegrationTests
}
@Test
public
void
metaInfResourceFromDependencyIsAvailableViaHttp
()
throws
Exception
{
public
void
metaInfResourceFromDependencyIsAvailableViaHttp
()
{
ResponseEntity
<
String
>
entity
=
this
.
rest
.
getForEntity
(
"/nested-meta-inf-resource.txt"
,
String
.
class
);
assertThat
(
entity
.
getStatusCode
()).
isEqualTo
(
HttpStatus
.
OK
);
}
@Test
public
void
metaInfResourceFromDependencyIsAvailableViaServletContext
()
throws
Exception
{
public
void
metaInfResourceFromDependencyIsAvailableViaServletContext
()
{
ResponseEntity
<
String
>
entity
=
this
.
rest
.
getForEntity
(
"/servletContext?/nested-meta-inf-resource.txt"
,
String
.
class
);
assertThat
(
entity
.
getStatusCode
()).
isEqualTo
(
HttpStatus
.
OK
);
}
@Test
public
void
webappResourcesAreAvailableViaHttp
()
throws
Exception
{
public
void
webappResourcesAreAvailableViaHttp
()
{
ResponseEntity
<
String
>
entity
=
this
.
rest
.
getForEntity
(
"/webapp-resource.txt"
,
String
.
class
);
assertThat
(
entity
.
getStatusCode
()).
isEqualTo
(
HttpStatus
.
OK
);
...
...
spring-boot-tests/spring-boot-integration-tests/spring-boot-server-tests/src/test/java/org/springframework/boot/context/embedded/EmbeddedServletContainerWarPackagingIntegrationTests.java
View file @
8102dc78
...
...
@@ -51,28 +51,28 @@ public class EmbeddedServletContainerWarPackagingIntegrationTests
}
@Test
public
void
nestedMetaInfResourceIsAvailableViaHttp
()
throws
Exception
{
public
void
nestedMetaInfResourceIsAvailableViaHttp
()
{
ResponseEntity
<
String
>
entity
=
this
.
rest
.
getForEntity
(
"/nested-meta-inf-resource.txt"
,
String
.
class
);
assertThat
(
entity
.
getStatusCode
()).
isEqualTo
(
HttpStatus
.
OK
);
}
@Test
public
void
nestedMetaInfResourceIsAvailableViaServletContext
()
throws
Exception
{
public
void
nestedMetaInfResourceIsAvailableViaServletContext
()
{
ResponseEntity
<
String
>
entity
=
this
.
rest
.
getForEntity
(
"/servletContext?/nested-meta-inf-resource.txt"
,
String
.
class
);
assertThat
(
entity
.
getStatusCode
()).
isEqualTo
(
HttpStatus
.
OK
);
}
@Test
public
void
nestedJarIsNotAvailableViaHttp
()
throws
Exception
{
public
void
nestedJarIsNotAvailableViaHttp
()
{
ResponseEntity
<
String
>
entity
=
this
.
rest
.
getForEntity
(
"/WEB-INF/lib/resources-1.0.jar"
,
String
.
class
);
assertThat
(
entity
.
getStatusCode
()).
isEqualTo
(
HttpStatus
.
NOT_FOUND
);
}
@Test
public
void
applicationClassesAreNotAvailableViaHttp
()
throws
Exception
{
public
void
applicationClassesAreNotAvailableViaHttp
()
{
ResponseEntity
<
String
>
entity
=
this
.
rest
.
getForEntity
(
"/WEB-INF/classes/com/example/ResourceHandlingApplication.class"
,
String
.
class
);
...
...
@@ -80,14 +80,14 @@ public class EmbeddedServletContainerWarPackagingIntegrationTests
}
@Test
public
void
webappResourcesAreAvailableViaHttp
()
throws
Exception
{
public
void
webappResourcesAreAvailableViaHttp
()
{
ResponseEntity
<
String
>
entity
=
this
.
rest
.
getForEntity
(
"/webapp-resource.txt"
,
String
.
class
);
assertThat
(
entity
.
getStatusCode
()).
isEqualTo
(
HttpStatus
.
OK
);
}
@Test
public
void
loaderClassesAreNotAvailableViaHttp
()
throws
Exception
{
public
void
loaderClassesAreNotAvailableViaHttp
()
{
ResponseEntity
<
String
>
entity
=
this
.
rest
.
getForEntity
(
"/org/springframework/boot/loader/Launcher.class"
,
String
.
class
);
assertThat
(
entity
.
getStatusCode
()).
isEqualTo
(
HttpStatus
.
NOT_FOUND
);
...
...
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