Skip to content
Snippets Groups Projects
Unverified Commit c9090466 authored by Clément Aubin's avatar Clément Aubin
Browse files

[misc] Fix xwiki-platform-eventstream-default unit tests

parent 71f242d9
No related branches found
No related tags found
No related merge requests found
...@@ -23,7 +23,6 @@ ...@@ -23,7 +23,6 @@
import java.util.Map; import java.util.Map;
import javax.inject.Inject; import javax.inject.Inject;
import javax.inject.Named;
import javax.inject.Provider; import javax.inject.Provider;
import javax.inject.Singleton; import javax.inject.Singleton;
......
...@@ -34,7 +34,6 @@ ...@@ -34,7 +34,6 @@
import org.xwiki.model.reference.DocumentReferenceResolver; import org.xwiki.model.reference.DocumentReferenceResolver;
import org.xwiki.model.reference.EntityReference; import org.xwiki.model.reference.EntityReference;
import org.xwiki.model.reference.LocalDocumentReference; import org.xwiki.model.reference.LocalDocumentReference;
import org.xwiki.security.authorization.AuthorizationManager;
import org.xwiki.test.mockito.MockitoComponentMockingRule; import org.xwiki.test.mockito.MockitoComponentMockingRule;
import com.xpn.xwiki.XWiki; import com.xpn.xwiki.XWiki;
...@@ -44,6 +43,7 @@ ...@@ -44,6 +43,7 @@
import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertTrue; import static org.junit.Assert.assertTrue;
import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.mock; import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when; import static org.mockito.Mockito.when;
...@@ -61,18 +61,14 @@ public class DefaultModelBridgeTest ...@@ -61,18 +61,14 @@ public class DefaultModelBridgeTest
private Provider<XWikiContext> contextProvider; private Provider<XWikiContext> contextProvider;
private AuthorizationManager authorizationManager; private DocumentReferenceResolver<String> documentReferenceResolver;
private DocumentReferenceResolver documentReferenceResolver;
@Before @Before
public void setUp() throws Exception public void setUp() throws Exception
{ {
this.contextProvider = this.mocker.getInstance(XWikiContext.TYPE_PROVIDER); this.contextProvider = this.mocker.getInstance(XWikiContext.TYPE_PROVIDER);
this.authorizationManager = this.mocker.registerMockComponent(AuthorizationManager.class); this.documentReferenceResolver = this.mocker.getInstance(DocumentReferenceResolver.TYPE_STRING);
this.documentReferenceResolver = this.mocker.registerMockComponent(DocumentReferenceResolver.class);
} }
@Test @Test
...@@ -119,7 +115,7 @@ public void testCheckXObjectPresenceWithPresentXObject() throws Exception ...@@ -119,7 +115,7 @@ public void testCheckXObjectPresenceWithPresentXObject() throws Exception
LocalDocumentReference localDocumentReferenceType1 = mock(LocalDocumentReference.class); LocalDocumentReference localDocumentReferenceType1 = mock(LocalDocumentReference.class);
when(resolvedType1.getLocalDocumentReference()).thenReturn(localDocumentReferenceType1); when(resolvedType1.getLocalDocumentReference()).thenReturn(localDocumentReferenceType1);
when(this.documentReferenceResolver.resolve("type1")).thenReturn(resolvedType1); when(this.documentReferenceResolver.resolve(eq("type1"))).thenReturn(resolvedType1);
when(document.getXObjects()).thenReturn(documentXObjects); when(document.getXObjects()).thenReturn(documentXObjects);
when(documentReferenceFromDocumentXObjects.getLocalDocumentReference()).thenReturn(localDocumentReferenceType1); when(documentReferenceFromDocumentXObjects.getLocalDocumentReference()).thenReturn(localDocumentReferenceType1);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment