Skip to content

Commit

Permalink
Oppgradert gradle wrapper og spring dependency management
Browse files Browse the repository at this point in the history
Endret en del av oppsettet for Brreg
#deploy-brreg-stub
  • Loading branch information
stigus committed Jan 11, 2024
1 parent ebb9fb9 commit 6a9d9cf
Show file tree
Hide file tree
Showing 209 changed files with 225 additions and 231 deletions.
2 changes: 1 addition & 1 deletion apps/adresse-service/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ plugins {
id 'java'
id "org.sonarqube" version "4.0.0.2929"
id 'org.springframework.boot' version "3.2.1"
id 'io.spring.dependency-management' version "1.1.3"
id 'io.spring.dependency-management' version "1.1.4"
id "jacoco"
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
2 changes: 1 addition & 1 deletion apps/amelding-service/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ plugins {
id 'java'
id "org.sonarqube" version "4.0.0.2929"
id 'org.springframework.boot' version "3.2.1"
id 'io.spring.dependency-management' version "1.1.3"
id 'io.spring.dependency-management' version "1.1.4"
id "jacoco"
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
2 changes: 1 addition & 1 deletion apps/app-tilgang-analyse-service/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ plugins {
id 'java'
id "org.sonarqube" version "4.0.0.2929"
id 'org.springframework.boot' version "3.2.1"
id 'io.spring.dependency-management' version "1.1.3"
id 'io.spring.dependency-management' version "1.1.4"
id "jacoco"
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
2 changes: 1 addition & 1 deletion apps/arbeidsforhold-service/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ plugins {
id 'java'
id "org.sonarqube" version "4.0.0.2929"
id 'org.springframework.boot' version "3.2.1"
id 'io.spring.dependency-management' version "1.1.3"
id 'io.spring.dependency-management' version "1.1.4"
id "jacoco"
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
2 changes: 1 addition & 1 deletion apps/batch-bestilling-service/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ plugins {
id 'java'
id "org.sonarqube" version "4.0.0.2929"
id 'org.springframework.boot' version "3.2.1"
id 'io.spring.dependency-management' version "1.1.3"
id 'io.spring.dependency-management' version "1.1.4"
id "jacoco"
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
20 changes: 14 additions & 6 deletions apps/brreg-stub/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@ plugins {
id "org.sonarqube" version "4.0.0.2929"
id "uk.co.boothen.gradle.wsimport" version "0.21"
id 'org.springframework.boot' version "3.2.1"
id 'io.spring.dependency-management' version "1.1.3"
id 'io.spring.dependency-management' version "1.1.4"
id "jacoco"
id("org.openrewrite.rewrite") version("6.6.4")
}

test {
Expand Down Expand Up @@ -33,6 +34,10 @@ sonarqube {
}
}

rewrite {
activeRecipe("org.openrewrite.java.spring.boot3.UpgradeSpringBoot_3_2")
}


dependencyManagement {
applyMavenExclusions = false
Expand Down Expand Up @@ -62,6 +67,8 @@ repositories {

dependencies {

rewrite("org.openrewrite.recipe:rewrite-spring:5.2.0")

implementation("io.dropwizard:dropwizard-jackson:4.0.2") {
exclude group: "com.google.code.findbugs"
}
Expand All @@ -75,7 +82,6 @@ dependencies {
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'

implementation 'org.springframework.cloud:spring-cloud-starter-vault-config'
implementation 'org.springframework.vault:spring-vault-core:3.1.0'
implementation 'org.springframework.cloud:spring-cloud-vault-config-databases'
implementation 'org.springframework.boot:spring-boot-starter-actuator'
implementation 'org.springframework.boot:spring-boot-starter-validation'
Expand All @@ -98,6 +104,7 @@ dependencies {
implementation 'com.h2database:h2'

implementation 'wsdl4j:wsdl4j'
jaxWsTools "com.sun.xml.ws:jaxws-rt:2.3.7"
implementation 'net.logstash.logback:logstash-logback-encoder:7.4'
implementation 'org.springdoc:springdoc-openapi-starter-webmvc-ui:2.3.0'
implementation 'io.swagger.core.v3:swagger-annotations-jakarta:2.2.20'
Expand All @@ -107,20 +114,21 @@ dependencies {
implementation 'no.nav.common:cxf:3.2023.10.17_06.55-4e30d96bba05'

implementation 'com.h2database:h2'
implementation "com.sun.xml.ws:jaxws-rt:4.0.2"
testImplementation 'org.testcontainers:junit-jupiter'
testImplementation 'org.testcontainers:postgresql'
implementation 'jakarta.jws:jakarta.jws-api:3.0.0'

testImplementation 'junit:junit:4.13.2' //TODO upgrade to JUnit5
implementation 'jakarta.jws:jakarta.jws-api:3.0.0' //TODO upgrade to JUnit5
testImplementation 'org.springframework.cloud:spring-cloud-contract-wiremock'
testImplementation 'org.springframework.boot:spring-boot-starter-test'

implementation 'org.projectlombok:lombok'
annotationProcessor 'org.projectlombok:lombok'
testAnnotationProcessor 'org.projectlombok:lombok'

testImplementation "org.junit.jupiter:junit-jupiter:5.10.1"
}
java {
toolchain {
languageVersion = JavaLanguageVersion.of(21)
languageVersion = JavaLanguageVersion.of(17)
}
}
2 changes: 1 addition & 1 deletion apps/brreg-stub/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public ClientAuthentication clientAuthentication() {
}
var token = System.getProperty(TOKEN);
if (StringUtils.isBlank(token)) {
throw new IllegalArgumentException(String.format("Påkrevet property '%s' er ikke satt.", TOKEN));
throw new IllegalArgumentException("Påkrevet property '%s' er ikke satt.".formatted(TOKEN));
}
return new TokenAuthentication(System.getProperty(TOKEN));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ public ResponseEntity<Map> lagreEllerOppdaterHentRolleStub(@Valid @RequestBody R
@GetMapping("/{orgnr}")
public ResponseEntity<RsOrganisasjon> hentGrunndata(@NotNull @PathVariable Integer orgnr) {
var grunndata = service.hentRolle(orgnr)
.orElseThrow(() -> new NotFoundException(String.format("Kunne ikke finne roller for :%s",
orgnr)));
.orElseThrow(() -> new NotFoundException("Kunne ikke finne roller for :%s".formatted(
orgnr)));
return ResponseEntity.status(HttpStatus.OK).body(grunndata);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ public ResponseEntity<RolleoversiktTo> lagreEllerOppdaterRolleoversikt(@Valid @R
@GetMapping
public ResponseEntity<RolleoversiktTo> hentRolleoversikt(@NotNull @RequestHeader(name = "Nav-Personident") String ident) {
var grunndata = service.hentRolleoversiktV1(ident)
.orElseThrow(() -> new NotFoundException(String.format("Kunne ikke finne person med fnr:%s",
ident)));
.orElseThrow(() -> new NotFoundException("Kunne ikke finne person med fnr:%s".formatted(
ident)));
return ResponseEntity.status(HttpStatus.OK).body(grunndata);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public ResponseEntity<RsRolleoversikt> lagreEllerOppdaterRolleoversikt(@Valid @R
@GetMapping
public ResponseEntity<RsRolleoversikt> hentRolleoversikt(@NotNull @RequestHeader(name = "Nav-Personident") String ident) {
var grunndata = service.hentRolleoversiktV2(ident)
.orElseThrow(() -> new NotFoundException(String.format("Kunne ikke finne person med fnr:%s", ident)));
.orElseThrow(() -> new NotFoundException("Kunne ikke finne person med fnr:%s".formatted(ident)));
return ResponseEntity.status(HttpStatus.OK).body(grunndata);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import no.nav.brregstub.tjenestekontrakter.ws.HentRolleutskriftResponse;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.ws.server.endpoint.annotation.Endpoint;
import org.springframework.ws.server.endpoint.annotation.PayloadRoot;
import org.springframework.ws.server.endpoint.annotation.RequestPayload;
Expand All @@ -28,7 +27,6 @@ public class BrregEndpoint {

private final BrregService brregService;

@Autowired
public BrregEndpoint(BrregService brregService) {
this.brregService = brregService;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.TestInstance;
import org.junit.jupiter.api.extension.ExtendWith;
import org.mockito.Mockito;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
Expand All @@ -20,7 +19,6 @@
import org.springframework.http.HttpMethod;
import org.springframework.http.HttpStatus;
import org.springframework.test.context.ActiveProfiles;
import org.springframework.test.context.junit.jupiter.SpringExtension;

import java.time.LocalDate;
import java.util.Map;
Expand All @@ -30,7 +28,6 @@

@ActiveProfiles("test")
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
@ExtendWith(SpringExtension.class)
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
public class HentRolleoversiktControllerTest {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.TestInstance;
import org.junit.jupiter.api.extension.ExtendWith;
import org.mockito.Mockito;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
Expand All @@ -16,7 +15,6 @@
import org.springframework.http.HttpMethod;
import org.springframework.http.HttpStatus;
import org.springframework.test.context.ActiveProfiles;
import org.springframework.test.context.junit.jupiter.SpringExtension;

import java.time.LocalDate;
import java.util.Map;
Expand All @@ -26,7 +24,6 @@

@ActiveProfiles("test")
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
@ExtendWith(SpringExtension.class)
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
public class HentRollerControllerTest {

Expand All @@ -39,15 +36,15 @@ public class HentRollerControllerTest {

@Test
@DisplayName("GET rolle returnerer 404 hvis ikke eksisterer")
public void skalKasteNotFoundHvisRolleIkkeEksister() {
void skalKasteNotFoundHvisRolleIkkeEksister() {
var response = restTemplate.getForEntity(API_V_1_ROLLER + "0",
String.class);
assertThat(response.getStatusCode()).isEqualTo(HttpStatus.NOT_FOUND);
}

@Test
@DisplayName("GET rolle returnerer 200 hvis ikke eksisterer")
public void skalHenteRolleutskriftFraDatabase() {
void skalHenteRolleutskriftFraDatabase() {
var nyRolle = new HentRolle();
nyRolle.setOrgnr(1);
nyRolle.setJson("{\"orgnr\": 1}");
Expand All @@ -62,7 +59,7 @@ public void skalHenteRolleutskriftFraDatabase() {

@Test
@DisplayName("DELETE rolle skal slettes fra database")
public void skalSletteRolleutskrift() {
void skalSletteRolleutskrift() {
var rolleSomSkalSlettes = new HentRolle();
rolleSomSkalSlettes.setOrgnr(3);
rolleSomSkalSlettes.setJson("{}");
Expand All @@ -81,7 +78,7 @@ public void skalSletteRolleutskrift() {

@Test
@DisplayName("POST rolle skal opprette ny databaseinnslag")
public void skalLagreRequestIDatabase() {
void skalLagreRequestIDatabase() {
var to = new RsOrganisasjon();
to.setOrgnr(4);
to.setRegistreringsdato(LocalDate.now());
Expand All @@ -96,7 +93,7 @@ public void skalLagreRequestIDatabase() {

@Test
@DisplayName("POST rolle returnere bad request ved manglende feilt")
public void skalReturnereBadRequestVedValideringsFeil() {
void skalReturnereBadRequestVedValideringsFeil() {
var to = new RsOrganisasjon();

var response =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,18 @@
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.TestInstance;
import org.junit.jupiter.api.extension.ExtendWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.web.client.TestRestTemplate;
import org.springframework.http.HttpStatus;
import org.springframework.test.context.ActiveProfiles;
import org.springframework.test.context.junit.jupiter.SpringExtension;

import java.util.Map;

import static org.assertj.core.api.Assertions.assertThat;

@ActiveProfiles("test")
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
@ExtendWith(SpringExtension.class)
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
class KodeControllerTest {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
import org.junit.jupiter.api.DisplayName;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.TestInstance;
import org.junit.jupiter.api.extension.ExtendWith;
import org.mockito.Mockito;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
Expand All @@ -24,7 +23,6 @@
import org.springframework.http.HttpMethod;
import org.springframework.http.HttpStatus;
import org.springframework.test.context.ActiveProfiles;
import org.springframework.test.context.junit.jupiter.SpringExtension;

import java.time.LocalDate;
import java.util.Collections;
Expand All @@ -35,7 +33,6 @@

@ActiveProfiles("test")
@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT)
@ExtendWith(SpringExtension.class)
@TestInstance(TestInstance.Lifecycle.PER_CLASS)
public class RolleoversiktControllerTest {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class BrregServiceTest {
private BrregService brregService;

@BeforeEach
public void onSetup() {
void onSetup() {
rolleoversiktRepositoryMock.deleteAll();
hentRolleRepositoryMock.deleteAll();
brregService = new BrregService(rolleoversiktRepositoryMock, hentRolleRepositoryMock, objectMapper);
Expand Down
2 changes: 1 addition & 1 deletion apps/bruker-service/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ plugins {
id 'java'
id "org.sonarqube" version "4.0.0.2929"
id 'org.springframework.boot' version "3.2.1"
id 'io.spring.dependency-management' version "1.1.3"
id 'io.spring.dependency-management' version "1.1.4"
id "jacoco"
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip
networkTimeout=10000
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
2 changes: 1 addition & 1 deletion apps/dolly-backend/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ plugins {
id 'java'
id "org.sonarqube" version "4.0.0.2929"
id 'org.springframework.boot' version "3.2.1"
id 'io.spring.dependency-management' version "1.1.3"
id 'io.spring.dependency-management' version "1.1.4"
id "jacoco"
}

Expand Down
Loading

0 comments on commit 6a9d9cf

Please sign in to comment.