当前位置: 首页>>代码示例>>Java>>正文


Java RestConnection.JSON_DATE_FORMAT属性代码示例

本文整理汇总了Java中com.blackducksoftware.integration.hub.rest.RestConnection.JSON_DATE_FORMAT属性的典型用法代码示例。如果您正苦于以下问题:Java RestConnection.JSON_DATE_FORMAT属性的具体用法?Java RestConnection.JSON_DATE_FORMAT怎么用?Java RestConnection.JSON_DATE_FORMAT使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在com.blackducksoftware.integration.hub.rest.RestConnection的用法示例。


在下文中一共展示了RestConnection.JSON_DATE_FORMAT属性的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: testUpdate

@Test
public void testUpdate() throws Exception {
    final StatusMock status = new StatusMock();
    status.setName(STATUS_NAME);
    final ApplicationUserMock assignee = new ApplicationUserMock();
    assignee.setName(ASSIGNEE_USER_NAME);
    final Issue issue = createIssue(new Long(1), JIRA_PROJECT_ID, JIRA_PROJECT_NAME, status, assignee);

    issueHandler.updateHubIssue(ISSUE_URL, issue);

    assertFalse(issueServiceMock.issueMap.isEmpty());

    final IssueView hubIssue = issueServiceMock.issueMap.get(ISSUE_URL);

    final SimpleDateFormat dateFormatter = new SimpleDateFormat(RestConnection.JSON_DATE_FORMAT);
    dateFormatter.setTimeZone(TimeZone.getTimeZone("UTC"));
    final String expectedCreatedAt = dateFormatter.format(issue.getCreated());
    final String expectedUpdatedAt = dateFormatter.format(issue.getUpdated());

    assertEquals(issue.getKey(), hubIssue.issueId);
    assertEquals(issue.getDescription(), hubIssue.issueDescription);
    assertEquals(issue.getStatus().getName(), hubIssue.issueStatus);
    assertEquals(expectedCreatedAt, hubIssue.issueCreatedAt);
    assertEquals(expectedUpdatedAt, hubIssue.issueUpdatedAt);
    assertEquals(issue.getAssignee().getDisplayName(), hubIssue.issueAssignee);
}
 
开发者ID:blackducksoftware,项目名称:hub-jira,代码行数:26,代码来源:HubIssueTrackerHandlerTest.java

示例2: HubJiraTask

public HubJiraTask(final PluginConfigurationDetails configDetails, final JiraContext jiraContext, final JiraSettingsService jiraSettingsService,
		final TicketInfoFromSetup ticketInfoFromSetup) {
	this.pluginConfigDetails = configDetails;
	this.jiraContext = jiraContext;

	this.runDate = new Date();
	dateFormatter = new SimpleDateFormat(RestConnection.JSON_DATE_FORMAT);
	dateFormatter.setTimeZone(java.util.TimeZone.getTimeZone("Zulu"));
	this.runDateString = dateFormatter.format(runDate);
	logger.debug("Install date: " + configDetails.getInstallDateString());
	logger.debug("Last run date: " + configDetails.getLastRunDateString());

	this.jiraSettingsService = jiraSettingsService;
	this.ticketInfoFromSetup = ticketInfoFromSetup;
	this.fieldCopyMappingJson = configDetails.getFieldCopyMappingJson();

	logger.debug("createVulnerabilityIssues: " + configDetails.isCreateVulnerabilityIssues());
}
 
开发者ID:blackducksoftware,项目名称:hub-jira,代码行数:18,代码来源:HubJiraTask.java

示例3: assertIssueCreated

private void assertIssueCreated(final Long eventTypeId) {
    final Issue issue = createValidIssue();
    final IssueEvent event = createIssueEvent(issue, eventTypeId);
    listener.onIssueEvent(event);

    assertFalse(issueServiceMock.issueMap.isEmpty());

    final IssueView hubIssue = issueServiceMock.issueMap.get(ISSUE_URL);

    final SimpleDateFormat dateFormatter = new SimpleDateFormat(RestConnection.JSON_DATE_FORMAT);
    dateFormatter.setTimeZone(TimeZone.getTimeZone("UTC"));
    final String expectedCreatedAt = dateFormatter.format(issue.getCreated());
    final String expectedUpdatedAt = dateFormatter.format(issue.getUpdated());

    assertEquals(issue.getKey(), hubIssue.issueId);
    assertEquals(issue.getDescription(), hubIssue.issueDescription);
    assertEquals(issue.getStatus().getName(), hubIssue.issueStatus);
    assertEquals(expectedCreatedAt, hubIssue.issueCreatedAt);
    assertEquals(expectedUpdatedAt, hubIssue.issueUpdatedAt);
    assertEquals(issue.getAssignee().getDisplayName(), hubIssue.issueAssignee);
}
 
