本文整理汇总了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);
}
示例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());
}
示例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);
}
示例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);
}
示例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());
}
示例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));
}
示例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"));
}
示例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());
}
示例9: createNotificationDateFormat
public DateFormat createNotificationDateFormat() {
final DateFormat dateFormat = new SimpleDateFormat(RestConnection.JSON_DATE_FORMAT);
dateFormat.setTimeZone(java.util.TimeZone.getTimeZone("Zulu"));
return dateFormat;
}