Make fields final
Closes gh-33537
This commit is contained in:
@@ -32,7 +32,7 @@ import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException
|
||||
*/
|
||||
class AnnotatedClassFinderTests {
|
||||
|
||||
private AnnotatedClassFinder finder = new AnnotatedClassFinder(SpringBootConfiguration.class);
|
||||
private final AnnotatedClassFinder finder = new AnnotatedClassFinder(SpringBootConfiguration.class);
|
||||
|
||||
@Test
|
||||
void findFromClassWhenSourceIsNullShouldThrowException() {
|
||||
|
||||
@@ -41,7 +41,7 @@ import static org.mockito.Mockito.mock;
|
||||
*/
|
||||
class ImportsContextCustomizerFactoryTests {
|
||||
|
||||
private ImportsContextCustomizerFactory factory = new ImportsContextCustomizerFactory();
|
||||
private final ImportsContextCustomizerFactory factory = new ImportsContextCustomizerFactory();
|
||||
|
||||
@Test
|
||||
void getContextCustomizerWhenHasNoImportAnnotationShouldReturnNull() {
|
||||
|
||||
@@ -44,7 +44,7 @@ class ApplicationContextAssertTests {
|
||||
|
||||
private StaticApplicationContext context;
|
||||
|
||||
private RuntimeException failure = new RuntimeException();
|
||||
private final RuntimeException failure = new RuntimeException();
|
||||
|
||||
@BeforeEach
|
||||
void setup() {
|
||||
|
||||
@@ -35,9 +35,9 @@ import static org.assertj.core.api.Assertions.assertThat;
|
||||
*/
|
||||
class TestTypeExcludeFilterTests {
|
||||
|
||||
private TestTypeExcludeFilter filter = new TestTypeExcludeFilter();
|
||||
private final TestTypeExcludeFilter filter = new TestTypeExcludeFilter();
|
||||
|
||||
private MetadataReaderFactory metadataReaderFactory = new SimpleMetadataReaderFactory();
|
||||
private final MetadataReaderFactory metadataReaderFactory = new SimpleMetadataReaderFactory();
|
||||
|
||||
@Test
|
||||
void matchesJUnit4TestClass() throws Exception {
|
||||
|
||||
@@ -40,7 +40,7 @@ class BasicJsonTesterTests {
|
||||
|
||||
private static final String JSON = "{\"spring\":[\"boot\",\"framework\"]}";
|
||||
|
||||
private BasicJsonTester json = new BasicJsonTester(getClass());
|
||||
private final BasicJsonTester json = new BasicJsonTester(getClass());
|
||||
|
||||
@Test
|
||||
void createWhenResourceLoadClassIsNullShouldThrowException() {
|
||||
|
||||
@@ -60,7 +60,7 @@ class JsonContentAssertTests {
|
||||
|
||||
private static final String NULLS = loadJson("nulls.json");
|
||||
|
||||
private static JSONComparator COMPARATOR = new DefaultComparator(JSONCompareMode.LENIENT);
|
||||
private static final JSONComparator COMPARATOR = new DefaultComparator(JSONCompareMode.LENIENT);
|
||||
|
||||
@TempDir
|
||||
public Path tempDir;
|
||||
|
||||
@@ -39,7 +39,7 @@ import static org.assertj.core.api.Assertions.assertThatIllegalStateException;
|
||||
*/
|
||||
class DefinitionsParserTests {
|
||||
|
||||
private DefinitionsParser parser = new DefinitionsParser();
|
||||
private final DefinitionsParser parser = new DefinitionsParser();
|
||||
|
||||
@Test
|
||||
void parseSingleMockBean() {
|
||||
|
||||
@@ -45,7 +45,7 @@ import static org.mockito.Mockito.mock;
|
||||
@ExtendWith(MockitoExtension.class)
|
||||
class MockitoTestExecutionListenerTests {
|
||||
|
||||
private MockitoTestExecutionListener listener = new MockitoTestExecutionListener();
|
||||
private final MockitoTestExecutionListener listener = new MockitoTestExecutionListener();
|
||||
|
||||
@Mock
|
||||
private ApplicationContext applicationContext;
|
||||
|
||||
@@ -43,7 +43,7 @@ class OutputCaptureTests {
|
||||
|
||||
private TestPrintStream systemErr;
|
||||
|
||||
private TestOutputCapture output = new TestOutputCapture();
|
||||
private final TestOutputCapture output = new TestOutputCapture();
|
||||
|
||||
@BeforeEach
|
||||
void replaceSystemStreams() {
|
||||
|
||||
@@ -39,7 +39,7 @@ import static org.assertj.core.api.Assertions.assertThatIllegalArgumentException
|
||||
*/
|
||||
class SpringBootTestRandomPortEnvironmentPostProcessorTests {
|
||||
|
||||
private SpringBootTestRandomPortEnvironmentPostProcessor postProcessor = new SpringBootTestRandomPortEnvironmentPostProcessor();
|
||||
private final SpringBootTestRandomPortEnvironmentPostProcessor postProcessor = new SpringBootTestRandomPortEnvironmentPostProcessor();
|
||||
|
||||
private MockEnvironment environment;
|
||||
|
||||
|
||||
@@ -53,7 +53,7 @@ import static org.springframework.test.web.client.response.MockRestResponseCreat
|
||||
@ExtendWith(MockitoExtension.class)
|
||||
class RootUriRequestExpectationManagerTests {
|
||||
|
||||
private String uri = "https://example.com";
|
||||
private final String uri = "https://example.com";
|
||||
|
||||
@Mock
|
||||
private RequestExpectationManager delegate;
|
||||
|
||||
Reference in New Issue
Block a user