Search in sources :

Example 6 with OSIORestClient

use of org.eclipse.linuxtools.internal.mylyn.osio.rest.core.OSIORestClient in project linuxtools by eclipse.

the class TestOSIORestGetAuthUser method testGetAuthUser.

@Test
public void testGetAuthUser() 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");
    OSIORestGetAuthUser data = new OSIORestGetAuthUser(client.getClient());
    String bundleLocation = Activator.getContext().getBundle().getLocation();
    int index = bundleLocation.indexOf('/');
    String fileName = bundleLocation.substring(index) + "/testjson/authuser.data";
    FileReader in = new FileReader(fileName);
    Identity user = data.testParseFromJson(in);
    assertEquals("User.org", user.getCompany());
    assertEquals("user@user.org", user.getEmail());
    assertEquals("User 1", user.getFullName());
    assertEquals("IDENTITY-0001", user.getIdentityID());
    assertEquals("https://www.gravatar.com/avatar/user.jpg", user.getImageURL());
    assertEquals("USER-0001", user.getUserID());
    assertEquals("user", user.getUsername());
    assertEquals("IDENTITY-0001", user.getId());
}
Also used : OSIORestGetAuthUser(org.eclipse.linuxtools.internal.mylyn.osio.rest.core.OSIORestGetAuthUser) TestData(org.eclipse.linuxtools.mylyn.osio.rest.test.support.TestData) OSIORestClient(org.eclipse.linuxtools.internal.mylyn.osio.rest.core.OSIORestClient) OSIORestConfiguration(org.eclipse.linuxtools.internal.mylyn.osio.rest.core.OSIORestConfiguration) FileReader(java.io.FileReader) Identity(org.eclipse.linuxtools.internal.mylyn.osio.rest.core.response.data.Identity) RepositoryLocation(org.eclipse.mylyn.commons.repositories.core.RepositoryLocation) NullOperationMonitor(org.eclipse.linuxtools.internal.mylyn.osio.rest.core.NullOperationMonitor) Test(org.junit.Test)

Example 7 with OSIORestClient

use of org.eclipse.linuxtools.internal.mylyn.osio.rest.core.OSIORestClient in project linuxtools by eclipse.

the class TestOSIORestGetSingleTask method testGetSingleTask.

@Test
public void testGetSingleTask() 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");
    OSIORestGetSingleTaskData data = new OSIORestGetSingleTaskData(client.getClient(), connector, "/workitems/WORKITEM-0001", repository);
    String bundleLocation = Activator.getContext().getBundle().getLocation();
    int index = bundleLocation.indexOf('/');
    String fileName = bundleLocation.substring(index) + "/testjson/workitem.data";
    FileReader in = new FileReader(fileName);
    TaskData taskData = data.testParseFromJson(in);
    TaskAttribute root = taskData.getRoot();
    OSIORestTaskSchema schema = OSIORestTaskSchema.getDefault();
    TaskAttribute space = root.getAttribute(schema.SPACE.getKey());
    assertEquals("mywork", space.getValue());
    TaskAttribute spaceid = root.getAttribute(schema.SPACE_ID.getKey());
    assertEquals("SPACE-0001", spaceid.getValue());
    TaskAttribute uuid = root.getAttribute(schema.UUID.getKey());
    assertEquals("WORKITEM-0001", uuid.getValue());
    TaskAttribute labelsLink = root.getAttribute(schema.LABELS_LINK.getKey());
    assertEquals("https://openshift.io/api/workitems/WORKITEM-0001/labels", labelsLink.getValue());
    TaskAttribute creatorId = root.getAttribute(schema.CREATOR_ID.getKey());
    assertEquals("USER-0001", creatorId.getValue());
    TaskAttribute taskUrl = root.getAttribute(schema.TASK_URL.getKey());
    assertEquals("https://openshift.io/api/workitems/WORKITEM-0001", taskUrl.getValue());
    TaskAttribute assigneeIds = root.getAttribute(schema.ASSIGNEE_IDS.getKey());
    assertEquals("USER-0001", assigneeIds.getValue());
    TaskAttribute id = root.getAttribute(schema.ID.getKey());
    assertEquals("user/mywork#1", id.getValue());
    TaskAttribute status = root.getAttribute(schema.STATUS.getKey());
    assertEquals("resolved", status.getValue());
    TaskAttribute title = root.getAttribute(schema.SUMMARY.getKey());
    assertEquals("00001", title.getValue());
    TaskAttribute description = root.getAttribute(schema.DESCRIPTION.getKey());
    assertEquals("Test bug", description.getValue());
    TaskAttribute version = root.getAttribute(schema.VERSION.getKey());
    assertEquals("11", version.getValue());
    TaskAttribute order = root.getAttribute(schema.ORDER.getKey());
    assertEquals("1000", order.getValue());
    TaskAttribute created_at = root.getAttribute(schema.DATE_CREATION.getKey());
    assertEquals(getDate("2017-08-14T21:37:15.863435Z"), created_at.getValue());
    TaskAttribute updated_at = root.getAttribute(schema.DATE_MODIFICATION.getKey());
    assertEquals(getDate("2017-09-15T15:54:43.08915Z"), updated_at.getValue());
}
Also used : OSIORestGetSingleTaskData(org.eclipse.linuxtools.internal.mylyn.osio.rest.core.OSIORestGetSingleTaskData) TaskAttribute(org.eclipse.mylyn.tasks.core.data.TaskAttribute) TestData(org.eclipse.linuxtools.mylyn.osio.rest.test.support.TestData) OSIORestClient(org.eclipse.linuxtools.internal.mylyn.osio.rest.core.OSIORestClient) OSIORestConfiguration(org.eclipse.linuxtools.internal.mylyn.osio.rest.core.OSIORestConfiguration) FileReader(java.io.FileReader) OSIORestTaskSchema(org.eclipse.linuxtools.internal.mylyn.osio.rest.core.OSIORestTaskSchema) RepositoryLocation(org.eclipse.mylyn.commons.repositories.core.RepositoryLocation) NullOperationMonitor(org.eclipse.linuxtools.internal.mylyn.osio.rest.core.NullOperationMonitor) TaskData(org.eclipse.mylyn.tasks.core.data.TaskData) OSIORestGetSingleTaskData(org.eclipse.linuxtools.internal.mylyn.osio.rest.core.OSIORestGetSingleTaskData) Test(org.junit.Test)

