-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into AM-3058_FTA_ET_JudicialOrgRoles
- Loading branch information
Showing
20 changed files
with
150 additions
and
96 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
1.6.4 | ||
1.6.5 |
45 changes: 45 additions & 0 deletions
45
src/contractTest/java/uk/gov/hmcts/reform/orgrolemapping/BaseTestContract.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,45 @@ | ||
package uk.gov.hmcts.reform.orgrolemapping; | ||
|
||
import com.fasterxml.jackson.core.JsonProcessingException; | ||
import org.springframework.context.ApplicationContextInitializer; | ||
import org.springframework.context.ApplicationListener; | ||
import org.springframework.context.ConfigurableApplicationContext; | ||
import org.springframework.context.event.ContextClosedEvent; | ||
import org.springframework.lang.NonNull; | ||
import org.springframework.test.context.ActiveProfiles; | ||
import org.springframework.test.context.ContextConfiguration; | ||
import org.springframework.test.context.support.TestPropertySourceUtils; | ||
import uk.gov.hmcts.reform.orgrolemapping.controller.BaseTest; | ||
import uk.gov.hmcts.reform.orgrolemapping.controller.utils.WiremockFixtures; | ||
|
||
@ContextConfiguration(initializers = {BaseTestContract.WireMockServerInitializer.class}) | ||
@ActiveProfiles("ctest") | ||
public abstract class BaseTestContract extends BaseTest { | ||
|
||
public static class WireMockServerInitializer | ||
implements ApplicationContextInitializer<ConfigurableApplicationContext> { | ||
|
||
private final WiremockFixtures wiremockFixtures = new WiremockFixtures(); | ||
|
||
@Override | ||
public void initialize(@NonNull ConfigurableApplicationContext applicationContext) { | ||
|
||
TestPropertySourceUtils.addInlinedPropertiesToEnvironment( | ||
applicationContext, | ||
"wiremock.server.port=" + WIRE_MOCK_SERVER.port() | ||
); | ||
|
||
try { | ||
wiremockFixtures.stubIdamConfig(); | ||
} catch (JsonProcessingException e) { | ||
throw new RuntimeException(e); | ||
} | ||
|
||
applicationContext.addApplicationListener((ApplicationListener<ContextClosedEvent>) event -> { | ||
if (WIRE_MOCK_SERVER.isRunning()) { | ||
WIRE_MOCK_SERVER.shutdown(); | ||
} | ||
}); | ||
} | ||
} | ||
} |
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
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,18 @@ | ||
spring: | ||
security: | ||
oauth2: | ||
client: | ||
provider: | ||
oidc: | ||
issuer-uri: http://localhost:${wiremock.server.port:5000}/o | ||
|
||
idam: | ||
s2s-auth: | ||
url: http://localhost:${wiremock.server.port:4502} | ||
api.url: http://localhost:${wiremock.server.port:5000} | ||
|
||
feign: | ||
client: | ||
config: | ||
roleAssignmentApp: | ||
url: http://localhost:${wiremock.server.port:4096} |
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
Oops, something went wrong.