Merge pull request #20926 from dreis2211

* pr/20926:
  Remove unused fields in tests

Closes gh-20926
pull/20931/head
Stephane Nicoll 5 years ago
commit 04368107cc

@ -1,5 +1,5 @@
/* /*
* Copyright 2012-2019 the original author or authors. * Copyright 2012-2020 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -18,12 +18,10 @@ package org.springframework.boot.actuate.mongo;
import com.mongodb.MongoException; import com.mongodb.MongoException;
import org.bson.Document; import org.bson.Document;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import org.springframework.boot.actuate.health.Health; import org.springframework.boot.actuate.health.Health;
import org.springframework.boot.actuate.health.Status; import org.springframework.boot.actuate.health.Status;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.data.mongodb.core.MongoTemplate; import org.springframework.data.mongodb.core.MongoTemplate;
import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThat;
@ -38,15 +36,6 @@ import static org.mockito.Mockito.verify;
*/ */
class MongoHealthIndicatorTests { class MongoHealthIndicatorTests {
private AnnotationConfigApplicationContext context;
@AfterEach
void close() {
if (this.context != null) {
this.context.close();
}
}
@Test @Test
void mongoIsUp() { void mongoIsUp() {
Document commandResult = mock(Document.class); Document commandResult = mock(Document.class);

@ -1,5 +1,5 @@
/* /*
* Copyright 2012-2019 the original author or authors. * Copyright 2012-2020 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -23,12 +23,10 @@ import org.apache.solr.client.solrj.impl.BaseHttpSolrClient.RemoteSolrException;
import org.apache.solr.client.solrj.request.CoreAdminRequest; import org.apache.solr.client.solrj.request.CoreAdminRequest;
import org.apache.solr.client.solrj.response.SolrPingResponse; import org.apache.solr.client.solrj.response.SolrPingResponse;
import org.apache.solr.common.util.NamedList; import org.apache.solr.common.util.NamedList;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import org.springframework.boot.actuate.health.Health; import org.springframework.boot.actuate.health.Health;
import org.springframework.boot.actuate.health.Status; import org.springframework.boot.actuate.health.Status;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.any;
@ -48,15 +46,6 @@ import static org.mockito.Mockito.verifyNoMoreInteractions;
*/ */
class SolrHealthIndicatorTests { class SolrHealthIndicatorTests {
private AnnotationConfigApplicationContext context;
@AfterEach
void close() {
if (this.context != null) {
this.context.close();
}
}
@Test @Test
void healthWhenSolrStatusUpAndBaseUrlPointsToRootReturnsUp() throws Exception { void healthWhenSolrStatusUpAndBaseUrlPointsToRootReturnsUp() throws Exception {
SolrClient solrClient = mock(SolrClient.class); SolrClient solrClient = mock(SolrClient.class);

@ -368,12 +368,6 @@ class DockerApiTests {
private VolumeApi api; private VolumeApi api;
@Captor
private ArgumentCaptor<IOConsumer<OutputStream>> writer;
@Mock
private UpdateListener<LogUpdateEvent> logListener;
@BeforeEach @BeforeEach
void setup() { void setup() {
MockitoAnnotations.initMocks(this); MockitoAnnotations.initMocks(this);

Loading…
Cancel
Save