diff options
Diffstat (limited to 'connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core.tests/src/org/eclipse/mylyn/internal/bugzilla/rest/core/tests/BugzillaRestConnectorTest.java')
-rw-r--r-- | connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core.tests/src/org/eclipse/mylyn/internal/bugzilla/rest/core/tests/BugzillaRestConnectorTest.java | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core.tests/src/org/eclipse/mylyn/internal/bugzilla/rest/core/tests/BugzillaRestConnectorTest.java b/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core.tests/src/org/eclipse/mylyn/internal/bugzilla/rest/core/tests/BugzillaRestConnectorTest.java new file mode 100644 index 000000000..083c879c5 --- /dev/null +++ b/connector-bugzilla-rest/org.eclipse.mylyn.bugzilla.rest.core.tests/src/org/eclipse/mylyn/internal/bugzilla/rest/core/tests/BugzillaRestConnectorTest.java @@ -0,0 +1,46 @@ +package org.eclipse.mylyn.internal.bugzilla.rest.core.tests; + +import static org.junit.Assert.assertNull; + +import org.eclipse.mylyn.commons.net.AuthenticationCredentials; +import org.eclipse.mylyn.commons.net.AuthenticationType; +import org.eclipse.mylyn.commons.sdk.util.Junit4TestFixtureRunner; +import org.eclipse.mylyn.commons.sdk.util.Junit4TestFixtureRunner.FixtureDefinition; +import org.eclipse.mylyn.internal.bugzilla.rest.core.BugzillaRestConfiguration; +import org.eclipse.mylyn.internal.bugzilla.rest.core.BugzillaRestConnector; +import org.eclipse.mylyn.internal.bugzilla.rest.test.support.BugzillaRestTestFixture; +import org.eclipse.mylyn.internal.tasks.core.TaskRepositoryManager; +import org.eclipse.mylyn.tasks.core.TaskRepository; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; + +@RunWith(Junit4TestFixtureRunner.class) +@FixtureDefinition(fixtureClass = BugzillaRestTestFixture.class, fixtureType = "bugzillaREST") +public class BugzillaRestConnectorTest { + private final BugzillaRestTestFixture actualFixture; + + private static TaskRepositoryManager manager; + + private BugzillaRestConnector connector; + + public BugzillaRestConnectorTest(BugzillaRestTestFixture fixture) { + this.actualFixture = fixture; + } + + @Before + public void setUp() { + connector = new BugzillaRestConnector(); + } + + @Test + public void testLoadCacheWrongRepository() throws Exception { + TaskRepository taskRepository = new TaskRepository(connector.getConnectorKind(), + "http://mylyn.org/bugzilla-rest-trunk-wrong/"); + AuthenticationCredentials credentials = new AuthenticationCredentials("username", "password"); + taskRepository.setCredentials(AuthenticationType.REPOSITORY, credentials, false); + BugzillaRestConfiguration configuration = connector.getRepositoryConfiguration(taskRepository); + assertNull(configuration); + } + +} |