开发者ID:blackducksoftware,项目名称:hub-jira,代码行数:21,代码来源:IssueEventListenerTest.java

示例4: testCreate

@Test
public void testCreate() throws Exception {
    final StatusMock status = new StatusMock();
    status.setName(STATUS_NAME);
    final ApplicationUserMock assignee = new ApplicationUserMock();
    assignee.setName(ASSIGNEE_USER_NAME);
    final Issue issue = createIssue(new Long(1), JIRA_PROJECT_ID, JIRA_PROJECT_NAME, status, assignee);

    issueHandler.createHubIssue(ISSUE_URL, issue);

    assertFalse(issueServiceMock.issueMap.isEmpty());

    final IssueView hubIssue = issueServiceMock.issueMap.get(ISSUE_URL);

    final SimpleDateFormat dateFormatter = new SimpleDateFormat(RestConnection.JSON_DATE_FORMAT);
    dateFormatter.setTimeZone(TimeZone.getTimeZone("UTC"));
    final String expectedCreatedAt = dateFormatter.format(issue.getCreated());
    final String expectedUpdatedAt = dateFormatter.format(issue.getUpdated());

    assertEquals(issue.getKey(), hubIssue.issueId);
    assertEquals(issue.getDescription(), hubIssue.issueDescription);
    assertEquals(issue.getStatus().getName(), hubIssue.issueStatus);
    assertEquals(expectedCreatedAt, hubIssue.issueCreatedAt);
    assertEquals(expectedUpdatedAt, hubIssue.issueUpdatedAt);
    assertEquals(issue.getAssignee().getDisplayName(), hubIssue.issueAssignee);
}
 
开发者ID:blackducksoftware,项目名称:hub-jira,代码行数:26,代码来源:HubIssueTrackerHandlerTest.java

示例5: testDelete

@Test
public void testDelete() throws Exception {
    final StatusMock status = new StatusMock();
    status.setName(STATUS_NAME);
    final ApplicationUserMock assignee = new ApplicationUserMock();
    assignee.setName(ASSIGNEE_USER_NAME);
    final Issue issue = createIssue(new Long(1), JIRA_PROJECT_ID, JIRA_PROJECT_NAME, status, assignee);

    final SimpleDateFormat dateFormatter = new SimpleDateFormat(RestConnection.JSON_DATE_FORMAT);
    dateFormatter.setTimeZone(TimeZone.getTimeZone("UTC"));
    final String expectedCreatedAt = dateFormatter.format(issue.getCreated());
    final String expectedUpdatedAt = dateFormatter.format(issue.getUpdated());
    final IssueView hubIssue = new IssueView();
    hubIssue.issueId = issue.getKey();
    hubIssue.issueDescription = issue.getDescription();
    hubIssue.issueStatus = issue.getStatus().getName();
    hubIssue.issueCreatedAt = expectedCreatedAt;
    hubIssue.issueUpdatedAt = expectedUpdatedAt;
    hubIssue.issueAssignee = issue.getAssignee().getDisplayName();

    issueServiceMock.issueMap.put(ISSUE_URL, hubIssue);
    issueHandler.deleteHubIssue(ISSUE_URL, issue);

    assertTrue(issueServiceMock.issueMap.isEmpty());
}
 
开发者ID:blackducksoftware,项目名称:hub-jira,代码行数:25,代码来源:HubIssueTrackerHandlerTest.java

示例6: testDeleteEmptyURL