Example 8 with OSIORestClient

use of org.eclipse.linuxtools.internal.mylyn.osio.rest.core.OSIORestClient in project linuxtools by eclipse.

the class TestOSIORestGetTaskAssignee method testGetTaskAssignee.

@Test
public void testGetTaskAssignee() throws Exception {
    TestData testData = new TestData();
    TestUtils.initSpaces(requestProvider, testData);
    OSIORestClient client = connector.getClient(repository, requestProvider);
    AbstractTaskDataHandler taskDataHandler = connector.getTaskDataHandler();
    TaskAttributeMapper mapper = taskDataHandler.getAttributeMapper(repository);
    TaskData taskData = new TaskData(mapper, repository.getConnectorKind(), repository.getRepositoryUrl(), "");
    OSIORestTaskSchema.getDefault().initialize(taskData);
    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");
    OSIORestGetTaskAssignee data = new OSIORestGetTaskAssignee(client.getClient(), "USER-0001", taskData);
    String bundleLocation = Activator.getContext().getBundle().getLocation();
    int index = bundleLocation.indexOf('/');
    String fileName = bundleLocation.substring(index) + "/testjson/assignee.data";
    FileReader in = new FileReader(fileName);
    TaskAttribute original = taskData.getRoot().getAttribute(OSIORestTaskSchema.getDefault().ASSIGNEES.getKey());
    assertTrue(original == null || original.getValues().isEmpty());
    TaskAttribute attribute = data.testParseFromJson(in);
    assertEquals(1, attribute.getValues().size());
    assertEquals(1, original.getValues().size());
    assertEquals("user", original.getValue());
}
Also used : TaskAttribute(org.eclipse.mylyn.tasks.core.data.TaskAttribute) TestData(org.eclipse.linuxtools.mylyn.osio.rest.test.support.TestData) OSIORestConfiguration(org.eclipse.linuxtools.internal.mylyn.osio.rest.core.OSIORestConfiguration) AbstractTaskDataHandler(org.eclipse.mylyn.tasks.core.data.AbstractTaskDataHandler) RepositoryLocation(org.eclipse.mylyn.commons.repositories.core.RepositoryLocation) TaskData(org.eclipse.mylyn.tasks.core.data.TaskData) OSIORestClient(org.eclipse.linuxtools.internal.mylyn.osio.rest.core.OSIORestClient) OSIORestGetTaskAssignee(org.eclipse.linuxtools.internal.mylyn.osio.rest.core.OSIORestGetTaskAssignee) FileReader(java.io.FileReader) TaskAttributeMapper(org.eclipse.mylyn.tasks.core.data.TaskAttributeMapper) NullOperationMonitor(org.eclipse.linuxtools.internal.mylyn.osio.rest.core.NullOperationMonitor) Test(org.junit.Test)

