Skip to content

Commit

Permalink
Merge pull request #76 from ministryofjustice/LCAM-1148
Browse files Browse the repository at this point in the history
Lcam 1148
  • Loading branch information
skasthuri36326 authored Jan 16, 2024
2 parents 8524afd + 1304916 commit 337aa4b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 36 deletions.
38 changes: 9 additions & 29 deletions crime-evidence/build.gradle
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import org.springframework.boot.gradle.plugin.SpringBootPlugin

plugins {
id "java"
id "jacoco"
id "org.springframework.boot" version "3.1.2"
id "org.springframework.boot" version "3.1.5"
id 'io.spring.dependency-management' version '1.1.4'
id "org.sonarqube" version "4.0.0.2929"
id "info.solidsoft.pitest" version "1.9.11"
id "org.jsonschema2dataclass" version "6.0.0"
Expand All @@ -16,14 +15,10 @@ jacoco {
}

def versions = [
okhttpVersion : "4.9.3",
sentryVersion : "7.0.0",
mockwebserverVersion : "4.11.0",
pitest : "1.4.10",
commonsLang3Version : "3.10",
crimeCommonsVersion : "2.13.6",
wiremockVersion : "2.35.0",
springDocWebMVCVersion : "2.1.0"
pitest : "1.4.10",
crimeCommonsVersion : "2.13.6",
wmStubRunnerVersion : "4.0.1",
springDocWebMVCVersion : "2.1.0"
]

java {
Expand All @@ -41,40 +36,25 @@ repositories {
}

dependencies {
implementation platform(SpringBootPlugin.BOM_COORDINATES)
annotationProcessor platform(SpringBootPlugin.BOM_COORDINATES)

implementation platform("io.sentry:sentry-bom:$versions.sentryVersion")
implementation("io.sentry:sentry-spring-boot-starter-jakarta")
implementation("io.sentry:sentry-logback")
implementation "uk.gov.justice.service.laa-crime:crime-commons-spring-boot-starter-rest-client:$versions.crimeCommonsVersion:all"
implementation "uk.gov.justice.service.laa-crime:crime-commons-classes:$versions.crimeCommonsVersion"

implementation "org.springframework.boot:spring-boot-starter-web"
implementation "org.springframework.boot:spring-boot-starter-actuator"
implementation "org.springframework.boot:spring-boot-starter-webflux"
implementation "org.springframework.boot:spring-boot-starter-validation"
implementation "org.springframework.boot:spring-boot-starter-oauth2-resource-server"
implementation "org.springframework.boot:spring-boot-starter-oauth2-client"
implementation "org.springframework.boot:spring-boot-starter-data-jpa"

implementation "org.postgresql:postgresql"
implementation "org.liquibase:liquibase-core"
implementation "io.micrometer:micrometer-registry-prometheus"
implementation "org.springdoc:springdoc-openapi-starter-webmvc-ui:$versions.springDocWebMVCVersion"
implementation "org.apache.commons:commons-lang3:$versions.commonsLang3Version"
implementation "uk.gov.justice.service.laa-crime:crime-commons-classes:$versions.crimeCommonsVersion"

implementation "uk.gov.justice.service.laa-crime:crime-commons-spring-boot-starter-rest-client:$versions.crimeCommonsVersion"

compileOnly "org.projectlombok:lombok"
annotationProcessor "org.projectlombok:lombok"
annotationProcessor "org.springframework.boot:spring-boot-configuration-processor"

testImplementation "com.h2database:h2"
testImplementation "org.pitest:pitest:$versions.pitest"
testImplementation "org.springframework.boot:spring-boot-starter-test"
testImplementation "org.springframework.security:spring-security-test"
testImplementation "com.github.tomakehurst:wiremock-jre8-standalone:$versions.wiremockVersion"

testImplementation "org.springframework.cloud:spring-cloud-starter-contract-stub-runner:$versions.wmStubRunnerVersion"
}

configurations {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.actuate.observability.AutoConfigureObservability;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.cloud.contract.wiremock.AutoConfigureWireMock;
import org.springframework.context.annotation.Import;
import org.springframework.http.HttpMethod;
import org.springframework.http.MediaType;
Expand All @@ -28,12 +29,14 @@
import static com.github.tomakehurst.wiremock.client.WireMock.*;
import static org.assertj.core.api.Assertions.assertThat;
import static org.springframework.boot.test.context.SpringBootTest.WebEnvironment.DEFINED_PORT;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.*;

@DirtiesContext
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
@Import(CrimeEvidenceTestConfiguration.class)
@SpringBootTest(classes = CrimeEvidenceApplication.class, webEnvironment = DEFINED_PORT)
@AutoConfigureWireMock(port = 9999)
@AutoConfigureObservability
class CrimeEvidenceIntegrationTest {

Expand All @@ -42,7 +45,9 @@ class CrimeEvidenceIntegrationTest {
private static final String CALCULATE_EVIDENCE_FEE = CCP_ENDPOINT_URL.concat("/calculate-evidence-fee");

private MockMvc mvc;
private static final WireMockServer wiremock = new WireMockServer(9999);

@Autowired
private WireMockServer wiremock;

@Autowired
private ObjectMapper objectMapper;
Expand All @@ -53,21 +58,16 @@ class CrimeEvidenceIntegrationTest {
@Autowired
private WebApplicationContext webApplicationContext;


@AfterEach
void after() {
wiremock.resetAll();
}

@AfterAll
static void clean() {
wiremock.shutdown();
}

@BeforeAll
void startWiremock() {
wiremock.start();
}

@BeforeEach
public void setup() throws JsonProcessingException {
stubForOAuth();
Expand Down

0 comments on commit 337aa4b

Please sign in to comment.