You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

IssueFieldsSetterTest.java 19KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549
  1. /*
  2. * SonarQube
  3. * Copyright (C) 2009-2019 SonarSource SA
  4. * mailto:info AT sonarsource DOT com
  5. *
  6. * This program is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU Lesser General Public
  8. * License as published by the Free Software Foundation; either
  9. * version 3 of the License, or (at your option) any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14. * Lesser General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU Lesser General Public License
  17. * along with this program; if not, write to the Free Software Foundation,
  18. * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  19. */
  20. package org.sonar.server.issue;
  21. import java.util.Calendar;
  22. import java.util.Date;
  23. import java.util.Map;
  24. import java.util.Random;
  25. import org.apache.commons.lang.time.DateUtils;
  26. import org.junit.Rule;
  27. import org.junit.Test;
  28. import org.junit.rules.ExpectedException;
  29. import org.sonar.api.utils.Duration;
  30. import org.sonar.core.issue.DefaultIssue;
  31. import org.sonar.core.issue.FieldDiffs;
  32. import org.sonar.core.issue.IssueChangeContext;
  33. import org.sonar.db.user.UserDto;
  34. import static org.assertj.core.api.Assertions.assertThat;
  35. import static org.junit.rules.ExpectedException.none;
  36. import static org.sonar.db.user.UserTesting.newUserDto;
  37. import static org.sonar.server.issue.IssueFieldsSetter.ASSIGNEE;
  38. import static org.sonar.server.issue.IssueFieldsSetter.RESOLUTION;
  39. import static org.sonar.server.issue.IssueFieldsSetter.SEVERITY;
  40. import static org.sonar.server.issue.IssueFieldsSetter.STATUS;
  41. import static org.sonar.server.issue.IssueFieldsSetter.TECHNICAL_DEBT;
  42. import static org.sonar.server.issue.IssueFieldsSetter.UNUSED;
  43. public class IssueFieldsSetterTest {
  44. @Rule
  45. public ExpectedException thrown = none();
  46. private DefaultIssue issue = new DefaultIssue();
  47. private IssueChangeContext context = IssueChangeContext.createUser(new Date(), "user_uuid");
  48. private IssueFieldsSetter underTest = new IssueFieldsSetter();
  49. @Test
  50. public void assign() {
  51. UserDto user = newUserDto().setLogin("emmerik").setName("Emmerik");
  52. boolean updated = underTest.assign(issue, user, context);
  53. assertThat(updated).isTrue();
  54. assertThat(issue.assignee()).isEqualTo(user.getUuid());
  55. assertThat(issue.mustSendNotifications()).isTrue();
  56. FieldDiffs.Diff diff = issue.currentChange().get(ASSIGNEE);
  57. assertThat(diff.oldValue()).isEqualTo(UNUSED);
  58. assertThat(diff.newValue()).isEqualTo(user.getName());
  59. }
  60. @Test
  61. public void unassign() {
  62. issue.setAssigneeUuid("user_uuid");
  63. boolean updated = underTest.assign(issue, null, context);
  64. assertThat(updated).isTrue();
  65. assertThat(issue.assignee()).isNull();
  66. assertThat(issue.mustSendNotifications()).isTrue();
  67. FieldDiffs.Diff diff = issue.currentChange().get(ASSIGNEE);
  68. assertThat(diff.oldValue()).isEqualTo(UNUSED);
  69. assertThat(diff.newValue()).isNull();
  70. }
  71. @Test
  72. public void change_assignee() {
  73. UserDto user = newUserDto().setLogin("emmerik").setName("Emmerik");
  74. issue.setAssigneeUuid("user_uuid");
  75. boolean updated = underTest.assign(issue, user, context);
  76. assertThat(updated).isTrue();
  77. assertThat(issue.assignee()).isEqualTo(user.getUuid());
  78. assertThat(issue.mustSendNotifications()).isTrue();
  79. FieldDiffs.Diff diff = issue.currentChange().get(ASSIGNEE);
  80. assertThat(diff.oldValue()).isEqualTo(UNUSED);
  81. assertThat(diff.newValue()).isEqualTo(user.getName());
  82. }
  83. @Test
  84. public void not_change_assignee() {
  85. UserDto user = newUserDto().setLogin("morgan").setName("Morgan");
  86. issue.setAssigneeUuid(user.getUuid());
  87. boolean updated = underTest.assign(issue, user, context);
  88. assertThat(updated).isFalse();
  89. assertThat(issue.currentChange()).isNull();
  90. assertThat(issue.mustSendNotifications()).isFalse();
  91. }
  92. @Test
  93. public void set_new_assignee() {
  94. boolean updated = underTest.setNewAssignee(issue, "user_uuid", context);
  95. assertThat(updated).isTrue();
  96. assertThat(issue.assignee()).isEqualTo("user_uuid");
  97. assertThat(issue.mustSendNotifications()).isTrue();
  98. FieldDiffs.Diff diff = issue.currentChange().get(ASSIGNEE);
  99. assertThat(diff.oldValue()).isEqualTo(UNUSED);
  100. assertThat(diff.newValue()).isEqualTo("user_uuid");
  101. }
  102. @Test
  103. public void not_set_new_assignee_if_new_assignee_is_null() {
  104. boolean updated = underTest.setNewAssignee(issue, null, context);
  105. assertThat(updated).isFalse();
  106. assertThat(issue.currentChange()).isNull();
  107. assertThat(issue.mustSendNotifications()).isFalse();
  108. }
  109. @Test
  110. public void fail_with_ISE_when_setting_new_assignee_on_already_assigned_issue() {
  111. issue.setAssigneeUuid("user_uuid");
  112. thrown.expect(IllegalStateException.class);
  113. thrown.expectMessage("It's not possible to update the assignee with this method, please use assign()");
  114. underTest.setNewAssignee(issue, "another_user_uuid", context);
  115. }
  116. @Test
  117. public void set_severity() {
  118. boolean updated = underTest.setSeverity(issue, "BLOCKER", context);
  119. assertThat(updated).isTrue();
  120. assertThat(issue.severity()).isEqualTo("BLOCKER");
  121. assertThat(issue.manualSeverity()).isFalse();
  122. assertThat(issue.mustSendNotifications()).isFalse();
  123. FieldDiffs.Diff diff = issue.currentChange().get(SEVERITY);
  124. assertThat(diff.oldValue()).isNull();
  125. assertThat(diff.newValue()).isEqualTo("BLOCKER");
  126. }
  127. @Test
  128. public void set_past_severity() {
  129. issue.setSeverity("BLOCKER");
  130. boolean updated = underTest.setPastSeverity(issue, "INFO", context);
  131. assertThat(updated).isTrue();
  132. assertThat(issue.severity()).isEqualTo("BLOCKER");
  133. assertThat(issue.mustSendNotifications()).isFalse();
  134. FieldDiffs.Diff diff = issue.currentChange().get(SEVERITY);
  135. assertThat(diff.oldValue()).isEqualTo("INFO");
  136. assertThat(diff.newValue()).isEqualTo("BLOCKER");
  137. }
  138. @Test
  139. public void update_severity() {
  140. issue.setSeverity("BLOCKER");
  141. boolean updated = underTest.setSeverity(issue, "MINOR", context);
  142. assertThat(updated).isTrue();
  143. assertThat(issue.severity()).isEqualTo("MINOR");
  144. assertThat(issue.mustSendNotifications()).isFalse();
  145. FieldDiffs.Diff diff = issue.currentChange().get(SEVERITY);
  146. assertThat(diff.oldValue()).isEqualTo("BLOCKER");
  147. assertThat(diff.newValue()).isEqualTo("MINOR");
  148. }
  149. @Test
  150. public void not_change_severity() {
  151. issue.setSeverity("MINOR");
  152. boolean updated = underTest.setSeverity(issue, "MINOR", context);
  153. assertThat(updated).isFalse();
  154. assertThat(issue.mustSendNotifications()).isFalse();
  155. assertThat(issue.currentChange()).isNull();
  156. }
  157. @Test
  158. public void not_revert_manual_severity() {
  159. issue.setSeverity("MINOR").setManualSeverity(true);
  160. try {
  161. underTest.setSeverity(issue, "MAJOR", context);
  162. } catch (IllegalStateException e) {
  163. assertThat(e).hasMessage("Severity can't be changed");
  164. }
  165. }
  166. @Test
  167. public void set_manual_severity() {
  168. issue.setSeverity("BLOCKER");
  169. boolean updated = underTest.setManualSeverity(issue, "MINOR", context);
  170. assertThat(updated).isTrue();
  171. assertThat(issue.severity()).isEqualTo("MINOR");
  172. assertThat(issue.manualSeverity()).isTrue();
  173. assertThat(issue.mustSendNotifications()).isTrue();
  174. FieldDiffs.Diff diff = issue.currentChange().get(SEVERITY);
  175. assertThat(diff.oldValue()).isEqualTo("BLOCKER");
  176. assertThat(diff.newValue()).isEqualTo("MINOR");
  177. }
  178. @Test
  179. public void not_change_manual_severity() {
  180. issue.setSeverity("MINOR").setManualSeverity(true);
  181. boolean updated = underTest.setManualSeverity(issue, "MINOR", context);
  182. assertThat(updated).isFalse();
  183. assertThat(issue.currentChange()).isNull();
  184. assertThat(issue.mustSendNotifications()).isFalse();
  185. }
  186. @Test
  187. public void unset_line() {
  188. int line = 1 + new Random().nextInt(500);
  189. issue.setLine(line);
  190. boolean updated = underTest.unsetLine(issue, context);
  191. assertThat(updated).isTrue();
  192. assertThat(issue.isChanged()).isTrue();
  193. assertThat(issue.line()).isNull();
  194. assertThat(issue.mustSendNotifications()).isFalse();
  195. assertThat(issue.currentChange())
  196. .extracting(f -> f.diffs().size())
  197. .isEqualTo(1);
  198. FieldDiffs.Diff diff = issue.currentChange().diffs().get("line");
  199. assertThat(diff.oldValue()).isEqualTo(line);
  200. assertThat(diff.newValue()).isEqualTo("");
  201. }
  202. @Test
  203. public void unset_line_has_no_effect_if_line_is_already_null() {
  204. issue.setLine(null);
  205. boolean updated = underTest.unsetLine(issue, context);
  206. assertThat(updated).isFalse();
  207. assertThat(issue.line()).isNull();
  208. assertThat(issue.isChanged()).isFalse();
  209. assertThat(issue.currentChange()).isNull();
  210. assertThat(issue.mustSendNotifications()).isFalse();
  211. }
  212. @Test
  213. public void set_past_line() {
  214. issue.setLine(42);
  215. boolean updated = underTest.setPastLine(issue, 123);
  216. assertThat(updated).isTrue();
  217. assertThat(issue.isChanged()).isTrue();
  218. assertThat(issue.line()).isEqualTo(42);
  219. assertThat(issue.mustSendNotifications()).isFalse();
  220. // do not save change
  221. assertThat(issue.currentChange()).isNull();
  222. }
  223. @Test
  224. public void set_past_line_has_no_effect_if_line_already_had_value() {
  225. issue.setLine(42);
  226. boolean updated = underTest.setPastLine(issue, 42);
  227. assertThat(updated).isFalse();
  228. assertThat(issue.isChanged()).isFalse();
  229. assertThat(issue.line()).isEqualTo(42);
  230. assertThat(issue.mustSendNotifications()).isFalse();
  231. // do not save change
  232. assertThat(issue.currentChange()).isNull();
  233. }
  234. @Test
  235. public void change_locations() {
  236. issue.setLocations("[1-3]");
  237. boolean updated = underTest.setLocations(issue, "[1-4]");
  238. assertThat(updated).isTrue();
  239. assertThat(issue.getLocations().toString()).isEqualTo("[1-4]");
  240. assertThat(issue.currentChange()).isNull();
  241. assertThat(issue.mustSendNotifications()).isFalse();
  242. }
  243. @Test
  244. public void do_not_change_locations() {
  245. issue.setLocations("[1-3]");
  246. boolean updated = underTest.setLocations(issue, "[1-3]");
  247. assertThat(updated).isFalse();
  248. assertThat(issue.getLocations().toString()).isEqualTo("[1-3]");
  249. assertThat(issue.currentChange()).isNull();
  250. assertThat(issue.mustSendNotifications()).isFalse();
  251. }
  252. @Test
  253. public void set_locations_for_the_first_time() {
  254. issue.setLocations(null);
  255. boolean updated = underTest.setLocations(issue, "[1-4]");
  256. assertThat(updated).isTrue();
  257. assertThat(issue.getLocations().toString()).isEqualTo("[1-4]");
  258. assertThat(issue.currentChange()).isNull();
  259. assertThat(issue.mustSendNotifications()).isFalse();
  260. }
  261. @Test
  262. public void set_resolution() {
  263. boolean updated = underTest.setResolution(issue, "OPEN", context);
  264. assertThat(updated).isTrue();
  265. assertThat(issue.resolution()).isEqualTo("OPEN");
  266. FieldDiffs.Diff diff = issue.currentChange().get(RESOLUTION);
  267. assertThat(diff.oldValue()).isNull();
  268. assertThat(diff.newValue()).isEqualTo("OPEN");
  269. assertThat(issue.mustSendNotifications()).isTrue();
  270. }
  271. @Test
  272. public void not_change_resolution() {
  273. issue.setResolution("FIXED");
  274. boolean updated = underTest.setResolution(issue, "FIXED", context);
  275. assertThat(updated).isFalse();
  276. assertThat(issue.resolution()).isEqualTo("FIXED");
  277. assertThat(issue.currentChange()).isNull();
  278. assertThat(issue.mustSendNotifications()).isFalse();
  279. }
  280. @Test
  281. public void set_status() {
  282. boolean updated = underTest.setStatus(issue, "OPEN", context);
  283. assertThat(updated).isTrue();
  284. assertThat(issue.status()).isEqualTo("OPEN");
  285. FieldDiffs.Diff diff = issue.currentChange().get(STATUS);
  286. assertThat(diff.oldValue()).isNull();
  287. assertThat(diff.newValue()).isEqualTo("OPEN");
  288. assertThat(issue.mustSendNotifications()).isTrue();
  289. }
  290. @Test
  291. public void not_change_status() {
  292. issue.setStatus("CLOSED");
  293. boolean updated = underTest.setStatus(issue, "CLOSED", context);
  294. assertThat(updated).isFalse();
  295. assertThat(issue.status()).isEqualTo("CLOSED");
  296. assertThat(issue.currentChange()).isNull();
  297. assertThat(issue.mustSendNotifications()).isFalse();
  298. }
  299. @Test
  300. public void set_new_attribute_value() {
  301. boolean updated = underTest.setAttribute(issue, "JIRA", "FOO-123", context);
  302. assertThat(updated).isTrue();
  303. assertThat(issue.attribute("JIRA")).isEqualTo("FOO-123");
  304. assertThat(issue.currentChange().diffs()).hasSize(1);
  305. assertThat(issue.currentChange().get("JIRA").oldValue()).isNull();
  306. assertThat(issue.currentChange().get("JIRA").newValue()).isEqualTo("FOO-123");
  307. assertThat(issue.mustSendNotifications()).isFalse();
  308. }
  309. @Test
  310. public void unset_attribute() {
  311. issue.setAttribute("JIRA", "FOO-123");
  312. boolean updated = underTest.setAttribute(issue, "JIRA", null, context);
  313. assertThat(updated).isTrue();
  314. assertThat(issue.attribute("JIRA")).isNull();
  315. assertThat(issue.currentChange().diffs()).hasSize(1);
  316. assertThat(issue.currentChange().get("JIRA").oldValue()).isEqualTo("FOO-123");
  317. assertThat(issue.currentChange().get("JIRA").newValue()).isNull();
  318. assertThat(issue.mustSendNotifications()).isFalse();
  319. }
  320. @Test
  321. public void not_update_attribute() {
  322. issue.setAttribute("JIRA", "FOO-123");
  323. boolean updated = underTest.setAttribute(issue, "JIRA", "FOO-123", context);
  324. assertThat(updated).isFalse();
  325. assertThat(issue.mustSendNotifications()).isFalse();
  326. }
  327. @Test
  328. public void set_gap_to_fix() {
  329. boolean updated = underTest.setGap(issue, 3.14, context);
  330. assertThat(updated).isTrue();
  331. assertThat(issue.isChanged()).isTrue();
  332. assertThat(issue.gap()).isEqualTo(3.14);
  333. assertThat(issue.mustSendNotifications()).isFalse();
  334. }
  335. @Test
  336. public void not_set_gap_to_fix_if_unchanged() {
  337. issue.setGap(3.14);
  338. boolean updated = underTest.setGap(issue, 3.14, context);
  339. assertThat(updated).isFalse();
  340. assertThat(issue.isChanged()).isFalse();
  341. assertThat(issue.gap()).isEqualTo(3.14);
  342. assertThat(issue.mustSendNotifications()).isFalse();
  343. }
  344. @Test
  345. public void set_past_gap() {
  346. issue.setGap(3.14);
  347. boolean updated = underTest.setPastGap(issue, 1.0, context);
  348. assertThat(updated).isTrue();
  349. assertThat(issue.gap()).isEqualTo(3.14);
  350. // do not save change
  351. assertThat(issue.currentChange()).isNull();
  352. assertThat(issue.mustSendNotifications()).isFalse();
  353. }
  354. @Test
  355. public void set_past_technical_debt() {
  356. Duration newDebt = Duration.create(15 * 8 * 60);
  357. Duration previousDebt = Duration.create(10 * 8 * 60);
  358. issue.setEffort(newDebt);
  359. boolean updated = underTest.setPastEffort(issue, previousDebt, context);
  360. assertThat(updated).isTrue();
  361. assertThat(issue.effort()).isEqualTo(newDebt);
  362. assertThat(issue.mustSendNotifications()).isFalse();
  363. FieldDiffs.Diff diff = issue.currentChange().get(TECHNICAL_DEBT);
  364. assertThat(diff.oldValue()).isEqualTo(10L * 8 * 60);
  365. assertThat(diff.newValue()).isEqualTo(15L * 8 * 60);
  366. }
  367. @Test
  368. public void set_past_technical_debt_without_previous_value() {
  369. Duration newDebt = Duration.create(15 * 8 * 60);
  370. issue.setEffort(newDebt);
  371. boolean updated = underTest.setPastEffort(issue, null, context);
  372. assertThat(updated).isTrue();
  373. assertThat(issue.effort()).isEqualTo(newDebt);
  374. assertThat(issue.mustSendNotifications()).isFalse();
  375. FieldDiffs.Diff diff = issue.currentChange().get(TECHNICAL_DEBT);
  376. assertThat(diff.oldValue()).isNull();
  377. assertThat(diff.newValue()).isEqualTo(15L * 8 * 60);
  378. }
  379. @Test
  380. public void set_past_technical_debt_with_null_new_value() {
  381. issue.setEffort(null);
  382. Duration previousDebt = Duration.create(10 * 8 * 60);
  383. boolean updated = underTest.setPastEffort(issue, previousDebt, context);
  384. assertThat(updated).isTrue();
  385. assertThat(issue.effort()).isNull();
  386. assertThat(issue.mustSendNotifications()).isFalse();
  387. FieldDiffs.Diff diff = issue.currentChange().get(TECHNICAL_DEBT);
  388. assertThat(diff.oldValue()).isEqualTo(10L * 8 * 60);
  389. assertThat(diff.newValue()).isNull();
  390. }
  391. @Test
  392. public void set_message() {
  393. boolean updated = underTest.setMessage(issue, "the message", context);
  394. assertThat(updated).isTrue();
  395. assertThat(issue.isChanged()).isTrue();
  396. assertThat(issue.message()).isEqualTo("the message");
  397. assertThat(issue.mustSendNotifications()).isFalse();
  398. }
  399. @Test
  400. public void set_past_message() {
  401. issue.setMessage("new message");
  402. boolean updated = underTest.setPastMessage(issue, "past message", context);
  403. assertThat(updated).isTrue();
  404. assertThat(issue.message()).isEqualTo("new message");
  405. // do not save change
  406. assertThat(issue.currentChange()).isNull();
  407. assertThat(issue.mustSendNotifications()).isFalse();
  408. }
  409. @Test
  410. public void set_author() {
  411. boolean updated = underTest.setAuthorLogin(issue, "eric", context);
  412. assertThat(updated).isTrue();
  413. assertThat(issue.authorLogin()).isEqualTo("eric");
  414. FieldDiffs.Diff diff = issue.currentChange().get("author");
  415. assertThat(diff.oldValue()).isNull();
  416. assertThat(diff.newValue()).isEqualTo("eric");
  417. assertThat(issue.mustSendNotifications()).isFalse();
  418. }
  419. @Test
  420. public void set_new_author() {
  421. boolean updated = underTest.setNewAuthor(issue, "simon", context);
  422. assertThat(updated).isTrue();
  423. FieldDiffs.Diff diff = issue.currentChange().get("author");
  424. assertThat(diff.oldValue()).isNull();
  425. assertThat(diff.newValue()).isEqualTo("simon");
  426. assertThat(issue.mustSendNotifications()).isFalse();
  427. }
  428. @Test
  429. public void not_set_new_author_if_new_author_is_null() {
  430. boolean updated = underTest.setNewAuthor(issue, null, context);
  431. assertThat(updated).isFalse();
  432. assertThat(issue.currentChange()).isNull();
  433. assertThat(issue.mustSendNotifications()).isFalse();
  434. }
  435. @Test
  436. public void fail_with_ISE_when_setting_new_author_on_issue() {
  437. issue.setAuthorLogin("simon");
  438. thrown.expect(IllegalStateException.class);
  439. thrown.expectMessage("It's not possible to update the author with this method, please use setAuthorLogin()");
  440. underTest.setNewAuthor(issue, "julien", context);
  441. }
  442. @Test
  443. public void setIssueMoved_has_no_effect_if_component_uuid_is_not_changed() {
  444. String componentUuid = "a";
  445. issue.setComponentUuid(componentUuid);
  446. underTest.setIssueMoved(issue, componentUuid, context);
  447. assertThat(issue.changes()).isEmpty();
  448. assertThat(issue.componentUuid()).isEqualTo(componentUuid);
  449. assertThat(issue.isChanged()).isFalse();
  450. assertThat(issue.updateDate()).isNull();
  451. assertThat(issue.mustSendNotifications()).isFalse();
  452. }
  453. @Test
  454. public void setIssueMoved_changes_componentUuid_adds_a_change() {
  455. String oldComponentUuid = "a";
  456. String newComponentUuid = "b";
  457. issue.setComponentUuid(oldComponentUuid);
  458. underTest.setIssueMoved(issue, newComponentUuid, context);
  459. assertThat(issue.changes()).hasSize(1);
  460. FieldDiffs fieldDiffs = issue.changes().get(0);
  461. assertThat(fieldDiffs.creationDate()).isEqualTo(context.date());
  462. assertThat(fieldDiffs.diffs()).hasSize(1);
  463. Map.Entry<String, FieldDiffs.Diff> entry = fieldDiffs.diffs().entrySet().iterator().next();
  464. assertThat(entry.getKey()).isEqualTo("file");
  465. assertThat(entry.getValue().oldValue()).isEqualTo(oldComponentUuid);
  466. assertThat(entry.getValue().newValue()).isEqualTo(newComponentUuid);
  467. assertThat(issue.componentUuid()).isEqualTo(newComponentUuid);
  468. assertThat(issue.isChanged()).isTrue();
  469. assertThat(issue.updateDate()).isEqualTo(DateUtils.truncate(context.date(), Calendar.SECOND));
  470. }
  471. }