Example 9 with OSIORestClient

use of org.eclipse.linuxtools.internal.mylyn.osio.rest.core.OSIORestClient in project linuxtools by eclipse.

the class TestOSIORestGetTaskComments method testGetTaskComments.

@Test
public void testGetTaskComments() throws Exception {
    TestData testData = new TestData();
    TestUtils.initSpaces(requestProvider, testData);
    OSIORestClient client = connector.getClient(repository, requestProvider);
    AbstractTaskDataHandler taskDataHandler = connector.getTaskDataHandler();
    TaskAttributeMapper mapper = taskDataHandler.getAttributeMapper(repository);
    TaskData taskData = new TaskData(mapper, repository.getConnectorKind(), repository.getRepositoryUrl(), "");
    OSIORestTaskSchema.getDefault().initialize(taskData);
    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");
    OSIORestGetTaskComments data = new OSIORestGetTaskComments(client.getClient(), testData.spaceMap.get("mywork"), taskData);
    String bundleLocation = Activator.getContext().getBundle().getLocation();
    int index = bundleLocation.indexOf('/');
    String fileName = bundleLocation.substring(index) + "/testjson/comments.data";
    FileReader in = new FileReader(fileName);
    TaskAttribute original = taskData.getRoot().getAttribute(OSIORestTaskSchema.getDefault().ASSIGNEES.getKey());
    assertTrue(original == null || original.getValues().isEmpty());
    ArrayList<TaskAttribute> attributes = data.testParseFromJson(in);
    assertEquals(4, attributes.size());
    TaskAttribute attr1 = attributes.get(0);
    TaskCommentMapper commentMapper = TaskCommentMapper.createFrom(attr1);
    assertEquals("COMMENT-0004", commentMapper.getCommentId());
    assertEquals("This is the fourth comment.", commentMapper.getText());
    assertEquals(getDate("2017-11-21T20:46:47.383745Z"), commentMapper.getCreationDate());
    IRepositoryPerson person = commentMapper.getAuthor();
    assertEquals("User", person.getName());
    assertEquals("user@user.org", person.getPersonId());
    assertEquals(new Integer(4), commentMapper.getNumber());
    TaskAttribute attr2 = attributes.get(1);
    commentMapper = TaskCommentMapper.createFrom(attr2);
    assertEquals("COMMENT-0003", commentMapper.getCommentId());
    assertEquals("This is the third comment.", commentMapper.getText());
    assertEquals(getDate("2017-10-05T23:01:54.15784Z"), commentMapper.getCreationDate());
    IRepositoryPerson person2 = commentMapper.getAuthor();
    assertEquals("User", person2.getName());
    assertEquals("user@user.org", person2.getPersonId());
    assertEquals(new Integer(3), commentMapper.getNumber());
    TaskAttribute attr3 = attributes.get(2);
    commentMapper = TaskCommentMapper.createFrom(attr3);
    assertEquals("COMMENT-0002", commentMapper.getCommentId());
    assertEquals("This is the second comment.", commentMapper.getText());
    assertEquals(getDate("2017-10-05T21:09:19.673546Z"), commentMapper.getCreationDate());
    IRepositoryPerson person3 = commentMapper.getAuthor();
    assertEquals("User", person3.getName());
    assertEquals("user@user.org", person3.getPersonId());
    assertEquals(new Integer(2), commentMapper.getNumber());
    TaskAttribute attr4 = attributes.get(3);
    commentMapper = TaskCommentMapper.createFrom(attr4);
    assertEquals("COMMENT-0001", commentMapper.getCommentId());
    assertEquals("Comment on Task 1.", commentMapper.getText());
    assertEquals(getDate("2017-08-14T21:40:29.434379Z"), commentMapper.getCreationDate());
    IRepositoryPerson person4 = commentMapper.getAuthor();
    assertEquals("User", person4.getName());
    assertEquals("user@user.org", person4.getPersonId());
    assertEquals(new Integer(1), commentMapper.getNumber());
}
Also used : TaskAttribute(org.eclipse.mylyn.tasks.core.data.TaskAttribute) TestData(org.eclipse.linuxtools.mylyn.osio.rest.test.support.TestData) OSIORestConfiguration(org.eclipse.linuxtools.internal.mylyn.osio.rest.core.OSIORestConfiguration) IRepositoryPerson(org.eclipse.mylyn.tasks.core.IRepositoryPerson) OSIORestGetTaskComments(org.eclipse.linuxtools.internal.mylyn.osio.rest.core.OSIORestGetTaskComments) AbstractTaskDataHandler(org.eclipse.mylyn.tasks.core.data.AbstractTaskDataHandler) RepositoryLocation(org.eclipse.mylyn.commons.repositories.core.RepositoryLocation) TaskData(org.eclipse.mylyn.tasks.core.data.TaskData) OSIORestClient(org.eclipse.linuxtools.internal.mylyn.osio.rest.core.OSIORestClient) FileReader(java.io.FileReader) TaskCommentMapper(org.eclipse.mylyn.tasks.core.data.TaskCommentMapper) TaskAttributeMapper(org.eclipse.mylyn.tasks.core.data.TaskAttributeMapper) NullOperationMonitor(org.eclipse.linuxtools.internal.mylyn.osio.rest.core.NullOperationMonitor) Test(org.junit.Test)

