Revision 45126
Added by Claudio Atzori over 7 years ago
CompatPendingResourceManagerImplTest.java | ||
---|---|---|
3 | 3 |
import static org.junit.Assert.assertEquals; |
4 | 4 |
import static org.junit.Assert.assertNotNull; |
5 | 5 |
import static org.junit.Assert.assertNull; |
6 |
import static org.mockito.ArgumentMatchers.any; |
|
6 | 7 |
import static org.mockito.Matchers.anyObject; |
7 | 8 |
import static org.mockito.Matchers.anyString; |
8 | 9 |
import static org.mockito.Matchers.eq; |
... | ... | |
15 | 16 |
import org.junit.Test; |
16 | 17 |
import org.junit.runner.RunWith; |
17 | 18 |
import org.mockito.Mock; |
18 |
import org.mockito.runners.MockitoJUnit44Runner;
|
|
19 |
import org.mockito.junit.MockitoJUnitRunner;
|
|
19 | 20 |
|
20 | 21 |
import eu.dnetlib.enabling.is.registry.rmi.ISRegistryException; |
21 | 22 |
import eu.dnetlib.enabling.is.registry.rmi.ISRegistryService; |
... | ... | |
30 | 31 |
* @author marko |
31 | 32 |
* |
32 | 33 |
*/ |
33 |
@RunWith(MockitoJUnit44Runner.class)
|
|
34 |
@RunWith(MockitoJUnitRunner.class) |
|
34 | 35 |
public class CompatPendingResourceManagerImplTest { |
35 | 36 |
|
36 | 37 |
/** |
... | ... | |
112 | 113 |
@Test |
113 | 114 |
public void testSetValid() throws ISRegistryException, ValidationException { |
114 | 115 |
final String profId = "123"; |
115 |
when(resource.getResourceId()).thenReturn("123"); |
|
116 |
when(profileValidationStrategy.accept((OpaqueResource) anyObject(), eq(RegistrationPhase.Register))).thenReturn(true); |
|
116 |
when(resource.asString()).thenReturn(""); |
|
117 |
when(resource.getResourceId()).thenReturn(profId); |
|
118 |
//when(profileValidationStrategy.accept(any(OpaqueResource.class), eq(RegistrationPhase.Register))).thenReturn(true); |
|
117 | 119 |
|
118 | 120 |
pendingManager.setValid(resource); |
119 | 121 |
|
... | ... | |
132 | 134 |
@Test |
133 | 135 |
public void testSetPending() throws ISRegistryException { |
134 | 136 |
final String profId = "321"; |
135 |
when(resource.getResourceId()).thenReturn("321"); |
|
137 |
when(resource.asString()).thenReturn(""); |
|
138 |
when(resource.getResourceId()).thenReturn(profId); |
|
136 | 139 |
when(resource.getResourceType()).thenReturn("RepositoryServiceResourceType"); |
137 | 140 |
|
138 | 141 |
pendingManager.setPending(resource); |
Also available in: Unified diff
migrated to dnet45, using updated mockito version in tests