use of org.eclipse.linuxtools.internal.mylyn.osio.rest.core.OSIORestGetWorkItem in project linuxtools by eclipse.
the class TestOSIORestGetWorkItem method testGetWorkItem.
@Test
public void testGetWorkItem() throws Exception {
TestData testData = new TestData();
TestUtils.initSpaces(requestProvider, testData);
OSIORestClient client = connector.getClient(repository, requestProvider);
OSIORestConfiguration config = client.getConfiguration(repository, new NullOperationMonitor());
config.setSpaces(testData.spaceMap);
connector.setConfiguration(config);
RepositoryLocation location = client.getClient().getLocation();
location.setProperty(IOSIORestConstants.REPOSITORY_AUTH_ID, "user");
location.setProperty(IOSIORestConstants.REPOSITORY_AUTH_TOKEN, "xxxxxxTokenxxxxxx");
OSIORestGetWorkItem data = new OSIORestGetWorkItem(client.getClient(), "WORKITEM-0001");
String bundleLocation = Activator.getContext().getBundle().getLocation();
int index = bundleLocation.indexOf('/');
String fileName = bundleLocation.substring(index) + "/testjson/workitem.data";
FileReader in = new FileReader(fileName);
WorkItem workitem = data.testParseFromJson(in);
assertEquals("WORKITEM-0001", workitem.getId());
assertEquals("00001", workitem.getTitle());
assertEquals("SPACE-0001", workitem.getSpaceId());
assertEquals("1", workitem.getNumber());
}
Aggregations