Skip to content

Commit 0436810

Browse files
committed
Merge pull request #20926 from dreis2211
* pr/20926: Remove unused fields in tests Closes gh-20926
2 parents ce65305 + 4b9986d commit 0436810

File tree

3 files changed

+2
-30
lines changed

3 files changed

+2
-30
lines changed

spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/mongo/MongoHealthIndicatorTests.java

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2019 the original author or authors.
2+
* Copyright 2012-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.
@@ -18,12 +18,10 @@
1818

1919
import com.mongodb.MongoException;
2020
import org.bson.Document;
21-
import org.junit.jupiter.api.AfterEach;
2221
import org.junit.jupiter.api.Test;
2322

2423
import org.springframework.boot.actuate.health.Health;
2524
import org.springframework.boot.actuate.health.Status;
26-
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
2725
import org.springframework.data.mongodb.core.MongoTemplate;
2826

2927
import static org.assertj.core.api.Assertions.assertThat;
@@ -38,15 +36,6 @@
3836
*/
3937
class MongoHealthIndicatorTests {
4038

41-
private AnnotationConfigApplicationContext context;
42-
43-
@AfterEach
44-
void close() {
45-
if (this.context != null) {
46-
this.context.close();
47-
}
48-
}
49-
5039
@Test
5140
void mongoIsUp() {
5241
Document commandResult = mock(Document.class);

spring-boot-project/spring-boot-actuator/src/test/java/org/springframework/boot/actuate/solr/SolrHealthIndicatorTests.java

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2019 the original author or authors.
2+
* Copyright 2012-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.
@@ -23,12 +23,10 @@
2323
import org.apache.solr.client.solrj.request.CoreAdminRequest;
2424
import org.apache.solr.client.solrj.response.SolrPingResponse;
2525
import org.apache.solr.common.util.NamedList;
26-
import org.junit.jupiter.api.AfterEach;
2726
import org.junit.jupiter.api.Test;
2827

2928
import org.springframework.boot.actuate.health.Health;
3029
import org.springframework.boot.actuate.health.Status;
31-
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
3230

3331
import static org.assertj.core.api.Assertions.assertThat;
3432
import static org.mockito.ArgumentMatchers.any;
@@ -48,15 +46,6 @@
4846
*/
4947
class SolrHealthIndicatorTests {
5048

51-
private AnnotationConfigApplicationContext context;
52-
53-
@AfterEach
54-
void close() {
55-
if (this.context != null) {
56-
this.context.close();
57-
}
58-
}
59-
6049
@Test
6150
void healthWhenSolrStatusUpAndBaseUrlPointsToRootReturnsUp() throws Exception {
6251
SolrClient solrClient = mock(SolrClient.class);

spring-boot-project/spring-boot-tools/spring-boot-buildpack-platform/src/test/java/org/springframework/boot/buildpack/platform/docker/DockerApiTests.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -368,12 +368,6 @@ class VolumeDockerApiTests {
368368

369369
private VolumeApi api;
370370

371-
@Captor
372-
private ArgumentCaptor<IOConsumer<OutputStream>> writer;
373-
374-
@Mock
375-
private UpdateListener<LogUpdateEvent> logListener;
376-
377371
@BeforeEach
378372
void setup() {
379373
MockitoAnnotations.initMocks(this);

0 commit comments

Comments
 (0)