Skip to content

Commit c5bb5d6

Browse files
committed
Polish ViewResolutionTests
1 parent c212255 commit c5bb5d6

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

spring-test/src/test/java/org/springframework/test/web/servlet/samples/standalone/ViewResolutionTests.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2019 the original author or authors.
2+
* Copyright 2002-2020 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -54,10 +54,10 @@
5454
*
5555
* @author Rossen Stoyanchev
5656
*/
57-
public class ViewResolutionTests {
57+
class ViewResolutionTests {
5858

5959
@Test
60-
public void testJspOnly() throws Exception {
60+
void jspOnly() throws Exception {
6161
InternalResourceViewResolver viewResolver = new InternalResourceViewResolver("/WEB-INF/", ".jsp");
6262

6363
standaloneSetup(new PersonController()).setViewResolvers(viewResolver).build()
@@ -69,7 +69,7 @@ public void testJspOnly() throws Exception {
6969
}
7070

7171
@Test
72-
public void testJsonOnly() throws Exception {
72+
void jsonOnly() throws Exception {
7373
standaloneSetup(new PersonController()).setSingleView(new MappingJackson2JsonView()).build()
7474
.perform(get("/person/Corea"))
7575
.andExpect(status().isOk())
@@ -78,7 +78,7 @@ public void testJsonOnly() throws Exception {
7878
}
7979

8080
@Test
81-
public void testXmlOnly() throws Exception {
81+
void xmlOnly() throws Exception {
8282
Jaxb2Marshaller marshaller = new Jaxb2Marshaller();
8383
marshaller.setClassesToBeBound(Person.class);
8484

@@ -90,7 +90,7 @@ public void testXmlOnly() throws Exception {
9090
}
9191

9292
@Test
93-
public void testContentNegotiation() throws Exception {
93+
void contentNegotiation() throws Exception {
9494
Jaxb2Marshaller marshaller = new Jaxb2Marshaller();
9595
marshaller.setClassesToBeBound(Person.class);
9696

@@ -129,7 +129,7 @@ public void testContentNegotiation() throws Exception {
129129
}
130130

131131
@Test
132-
public void defaultViewResolver() throws Exception {
132+
void defaultViewResolver() throws Exception {
133133
standaloneSetup(new PersonController()).build()
134134
.perform(get("/person/Corea"))
135135
.andExpect(model().attribute("person", hasProperty("name", equalTo("Corea"))))
@@ -142,7 +142,7 @@ public void defaultViewResolver() throws Exception {
142142
private static class PersonController {
143143

144144
@GetMapping("/person/{name}")
145-
public String show(@PathVariable String name, Model model) {
145+
String show(@PathVariable String name, Model model) {
146146
Person person = new Person(name);
147147
model.addAttribute(person);
148148
return "person/show";

0 commit comments

Comments
 (0)