Example 10 with OSIORestClient

use of org.eclipse.linuxtools.internal.mylyn.osio.rest.core.OSIORestClient in project linuxtools by eclipse.

the class TestOSIORestGetTaskData method testGetTaskData.

@Test
public void testGetTaskData() 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");
    OSIORestGetTaskData data = new OSIORestGetTaskData(client.getClient(), connector, "/workitems/QUERY", repository);
    String bundleLocation = Activator.getContext().getBundle().getLocation();
    int index = bundleLocation.indexOf('/');
    String fileName = bundleLocation.substring(index) + "/testjson/workitems.data";
    FileReader in = new FileReader(fileName);
    List<TaskData> taskDataList = data.testParseFromJson(in);
    assertEquals(2, taskDataList.size());
    TaskData taskData = taskDataList.get(0);
    TaskAttribute root = taskData.getRoot();
    OSIORestTaskSchema schema = OSIORestTaskSchema.getDefault();
    TaskAttribute space = root.getAttribute(schema.SPACE.getKey());
    assertEquals("mywork", space.getValue());
    TaskAttribute spaceid = root.getAttribute(schema.SPACE_ID.getKey());
    assertEquals("SPACE-0001", spaceid.getValue());
    TaskAttribute uuid = root.getAttribute(schema.UUID.getKey());
    assertEquals("WORKITEM-0001", uuid.getValue());
    TaskAttribute labelsLink = root.getAttribute(schema.LABELS_LINK.getKey());
    assertEquals("https://openshift.io/api/workitems/WORKITEM-0001/labels", labelsLink.getValue());
    TaskAttribute creatorId = root.getAttribute(schema.CREATOR_ID.getKey());
    assertEquals("USER-0001", creatorId.getValue());
    TaskAttribute taskUrl = root.getAttribute(schema.TASK_URL.getKey());
    assertEquals("https://openshift.io/api/workitems/WORKITEM-0001", taskUrl.getValue());
    TaskAttribute assigneeIds = root.getAttribute(schema.ASSIGNEE_IDS.getKey());
    assertEquals("USER-0001", assigneeIds.getValue());
    TaskAttribute id = root.getAttribute(schema.ID.getKey());
    assertEquals("user/mywork#1", id.getValue());
    TaskAttribute status = root.getAttribute(schema.STATUS.getKey());
    assertEquals("resolved", status.getValue());
    TaskAttribute title = root.getAttribute(schema.SUMMARY.getKey());
    assertEquals("00001", title.getValue());
    TaskAttribute description = root.getAttribute(schema.DESCRIPTION.getKey());
    assertEquals("Test bug", description.getValue());
    TaskAttribute version = root.getAttribute(schema.VERSION.getKey());
    assertEquals("11", version.getValue());
    TaskAttribute order = root.getAttribute(schema.ORDER.getKey());
    assertEquals("1000", order.getValue());
    TaskAttribute created_at = root.getAttribute(schema.DATE_CREATION.getKey());
    assertEquals(getDate("2017-08-14T21:37:15.863435Z"), created_at.getValue());
    TaskAttribute updated_at = root.getAttribute(schema.DATE_MODIFICATION.getKey());
    assertEquals(getDate("2017-09-15T15:54:43.08915Z"), updated_at.getValue());
    taskData = taskDataList.get(1);
    root = taskData.getRoot();
    space = root.getAttribute(schema.SPACE.getKey());
    assertEquals("mywork", space.getValue());
    spaceid = root.getAttribute(schema.SPACE_ID.getKey());
    assertEquals("SPACE-0001", spaceid.getValue());
    uuid = root.getAttribute(schema.UUID.getKey());
    assertEquals("WORKITEM-0002", uuid.getValue());
    labelsLink = root.getAttribute(schema.LABELS_LINK.getKey());
    assertEquals("https://openshift.io/api/workitems/WORKITEM-0002/labels", labelsLink.getValue());
    creatorId = root.getAttribute(schema.CREATOR_ID.getKey());
    assertEquals("USER-0001", creatorId.getValue());
    taskUrl = root.getAttribute(schema.TASK_URL.getKey());
    assertEquals("https://openshift.io/api/workitems/WORKITEM-0002", taskUrl.getValue());
    assigneeIds = root.getAttribute(schema.ASSIGNEE_IDS.getKey());
    assertEquals("USER-0001", assigneeIds.getValue());
    id = root.getAttribute(schema.ID.getKey());
    assertEquals("user/mywork#2", id.getValue());
    status = root.getAttribute(schema.STATUS.getKey());
    assertEquals("open", status.getValue());
    title = root.getAttribute(schema.SUMMARY.getKey());
    assertEquals("00002", title.getValue());
    description = root.getAttribute(schema.DESCRIPTION.getKey());
    assertEquals("Test feature", description.getValue());
    version = root.getAttribute(schema.VERSION.getKey());
    assertEquals("22", version.getValue());
    order = root.getAttribute(schema.ORDER.getKey());
    assertEquals("2000", order.getValue());
    created_at = root.getAttribute(schema.DATE_CREATION.getKey());
    assertEquals(getDate("2017-08-15T21:37:15.863435Z"), created_at.getValue());
    updated_at = root.getAttribute(schema.DATE_MODIFICATION.getKey());
    assertEquals(getDate("2017-09-16T15:54:43.08915Z"), updated_at.getValue());
}
Also used : TaskAttribute(org.eclipse.mylyn.tasks.core.data.TaskAttribute) TestData(org.eclipse.linuxtools.mylyn.osio.rest.test.support.TestData) OSIORestGetTaskData(org.eclipse.linuxtools.internal.mylyn.osio.rest.core.OSIORestGetTaskData) OSIORestConfiguration(org.eclipse.linuxtools.internal.mylyn.osio.rest.core.OSIORestConfiguration) RepositoryLocation(org.eclipse.mylyn.commons.repositories.core.RepositoryLocation) TaskData(org.eclipse.mylyn.tasks.core.data.TaskData) OSIORestGetTaskData(org.eclipse.linuxtools.internal.mylyn.osio.rest.core.OSIORestGetTaskData) OSIORestClient(org.eclipse.linuxtools.internal.mylyn.osio.rest.core.OSIORestClient) FileReader(java.io.FileReader) OSIORestTaskSchema(org.eclipse.linuxtools.internal.mylyn.osio.rest.core.OSIORestTaskSchema) NullOperationMonitor(org.eclipse.linuxtools.internal.mylyn.osio.rest.core.NullOperationMonitor) Test(org.junit.Test)

