Skip to content

Commit a202961

Browse files
authored
Use @DataMongoTest and @Testcontainers annotations in TaskServiceTests (#664)
1 parent e49e30f commit a202961

File tree

4 files changed

+155
-232
lines changed

4 files changed

+155
-232
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ All notable changes to this project will be documented in this file.
1616

1717
### Quality
1818

19-
- Use `@DataMongoTest` and `@Testcontainers` annotations in replicates and compute logs tests. (#662)
19+
- Use `@DataMongoTest` and `@Testcontainers` annotations in replicates, compute logs and tasks tests. (#662 #664)
2020

2121
## [[8.3.0]](https://github.com/iExecBlockchainComputing/iexec-core/releases/tag/v8.3.0) 2024-01-11
2222

src/main/java/com/iexec/core/task/Task.java

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2020-2023 IEXEC BLOCKCHAIN TECH
2+
* Copyright 2020-2024 IEXEC BLOCKCHAIN TECH
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -145,7 +145,7 @@ public TaskStatus getLastButOneStatus() {
145145

146146
public boolean isConsensusReachedSinceMultiplePeriods(int nbOfPeriods) {
147147
Optional<Date> consensusReachedDate = this.getDateOfStatus(CONSENSUS_REACHED);
148-
if (consensusReachedDate.isEmpty()){
148+
if (consensusReachedDate.isEmpty()) {
149149
return false;
150150
}
151151
Date onePeriodAfterConsensusReachedDate = new Date(consensusReachedDate.get().getTime() + nbOfPeriods * this.maxExecutionTime);
@@ -163,24 +163,24 @@ public Optional<Date> getDateOfStatus(TaskStatus taskStatus) {
163163
return Optional.empty();
164164
}
165165

166-
public boolean isContributionDeadlineReached(){
166+
public boolean isContributionDeadlineReached() {
167167
return new Date().after(contributionDeadline);
168168
}
169169

170-
public boolean inContributionPhase() {
171-
return TaskStatus.isInContributionPhase(getCurrentStatus());
172-
}
170+
public boolean inContributionPhase() {
171+
return TaskStatus.isInContributionPhase(getCurrentStatus());
172+
}
173173

174-
public boolean inRevealPhase() {
175-
return TaskStatus.isInRevealPhase(getCurrentStatus());
176-
}
174+
public boolean inRevealPhase() {
175+
return TaskStatus.isInRevealPhase(getCurrentStatus());
176+
}
177177

178-
public boolean inResultUploadPhase() {
179-
return TaskStatus.isInResultUploadPhase(getCurrentStatus());
180-
}
178+
public boolean inResultUploadPhase() {
179+
return TaskStatus.isInResultUploadPhase(getCurrentStatus());
180+
}
181181

182182
public boolean inCompletionPhase() {
183-
return TaskStatus.isInCompletionPhase(getCurrentStatus());
183+
return TaskStatus.isInCompletionPhase(getCurrentStatus());
184184
}
185185

186186
public boolean isTeeTask() {

src/test/java/com/iexec/core/task/TaskServiceRealRepositoryTest.java

Lines changed: 0 additions & 122 deletions
This file was deleted.

0 commit comments

Comments
 (0)