Skip to content

Commit f0fd18c

Browse files
committed
Tests fixed
1 parent c1abcf4 commit f0fd18c

File tree

5 files changed

+8
-7
lines changed

5 files changed

+8
-7
lines changed

src/test/java/git/tracehub/pmo/controller/ProjectControllerTest.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
import io.github.eocqrs.eokson.JsonOf;
2626
import io.github.eocqrs.eokson.MutableJson;
2727
import java.util.Map;
28+
import org.cactoos.Scalar;
2829
import org.cactoos.io.ResourceOf;
2930
import org.junit.jupiter.api.Test;
3031
import org.junit.jupiter.api.extension.ExtendWith;
@@ -101,7 +102,7 @@ void createsNewProject() throws Exception {
101102
final Platform platform = Mockito.mock(GithubPlatform.class);
102103
Mockito.when(this.platforms.get(Mockito.any()))
103104
.thenReturn(platform);
104-
Mockito.when(this.projects.employ(Mockito.any(Project.class)))
105+
Mockito.when(this.projects.employ(Mockito.any(Scalar.class)))
105106
.thenReturn(
106107
new Project(
107108
"74bb5ec8-0e6b-4618-bfa4-a0b76b7b312d",

src/test/java/git/tracehub/pmo/project/DefaultProjectsTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ void employsProject() throws SQLException {
155155
);
156156
this.mock(expected);
157157
Mockito.when(this.set.next()).thenReturn(true);
158-
final Project project = this.projects.employ(expected);
158+
final Project project = this.projects.employ(() -> expected);
159159
MatcherAssert.assertThat(
160160
"Project %s is null".formatted(project),
161161
true,
@@ -190,7 +190,7 @@ void throwsOnCreatingInvalidProject() throws SQLException {
190190
new Assertion<>(
191191
"Exception is not thrown or valid",
192192
() -> this.projects.employ(
193-
new Project(
193+
() -> new Project(
194194
"Test Project",
195195
"Location",
196196
"Description",

src/test/java/git/tracehub/pmo/ticket/DefaultTicketsTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ void createsTicket() throws SQLException {
162162
);
163163
this.mock(expected);
164164
Mockito.when(this.set.next()).thenReturn(true);
165-
final Ticket ticket = this.tickets.create(expected);
165+
final Ticket ticket = this.tickets.create(() -> expected);
166166
MatcherAssert.assertThat(
167167
"Ticket %s isn't created".formatted(ticket),
168168
true,
@@ -214,7 +214,7 @@ void throwsOnCreatingInvalidTicket() throws SQLException {
214214
new Assertion<>(
215215
"Exception is not thrown or valid",
216216
() -> this.tickets.create(
217-
new Ticket(
217+
() -> new Ticket(
218218
UUID.randomUUID(),
219219
35,
220220
"user/repo",

src/test/java/it/database/DefaultProjectsIT.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ void employsProject() {
105105
"Description",
106106
true
107107
);
108-
final Project project = this.projects.employ(expected);
108+
final Project project = this.projects.employ(() -> expected);
109109
MatcherAssert.assertThat(
110110
"Project %s is null".formatted(project),
111111
true,

src/test/java/it/database/DefaultTicketsIT.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ void createsTicket() {
113113
"path/to/job",
114114
Ticket.Status.OPENED
115115
);
116-
final Ticket ticket = this.tickets.create(expected);
116+
final Ticket ticket = this.tickets.create(() -> expected);
117117
MatcherAssert.assertThat(
118118
"Ticket %s is null".formatted(ticket),
119119
true,

0 commit comments

Comments
 (0)