Aggregations

OSIORestClient (org.eclipse.linuxtools.internal.mylyn.osio.rest.core.OSIORestClient)25 Test (org.junit.Test)23 TestData (org.eclipse.linuxtools.mylyn.osio.rest.test.support.TestData)21 RepositoryLocation (org.eclipse.mylyn.commons.repositories.core.RepositoryLocation)20 OSIORestConfiguration (org.eclipse.linuxtools.internal.mylyn.osio.rest.core.OSIORestConfiguration)19 TaskData (org.eclipse.mylyn.tasks.core.data.TaskData)16 NullOperationMonitor (org.eclipse.linuxtools.internal.mylyn.osio.rest.core.NullOperationMonitor)15 AbstractTaskDataHandler (org.eclipse.mylyn.tasks.core.data.AbstractTaskDataHandler)14 TaskAttributeMapper (org.eclipse.mylyn.tasks.core.data.TaskAttributeMapper)14 TaskAttribute (org.eclipse.mylyn.tasks.core.data.TaskAttribute)13 FileReader (java.io.FileReader)10 JsonWriter (com.google.gson.stream.JsonWriter)5 StringWriter (java.io.StringWriter)5 OSIORestTaskSchema (org.eclipse.linuxtools.internal.mylyn.osio.rest.core.OSIORestTaskSchema)5 NullOperationMonitor (org.eclipse.mylyn.internal.commons.core.operations.NullOperationMonitor)5 ArrayList (java.util.ArrayList)3 Space (org.eclipse.linuxtools.internal.mylyn.osio.rest.core.response.data.Space)3 TaskCommentMapper (org.eclipse.mylyn.tasks.core.data.TaskCommentMapper)3 LinkedHashSet (java.util.LinkedHashSet)2 Identity (org.eclipse.linuxtools.internal.mylyn.osio.rest.core.response.data.Identity)2