Fix compiler warnings

This commit is contained in:
Andy Wilkinson
2016-04-04 13:26:41 +01:00
parent 83e8b92c3b
commit feb2f352f6
22 changed files with 77 additions and 47 deletions

View File

@@ -37,6 +37,7 @@ public class CustomDefaultSnippets {
@Autowired
private WebApplicationContext context;
@SuppressWarnings("unused")
private MockMvc mockMvc;
@Before

View File

@@ -20,7 +20,6 @@ import org.junit.Before;
import org.junit.Rule;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.restdocs.JUnitRestDocumentation;
import org.springframework.restdocs.RestDocumentation;
import org.springframework.test.web.servlet.MockMvc;
import org.springframework.test.web.servlet.setup.MockMvcBuilders;
import org.springframework.web.context.WebApplicationContext;
@@ -35,6 +34,7 @@ public class CustomEncoding {
@Autowired
private WebApplicationContext context;
@SuppressWarnings("unused")
private MockMvc mockMvc;
@Before

View File

@@ -20,7 +20,6 @@ import org.junit.Before;
import org.junit.Rule;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.restdocs.JUnitRestDocumentation;
import org.springframework.restdocs.RestDocumentation;
import org.springframework.restdocs.templates.TemplateFormats;
import org.springframework.test.web.servlet.MockMvc;
import org.springframework.test.web.servlet.setup.MockMvcBuilders;
@@ -36,6 +35,7 @@ public class CustomFormat {
@Autowired
private WebApplicationContext context;
@SuppressWarnings("unused")
private MockMvc mockMvc;
@Before

View File

@@ -20,7 +20,6 @@ import org.junit.Before;
import org.junit.Rule;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.restdocs.JUnitRestDocumentation;
import org.springframework.restdocs.RestDocumentation;
import org.springframework.test.web.servlet.MockMvc;
import org.springframework.test.web.servlet.setup.MockMvcBuilders;
import org.springframework.web.context.WebApplicationContext;
@@ -35,6 +34,7 @@ public class CustomUriConfiguration {
@Autowired
private WebApplicationContext context;
@SuppressWarnings("unused")
private MockMvc mockMvc;
@Before

View File

@@ -19,7 +19,6 @@ package com.example.mockmvc;
import org.junit.Before;
import org.junit.Rule;
import org.springframework.restdocs.JUnitRestDocumentation;
import org.springframework.restdocs.RestDocumentation;
import org.springframework.restdocs.mockmvc.RestDocumentationResultHandler;
import org.springframework.test.web.servlet.MockMvc;
import org.springframework.test.web.servlet.setup.MockMvcBuilders;

View File

@@ -32,12 +32,13 @@ public class ExampleApplicationTestNgTests {
public final ManualRestDocumentation restDocumentation = new ManualRestDocumentation(
"target/generated-snippets");
@SuppressWarnings("unused")
// tag::setup[]
private MockMvc mockMvc;
@Autowired
private WebApplicationContext context;
private MockMvc mockMvc;
@BeforeMethod
public void setUp(Method method) {
this.mockMvc = MockMvcBuilders.webAppContextSetup(this.context)

View File

@@ -18,6 +18,7 @@ package com.example.mockmvc;
import org.junit.Before;
import org.junit.Rule;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.restdocs.JUnitRestDocumentation;
import org.springframework.test.web.servlet.MockMvc;
@@ -31,12 +32,14 @@ public class ExampleApplicationTests {
@Rule
public final JUnitRestDocumentation restDocumentation = new JUnitRestDocumentation(
"target/generated-snippets");
@SuppressWarnings("unused")
// tag::setup[]
private MockMvc mockMvc;
@Autowired
private WebApplicationContext context;
private MockMvc mockMvc;
@Before
public void setUp() {
this.mockMvc = MockMvcBuilders.webAppContextSetup(this.context)

View File

@@ -19,7 +19,6 @@ package com.example.mockmvc;
import org.junit.Before;
import org.junit.Rule;
import org.springframework.restdocs.JUnitRestDocumentation;
import org.springframework.restdocs.RestDocumentation;
import org.springframework.test.web.servlet.MockMvc;
import org.springframework.test.web.servlet.setup.MockMvcBuilders;
import org.springframework.web.context.WebApplicationContext;
@@ -32,6 +31,7 @@ public class ParameterizedOutput {
@Rule
public final JUnitRestDocumentation restDocumentation = new JUnitRestDocumentation("build");
@SuppressWarnings("unused")
private MockMvc mockMvc;
private WebApplicationContext context;

View File

@@ -32,6 +32,7 @@ public class CustomDefaultSnippets {
public final JUnitRestDocumentation restDocumentation = new JUnitRestDocumentation(
"build");
@SuppressWarnings("unused")
private RequestSpecification spec;
@Before

View File

@@ -19,7 +19,6 @@ package com.example.restassured;
import org.junit.Before;
import org.junit.Rule;
import org.springframework.restdocs.JUnitRestDocumentation;
import org.springframework.restdocs.RestDocumentation;
import com.jayway.restassured.builder.RequestSpecBuilder;
import com.jayway.restassured.specification.RequestSpecification;
@@ -31,6 +30,7 @@ public class CustomEncoding {
@Rule
public final JUnitRestDocumentation restDocumentation = new JUnitRestDocumentation("build");
@SuppressWarnings("unused")
private RequestSpecification spec;
@Before

View File

@@ -19,7 +19,6 @@ package com.example.restassured;
import org.junit.Before;
import org.junit.Rule;
import org.springframework.restdocs.JUnitRestDocumentation;
import org.springframework.restdocs.RestDocumentation;
import org.springframework.restdocs.templates.TemplateFormats;
import com.jayway.restassured.builder.RequestSpecBuilder;
@@ -31,7 +30,8 @@ public class CustomFormat {
@Rule
public final JUnitRestDocumentation restDocumentation = new JUnitRestDocumentation("build");
@SuppressWarnings("unused")
private RequestSpecification spec;
@Before

View File

@@ -19,7 +19,6 @@ package com.example.restassured;
import org.junit.Before;
import org.junit.Rule;
import org.springframework.restdocs.JUnitRestDocumentation;
import org.springframework.restdocs.RestDocumentation;
import org.springframework.restdocs.restassured.RestDocumentationFilter;
import com.jayway.restassured.RestAssured;

View File

@@ -32,6 +32,7 @@ public class ExampleApplicationTestNgTests {
private final ManualRestDocumentation restDocumentation = new ManualRestDocumentation(
"build/generated-snippets");
@SuppressWarnings("unused")
// tag::setup[]
private RequestSpecification spec;

View File

@@ -19,7 +19,6 @@ package com.example.restassured;
import org.junit.Before;
import org.junit.Rule;
import org.springframework.restdocs.JUnitRestDocumentation;
import org.springframework.restdocs.RestDocumentation;
import com.jayway.restassured.builder.RequestSpecBuilder;
import com.jayway.restassured.specification.RequestSpecification;
@@ -32,6 +31,7 @@ public class ExampleApplicationTests {
public final JUnitRestDocumentation restDocumentation = new JUnitRestDocumentation(
"build/generated-snippets");
@SuppressWarnings("unused")
// tag::setup[]
private RequestSpecification spec;

View File

@@ -19,7 +19,6 @@ package com.example.restassured;
import org.junit.Before;
import org.junit.Rule;
import org.springframework.restdocs.JUnitRestDocumentation;
import org.springframework.restdocs.RestDocumentation;
import com.jayway.restassured.builder.RequestSpecBuilder;
import com.jayway.restassured.specification.RequestSpecification;
@@ -33,6 +32,7 @@ public class ParameterizedOutput {
public final JUnitRestDocumentation restDocumentation = new JUnitRestDocumentation(
"build/generated-snippets");
@SuppressWarnings("unused")
private RequestSpecification spec;
// tag::parameterized-output[]