@Test
public void testDeleteEmptyURL() throws Exception {
    final StatusMock status = new StatusMock();
    status.setName(STATUS_NAME);
    final ApplicationUserMock assignee = new ApplicationUserMock();
    assignee.setName(ASSIGNEE_USER_NAME);
    final Issue issue = createIssue(new Long(1), JIRA_PROJECT_ID, JIRA_PROJECT_NAME, status, assignee);

    final SimpleDateFormat dateFormatter = new SimpleDateFormat(RestConnection.JSON_DATE_FORMAT);
    dateFormatter.setTimeZone(TimeZone.getTimeZone("UTC"));
    final String expectedCreatedAt = dateFormatter.format(issue.getCreated());
    final String expectedUpdatedAt = dateFormatter.format(issue.getUpdated());
    final IssueView hubIssue = new IssueView();
    hubIssue.issueId = issue.getKey();
    hubIssue.issueDescription = issue.getDescription();
    hubIssue.issueStatus = issue.getStatus().getName();
    hubIssue.issueCreatedAt = expectedCreatedAt;
    hubIssue.issueUpdatedAt = expectedUpdatedAt;
    hubIssue.issueAssignee = issue.getAssignee().getDisplayName();

    issueServiceMock.issueMap.put(ISSUE_URL, hubIssue);
    issueHandler.deleteHubIssue("", issue);

    assertFalse(issueServiceMock.issueMap.isEmpty());
    assertNotNull(settings.get(HubJiraConstants.HUB_JIRA_ERROR));
}
 
开发者ID:blackducksoftware,项目名称:hub-jira,代码行数:26,代码来源:HubIssueTrackerHandlerTest.java

示例7: HubIssueTrackerHandler

public HubIssueTrackerHandler(final JiraServices jiraServices, final JiraSettingsService jiraSettingsService, final BomComponentIssueRequestService issueRequestService) {
    this.jiraServices = jiraServices;
    this.jiraSettingsService = jiraSettingsService;
    this.issueRequestService = issueRequestService;

    dateFormatter = new SimpleDateFormat(RestConnection.JSON_DATE_FORMAT);
    dateFormatter.setTimeZone(TimeZone.getTimeZone("UTC"));
}
 
开发者ID:blackducksoftware,项目名称:hub-jira,代码行数:8,代码来源:HubIssueTrackerHandler.java

示例8: testDeleteEventWithEntityProperty

@Test
public void testDeleteEventWithEntityProperty() {
    populateProjectSettings();
    createEntityProperty();

    final StatusMock status = new StatusMock();
    status.setName(STATUS_NAME);
    final ApplicationUserMock assignee = new ApplicationUserMock();
    assignee.setName(ASSIGNEE_USER_NAME);
    final Issue issue = createIssue(new Long(1), JIRA_PROJECT_ID, JIRA_PROJECT_NAME, status, assignee);
    final IssueEvent event = createIssueEvent(issue, EventType.ISSUE_DELETED_ID);

    final SimpleDateFormat dateFormatter = new SimpleDateFormat(RestConnection.JSON_DATE_FORMAT);
    dateFormatter.setTimeZone(TimeZone.getTimeZone("UTC"));
    final String expectedCreatedAt = dateFormatter.format(issue.getCreated());
    final String expectedUpdatedAt = dateFormatter.format(issue.getUpdated());
    final IssueView hubIssue = new IssueView();
    hubIssue.issueId = issue.getKey();
    hubIssue.issueDescription = issue.getDescription();
    hubIssue.issueStatus = issue.getStatus().getName();
    hubIssue.issueCreatedAt = expectedCreatedAt;
    hubIssue.issueUpdatedAt = expectedUpdatedAt;
    hubIssue.issueAssignee = issue.getAssignee().getDisplayName();

    issueServiceMock.issueMap.put(ISSUE_URL, hubIssue);
    listener.onIssueEvent(event);

    assertTrue(issueServiceMock.issueMap.isEmpty());
}
 
开发者ID:blackducksoftware,项目名称:hub-jira,代码行数:29,代码来源:IssueEventListenerTest.java

示例9: createNotificationDateFormat

public DateFormat createNotificationDateFormat() {
    final DateFormat dateFormat = new SimpleDateFormat(RestConnection.JSON_DATE_FORMAT);
    dateFormat.setTimeZone(java.util.TimeZone.getTimeZone("Zulu"));
    return dateFormat;
}
 
开发者ID:blackducksoftware,项目名称:hub-email-extension,代码行数:5,代码来源:EmailEngine.java


注:本文中的com.blackducksoftware.integration.hub.rest.RestConnection.JSON_DATE_FORMAT属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。