removed unnecessary getTask-call

This commit is contained in:
Jörg Heffner 2020-05-14 08:50:02 +02:00
parent 15202946f4
commit b82741a2b4
2 changed files with 1 additions and 30 deletions

View File

@ -67,8 +67,6 @@ class TaskCommentServiceImpl {
taskanaEngine.openConnection();
taskService.getTask(taskCommentImplToUpdate.getTaskId());
TaskComment originalTaskComment = getTaskComment(taskCommentImplToUpdate.getId());
if (originalTaskComment.getCreator().equals(userId)

View File

@ -214,34 +214,7 @@ class TaskCommentControllerIntTest {
.extracting(ex -> ((HttpClientErrorException) ex).getStatusCode())
.isEqualTo(HttpStatus.FORBIDDEN);
}
@Test
void should_FailToUpdateTaskComment_When_TaskIsNotExisting() {
final ObjectMapper mapper = new ObjectMapper();
TaskCommentResource taskCommentResourceToUpdate = new TaskCommentResource();
taskCommentResourceToUpdate.setTaskId("TKI:000000000000000000000000000000009999");
taskCommentResourceToUpdate.setTaskCommentId("TCI:000000000000000000000000000000000000");
taskCommentResourceToUpdate.setTextField("updated text");
String url =
restHelper.toUrl(Mapping.URL_TASK_COMMENT, "TCI:000000000000000000000000000000000000");
ThrowingCallable httpCall =
() -> {
template.exchange(
url,
HttpMethod.PUT,
new HttpEntity<>(
mapper.writeValueAsString(taskCommentResourceToUpdate),
restHelper.getHeadersUser_1_1()),
ParameterizedTypeReference.forType(TaskCommentResource.class));
};
assertThatThrownBy(httpCall)
.extracting(ex -> ((HttpClientErrorException) ex).getStatusCode())
.isEqualTo(HttpStatus.NOT_FOUND);
}
@Test
void should_FailToUpdateTaskComment_When_TaskCommentIdInResourceDoesNotMatchPathVariable() {