Revision 45488
Added by Claudio Atzori about 7 years ago
ServiceRegistrationManagerImplTest.java | ||
---|---|---|
1 | 1 |
package eu.dnetlib.enabling.tools.registration; |
2 | 2 |
|
3 |
import static org.junit.Assert.assertFalse; |
|
4 |
import static org.junit.Assert.assertTrue; |
|
5 |
import static org.mockito.Matchers.anyObject; |
|
6 |
import static org.mockito.Matchers.anyString; |
|
7 |
import static org.mockito.Mockito.when; |
|
8 |
|
|
9 | 3 |
import java.util.Arrays; |
10 |
|
|
11 | 4 |
import javax.xml.ws.Endpoint; |
12 | 5 |
|
6 |
import eu.dnetlib.enabling.locators.UniqueServiceLocator; |
|
7 |
import eu.dnetlib.rmi.common.BaseService; |
|
8 |
import eu.dnetlib.rmi.enabling.ISLookUpException; |
|
9 |
import eu.dnetlib.rmi.enabling.ISLookUpService; |
|
13 | 10 |
import org.junit.Before; |
14 | 11 |
import org.junit.Ignore; |
15 | 12 |
import org.junit.Test; |
16 | 13 |
import org.junit.runner.RunWith; |
17 | 14 |
import org.mockito.Mock; |
18 |
import org.mockito.runners.MockitoJUnitRunner;
|
|
15 |
import org.mockito.junit.MockitoJUnitRunner;
|
|
19 | 16 |
|
20 |
import eu.dnetlib.enabling.locators.UniqueServiceLocator; |
|
21 |
import eu.dnetlib.rmi.enabling.ISLookUpException; |
|
22 |
import eu.dnetlib.rmi.enabling.ISLookUpService; |
|
17 |
import static org.junit.Assert.assertFalse; |
|
18 |
import static org.junit.Assert.assertTrue; |
|
19 |
import static org.mockito.ArgumentMatchers.any; |
|
20 |
import static org.mockito.Matchers.anyString; |
|
21 |
import static org.mockito.Mockito.when; |
|
23 | 22 |
|
24 | 23 |
/** |
25 | 24 |
* test ServiceRegistrationManagerImpl. |
... | ... | |
86 | 85 |
@Test |
87 | 86 |
@Ignore |
88 | 87 |
public void testTick() throws Exception { |
89 |
when(this.registrator.registerService(anyObject(), (Endpoint) anyObject())).thenReturn("123");
|
|
88 |
when(this.registrator.registerService(any(BaseService.class), any(Endpoint.class))).thenReturn("123");
|
|
90 | 89 |
|
91 | 90 |
assertFalse(this.manager.isDisabled()); |
92 | 91 |
this.manager.registerAllServices(); |
Also available in: Unified diff
using updated mockito version