diff options
author | Pierre Guillot <50145663+pierre-guillot-sonarsource@users.noreply.github.com> | 2020-11-25 16:03:57 +0100 |
---|---|---|
committer | sonartech <sonartech@sonarsource.com> | 2020-11-25 20:06:27 +0000 |
commit | ca8d160e00e48c957e7fda1268089bee411a0187 (patch) | |
tree | 23aa603b699e516032fbf6f84ccc38a94847658e /server/sonar-ce-common | |
parent | 926ff7f595de3d1d978965b61f4e07af0a310c98 (diff) | |
download | sonarqube-ca8d160e00e48c957e7fda1268089bee411a0187.tar.gz sonarqube-ca8d160e00e48c957e7fda1268089bee411a0187.zip |
remove code smells
Diffstat (limited to 'server/sonar-ce-common')
-rw-r--r-- | server/sonar-ce-common/src/test/java/org/sonar/ce/queue/CeQueueImplTest.java | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/server/sonar-ce-common/src/test/java/org/sonar/ce/queue/CeQueueImplTest.java b/server/sonar-ce-common/src/test/java/org/sonar/ce/queue/CeQueueImplTest.java index 1bc242c5702..b2bdccb22a1 100644 --- a/server/sonar-ce-common/src/test/java/org/sonar/ce/queue/CeQueueImplTest.java +++ b/server/sonar-ce-common/src/test/java/org/sonar/ce/queue/CeQueueImplTest.java @@ -389,7 +389,7 @@ public class CeQueueImplTest { underTest.cancel(db.getSession(), queueDto); Optional<CeActivityDto> activity = db.getDbClient().ceActivityDao().selectByUuid(db.getSession(), task.getUuid()); - assertThat(activity.isPresent()).isTrue(); + assertThat(activity).isPresent(); assertThat(activity.get().getStatus()).isEqualTo(CeActivityDto.Status.CANCELED); } @@ -420,7 +420,7 @@ public class CeQueueImplTest { Optional<CeActivityDto> ceActivityPending1 = db.getDbClient().ceActivityDao().selectByUuid(db.getSession(), pendingTask2.getUuid()); assertThat(ceActivityPending1.get().getStatus()).isEqualTo(CeActivityDto.Status.CANCELED); Optional<CeActivityDto> ceActivityPending2 = db.getDbClient().ceActivityDao().selectByUuid(db.getSession(), inProgressTask.getUuid()); - assertThat(ceActivityPending2.isPresent()).isFalse(); + assertThat(ceActivityPending2).isNotPresent(); } @Test @@ -485,7 +485,7 @@ public class CeQueueImplTest { underTest.fail(db.getSession(), queueDto, "TIMEOUT", "Failed on timeout"); Optional<CeActivityDto> activity = db.getDbClient().ceActivityDao().selectByUuid(db.getSession(), task.getUuid()); - assertThat(activity.isPresent()).isTrue(); + assertThat(activity).isPresent(); assertThat(activity.get().getStatus()).isEqualTo(CeActivityDto.Status.FAILED); assertThat(activity.get().getErrorType()).isEqualTo("TIMEOUT"); assertThat(activity.get().getErrorMessage()).isEqualTo("Failed on timeout"); @@ -550,7 +550,7 @@ public class CeQueueImplTest { private void verifyCeQueueDtoForTaskSubmit(CeTaskSubmit taskSubmit) { Optional<CeQueueDto> queueDto = db.getDbClient().ceQueueDao().selectByUuid(db.getSession(), taskSubmit.getUuid()); - assertThat(queueDto.isPresent()).isTrue(); + assertThat(queueDto).isPresent(); assertThat(queueDto.get().getTaskType()).isEqualTo(taskSubmit.getType()); Optional<Component> component = taskSubmit.getComponent(); if (component.isPresent()) { |