Skip to content

Commit

Permalink
Tests fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
dukris committed Mar 11, 2024
1 parent f9dcec0 commit 385414f
Show file tree
Hide file tree
Showing 9 changed files with 14 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ void throwsOnInvalidProjectId() throws SQLException {
"Exception is not thrown or valid",
() -> this.projects.byId(id),
new Throws<>(
"Project %s not found".formatted(id),
"404 NOT_FOUND \"Project %s not found\"".formatted(id),
ResourceNotFoundException.class
)
).affirm();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ void throwsOnInvalidKey() throws SQLException {
"Exception is not thrown",
() -> this.secrets.value(key),
new Throws<>(
"Secret with project = %s and key = %s not found"
"404 NOT_FOUND \"Secret with project = %s and key = %s not found\""
.formatted(key.getProject(), key.getName()),
ResourceNotFoundException.class
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ void throwsOnDuplicate() {
"Exception is not thrown or valid",
() -> this.secrets.create(() -> expected),
new Throws<>(
"Secret with project = %s and key = %s already exists"
"409 CONFLICT \"Secret with project = %s and key = %s already exists\""
.formatted(expected.getProject(), expected.getKey()),
ResourceAlreadyExistsException.class
)
Expand All @@ -164,7 +164,7 @@ void throwsOnNonExistentSecret() {
"Exception is not thrown or valid",
() -> this.secrets.update(() -> expected),
new Throws<>(
"Secret with project = %s and key = %s not found"
"404 NOT_FOUND \"Secret with project = %s and key = %s not found\""
.formatted(expected.getProject(), expected.getKey()),
ResourceNotFoundException.class
)
Expand Down
6 changes: 4 additions & 2 deletions src/test/java/git/tracehub/pmo/ticket/DefaultTicketsTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,8 @@ void throwsOnInvalidJob() throws SQLException {
"Exception is not thrown or valid",
() -> this.tickets.byJob(job, repo),
new Throws<>(
"Ticket with job = %s and repo = %s not found".formatted(job, repo),
"404 NOT_FOUND \"Ticket with job = %s and repo = %s not found\""
.formatted(job, repo),
ResourceNotFoundException.class
)
).affirm();
Expand All @@ -208,7 +209,8 @@ void throwsOnInvalidIssueNumber() throws SQLException {
"Exception is not thrown or valid",
() -> this.tickets.byNumber(number, repo),
new Throws<>(
"Ticket with issue = %s and repo = %s not found".formatted(number, repo),
"404 NOT_FOUND \"Ticket with issue = %s and repo = %s not found\""
.formatted(number, repo),
ResourceNotFoundException.class
)
).affirm();
Expand Down
4 changes: 2 additions & 2 deletions src/test/java/it/web/CreateSecretITCase.java
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ void throwsOnDuplicate() throws Exception {
response.status()
),
response.status(),
new IsEqual<>(400)
new IsEqual<>(409)
);
MatcherAssert.assertThat(
"Message %s isn't correct".formatted(response.body()),
Expand All @@ -183,7 +183,7 @@ void throwsOnDuplicate() throws Exception {
new MutableJson()
.with(
"message",
"Secret with project = %s and key = %s already exists"
"409 CONFLICT \"Secret with project = %s and key = %s already exists\""
.formatted(project, key)
)
.toString()
Expand Down
2 changes: 1 addition & 1 deletion src/test/java/it/web/RetrieveSecretByKeyITCase.java
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ void throwsOnInvalidKey() throws Exception {
new MutableJson()
.with(
"message",
"Secret with project = %s and key = %s not found"
"404 NOT_FOUND \"Secret with project = %s and key = %s not found\""
.formatted(project, key)
).toString()
)
Expand Down
2 changes: 1 addition & 1 deletion src/test/java/it/web/RetrieveTicketByJobITCase.java
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ void throwsOnInvalidJob() throws Exception {
new MutableJson()
.with(
"message",
"Ticket with job = %s and repo = %s not found"
"404 NOT_FOUND \"Ticket with job = %s and repo = %s not found\""
.formatted(job, repo)
).toString()
)
Expand Down
2 changes: 1 addition & 1 deletion src/test/java/it/web/RetrieveTicketByNumberITCase.java
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ void throwsOnInvalidNumber() throws Exception {
new MutableJson()
.with(
"message",
"Ticket with issue = %s and repo = %s not found"
"404 NOT_FOUND \"Ticket with issue = %s and repo = %s not found\""
.formatted(number, repo)
).toString()
)
Expand Down
2 changes: 1 addition & 1 deletion src/test/java/it/web/UpdateSecretITCase.java
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ void throwsOnNonExistentSecret() throws Exception {
new MutableJson()
.with(
"message",
"Secret with project = %s and key = %s not found"
"404 NOT_FOUND \"Secret with project = %s and key = %s not found\""
.formatted(project, key)
)
.toString()
Expand Down

0 comments on commit 385414f

Please sign in to comment.