-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix current status in gitlab * query status in mongo rather than in java
- Loading branch information
Showing
8 changed files
with
84 additions
and
46 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,6 +37,7 @@ | |
@TestHTTPEndpoint(EngagementResource.class) | ||
@QuarkusTestResource(ExternalApiWireMock.class) | ||
class EngagementResourceTest { | ||
|
||
private static final String AUTHOR = "Mitch"; | ||
private static final String AUTHOR_EMAIL = "[email protected]"; | ||
|
||
|
@@ -101,7 +102,7 @@ void testGetAllEngagementsForState() { | |
|
||
@Test | ||
void testGetEngagementsForTypeRegionAndState() { | ||
engagementService.create(Engagement.builder().name("unit test").customerName("blue hat").region("latam").type("Residency").build()); | ||
engagementService.create(Engagement.builder().name("unit test").customerName("blue hat").region("latam").type("Residency").currentState(EngagementState.UPCOMING).build()); | ||
|
||
given().queryParam("inStates", EngagementState.UPCOMING) | ||
.queryParam("region", "na") | ||
|
33 changes: 33 additions & 0 deletions
33
src/test/java/com/redhat/labs/lodestar/engagements/rest/client/GitlabApiClientTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package com.redhat.labs.lodestar.engagements.rest.client; | ||
|
||
import com.redhat.labs.lodestar.engagements.exception.EngagementGitlabException; | ||
import com.redhat.labs.lodestar.engagements.model.Engagement; | ||
import io.quarkus.test.junit.QuarkusTest; | ||
import org.junit.jupiter.api.Assertions; | ||
import org.junit.jupiter.api.Test; | ||
|
||
import javax.inject.Inject; | ||
import java.util.Optional; | ||
|
||
@QuarkusTest | ||
class GitlabApiClientTest { | ||
|
||
@Inject | ||
GitlabApiClient gitlabApiClient; | ||
|
||
@Test | ||
void getEngagementException() { | ||
EngagementGitlabException ex = Assertions.assertThrows(EngagementGitlabException.class, () -> { | ||
gitlabApiClient.getEngagement(8675309); | ||
}); | ||
|
||
Assertions.assertEquals(500, ex.getStatusCode()); | ||
} | ||
|
||
@Test | ||
void getEngagementNotFound() { | ||
Optional<Engagement> option = gitlabApiClient.getEngagement(8675308); | ||
|
||
Assertions.assertTrue(option.isEmpty()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters