fix MockitoJUnitRunner deprecated import

This commit is contained in:
DOHA 2018-10-13 01:47:27 +03:00
parent a295224159
commit ac8742cfff
6 changed files with 41 additions and 34 deletions

View File

@ -1,11 +1,11 @@
package com.baeldung.nth.root.calculator;
import static org.junit.Assert.assertEquals;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.InjectMocks;
import org.mockito.runners.MockitoJUnitRunner;
import static org.junit.Assert.assertEquals;
import org.mockito.junit.MockitoJUnitRunner;
@RunWith(MockitoJUnitRunner.class)
public class NthRootCalculatorUnitTest {

View File

@ -1,17 +1,18 @@
package com.baeldung.app.rest;
import com.baeldung.app.api.Flower;
import com.baeldung.domain.service.FlowerService;
import static org.mockito.ArgumentMatchers.anyInt;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.when;
import org.junit.Assert;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.runners.MockitoJUnitRunner;
import org.mockito.junit.MockitoJUnitRunner;
import static org.mockito.Matchers.anyInt;
import static org.mockito.Matchers.eq;
import static org.mockito.Mockito.when;
import com.baeldung.app.api.Flower;
import com.baeldung.domain.service.FlowerService;
@RunWith(MockitoJUnitRunner.class)
public class FlowerControllerUnitTest {

View File

@ -1,18 +1,19 @@
package com.baeldung.app.rest;
import static org.mockito.Mockito.times;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.ArgumentMatchers;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.junit.MockitoJUnitRunner;
import com.baeldung.app.api.MessageApi;
import com.baeldung.domain.model.Message;
import com.baeldung.domain.service.MessageService;
import com.baeldung.domain.util.MessageMatcher;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.InjectMocks;
import org.mockito.Matchers;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.runners.MockitoJUnitRunner;
import static org.mockito.Mockito.times;
@RunWith(MockitoJUnitRunner.class)
public class MessageControllerUnitTest {
@ -37,6 +38,6 @@ public class MessageControllerUnitTest {
message.setTo("you");
message.setText("Hello, you!");
Mockito.verify(messageService, times(1)).deliverMessage(Matchers.argThat(new MessageMatcher(message)));
Mockito.verify(messageService, times(1)).deliverMessage(ArgumentMatchers.argThat(new MessageMatcher(message)));
}
}

View File

@ -4,10 +4,7 @@ import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.runners.MockitoJUnitRunner;
import com.baeldung.propertyeditor.creditcard.CreditCard;
import com.baeldung.propertyeditor.creditcard.CreditCardEditor;
import org.mockito.junit.MockitoJUnitRunner;
@RunWith(MockitoJUnitRunner.class)
public class CreditCardEditorUnitTest {

View File

@ -1,15 +1,15 @@
package org.baeldung.mockito;
import static org.junit.Assert.assertEquals;
import java.util.ArrayList;
import java.util.List;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mockito;
import org.mockito.Spy;
import org.mockito.runners.MockitoJUnitRunner;
import java.util.ArrayList;
import java.util.List;
import static org.junit.Assert.assertEquals;
import org.mockito.junit.MockitoJUnitRunner;
@RunWith(MockitoJUnitRunner.class)
public class MockitoSpyIntegrationTest {

View File

@ -1,14 +1,22 @@
package org.baeldung.mockito;
import static org.junit.Assert.assertEquals;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.isA;
import static org.mockito.ArgumentMatchers.isNull;
import static org.mockito.Mockito.doAnswer;
import static org.mockito.Mockito.doCallRealMethod;
import static org.mockito.Mockito.doNothing;
import static org.mockito.Mockito.doThrow;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.times;
import static org.mockito.Mockito.verify;
import org.junit.Test;
import org.junit.runner.RunWith;
import static org.junit.Assert.assertEquals;
import static org.mockito.Mockito.*;
import org.mockito.ArgumentCaptor;
import static org.mockito.Matchers.any;
import org.mockito.junit.MockitoJUnitRunner;
import org.mockito.stubbing.Answer;
import org.mockito.runners.MockitoJUnitRunner;
@RunWith(MockitoJUnitRunner.class)
public class MockitoVoidMethodsUnitTest {