Skip to content

Commit

Permalink
Hocs 6820 upgrade keycloak22 (#696)
Browse files Browse the repository at this point in the history
* HOCS-6820: Upgrade keycloak to 22.0.4 and increment info-service to spring boot 3 version.
This is initial check-in hence just made sure service is up and running.
Will perform junit tests and integration tests as part of next set of commits.

* HOCS-6820:Build changes to fix compilation errors

* HOCS-6820:Remove debug added flyway config

* HOCS-6820:Remove unwanted JIRA from gradle build file

* HOCS-6820:Add JsonProviderImpl jar

* HOCS-6820:remove auth name from keycloak url as Keycloak removed this in 22 version

* HOCS-6820:Upgrading spring boot to latest stable version and this will help to fix bugs introduced in previous versions

* HOCS-6820:Adding column names to query as Hibernate 6 version will make query execution fail it 2 tables have common column name

* HOCS-6820:remove unwanted property from application properties

* HOCS-6820- afterTest sql fix to run local tests

* HOCS-6820:Fix for failed test cases and removed / from resource name

* HOCS-6820:Cleanup build changes and realigned package import statements

* HOCS-6820:Remove commented previous version keycloak client code

* HOCS-6820:Upgraded keycloak version to 22.0.5 after getting inputs from keycloakupgrade acp team
  • Loading branch information
vinothon84 authored Nov 22, 2023
1 parent 1cf215c commit 54f2a3b
Show file tree
Hide file tree
Showing 66 changed files with 426 additions and 259 deletions.
17 changes: 9 additions & 8 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@ import org.gradle.api.JavaVersion

plugins {
id 'java'
id 'org.springframework.boot' version '2.7.17'
id 'org.springframework.boot' version '3.1.5'
id 'io.spring.dependency-management' version '1.1.3'
}

def keycloakVersion = '15.0.2'
def keycloakVersion = '22.0.5'
def lombokVersion = '1.18.30'

group = 'uk.gov.digital.ho.hocs'
Expand All @@ -26,30 +26,31 @@ dependencies {
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
implementation 'org.springframework.boot:spring-boot-starter-json'
implementation 'org.springframework.boot:spring-boot-starter-validation'
implementation "com.amazonaws:aws-java-sdk-sns:1.12.149"

implementation "com.amazonaws:aws-java-sdk-sns:1.12.472"
implementation 'net.logstash.logback:logstash-logback-encoder:7.3'

implementation 'org.apache.httpcomponents:httpmime:4.5.14'
implementation 'javax.xml.bind:jaxb-api:2.3.1'
implementation 'jakarta.xml.bind:jakarta.xml.bind-api:4.0.0'

implementation 'com.fasterxml.jackson.dataformat:jackson-dataformat-xml:2.14.3'
implementation "org.keycloak:keycloak-admin-client:${keycloakVersion}"
implementation "org.keycloak:keycloak-services:${keycloakVersion}"

implementation 'org.apache.commons:commons-csv:1.10.0'
implementation 'org.springdoc:springdoc-openapi-ui:1.7.0'
implementation 'com.jayway.jsonpath:json-path:2.8.0'
implementation 'javax.json:javax.json-api:1.1.4'
implementation 'jakarta.json:jakarta.json-api:2.1.1'
implementation group: 'org.eclipse.parsson', name: 'parsson', version: '1.1.5'

// This should be kept in line with the data Dockerfile versions
implementation 'org.flywaydb:flyway-core:9.20.0'
implementation 'org.flywaydb:flyway-core:9.19.3'
runtimeOnly 'org.hsqldb:hsqldb'
runtimeOnly 'org.postgresql:postgresql:42.6.0'

compileOnly "org.projectlombok:lombok:${lombokVersion}"
annotationProcessor "org.projectlombok:lombok:${lombokVersion}"
annotationProcessor 'org.springframework.boot:spring-boot-configuration-processor'
annotationProcessor 'org.springframework:spring-context-indexer:5.3.23'
annotationProcessor 'org.springframework:spring-context-indexer:6.0.6'

testImplementation 'org.springframework.boot:spring-boot-starter-test'
testImplementation 'org.junit.vintage:junit-vintage-engine:5.10.0'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import uk.gov.digital.ho.hocs.info.domain.model.Topic;
import uk.gov.digital.ho.hocs.info.domain.repository.StandardLineRepository;

import javax.transaction.Transactional;
import jakarta.transaction.Transactional;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.LocalTime;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package uk.gov.digital.ho.hocs.info.api;

import javax.validation.Valid;
import jakarta.validation.Valid;

import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package uk.gov.digital.ho.hocs.info.api.dto;

import javax.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotBlank;

import lombok.AllArgsConstructor;
import lombok.Getter;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package uk.gov.digital.ho.hocs.info.api.dto;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;

import lombok.AllArgsConstructor;
import lombok.Getter;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package uk.gov.digital.ho.hocs.info.application;

import javax.persistence.AttributeConverter;
import javax.persistence.Converter;
import jakarta.persistence.AttributeConverter;
import jakarta.persistence.Converter;
import java.sql.Date;
import java.time.LocalDate;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package uk.gov.digital.ho.hocs.info.application;

import javax.persistence.AttributeConverter;
import javax.persistence.Converter;
import jakarta.persistence.AttributeConverter;
import jakarta.persistence.Converter;
import java.sql.Timestamp;
import java.time.LocalDateTime;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
import org.springframework.web.servlet.HandlerInterceptor;
import org.springframework.web.servlet.ModelAndView;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import java.util.UUID;

@Component
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
import uk.gov.digital.ho.hocs.info.client.audit.client.dto.EventType;
import uk.gov.digital.ho.hocs.info.domain.model.*;

import javax.json.Json;
import javax.json.JsonArrayBuilder;
import jakarta.json.Json;
import jakarta.json.JsonArrayBuilder;
import java.time.LocalDateTime;
import java.util.Map;
import java.util.Set;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
import lombok.Getter;
import lombok.NoArgsConstructor;

import javax.persistence.Column;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import jakarta.persistence.Column;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
import jakarta.persistence.Id;
import jakarta.persistence.Table;
import java.io.Serializable;

@Deprecated(forRemoval = true)
@javax.persistence.Entity
@jakarta.persistence.Entity
@Table(name = "case_details_field")
@NoArgsConstructor
@AllArgsConstructor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,15 @@
import lombok.Getter;
import lombok.NoArgsConstructor;

import javax.persistence.*;
import javax.persistence.Entity;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
import jakarta.persistence.Id;
import jakarta.persistence.Table;
import jakarta.persistence.ManyToOne;
import jakarta.persistence.FetchType;
import jakarta.persistence.JoinColumn;
import java.io.Serializable;
import java.util.UUID;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
import lombok.NoArgsConstructor;
import lombok.Setter;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
import jakarta.persistence.Id;
import jakarta.persistence.Table;
import java.time.LocalDateTime;
import java.time.OffsetDateTime;
import java.util.UUID;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,18 @@
import lombok.AccessLevel;
import lombok.Getter;
import lombok.NoArgsConstructor;
import org.hibernate.annotations.JdbcTypeCode;
import org.hibernate.annotations.Type;
import org.hibernate.annotations.TypeDef;
//import org.hibernate.annotations.TypeDef;
import uk.gov.digital.ho.hocs.info.domain.model.enums.BankHolidayRegion;

import javax.persistence.Entity;
import javax.persistence.*;
import jakarta.persistence.Entity;
import jakarta.persistence.*;
import java.util.UUID;

@NoArgsConstructor(access = AccessLevel.PROTECTED)
@Entity
@TypeDef(name = "pgsql_enum", typeClass = org.hibernate.type.EnumType.class)
@Convert(attributeName = "pgsql_enum", converter = org.hibernate.type.EnumType.class)
@Table(name = "case_type_bank_holiday_region")
public class CaseTypeBankHolidayRegion {

Expand All @@ -28,9 +29,8 @@ public class CaseTypeBankHolidayRegion {
private UUID caseTypeUuid;

@Getter
@Enumerated(EnumType.STRING)
@Column(name = "region")
@Type(type = "pgsql_enum")
@Enumerated(EnumType.ORDINAL)
private BankHolidayRegion region;

public CaseTypeBankHolidayRegion(UUID caseTypeUuid, String region) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
package uk.gov.digital.ho.hocs.info.domain.model;

import jakarta.persistence.Column;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
import jakarta.persistence.Id;
import jakarta.persistence.Table;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;

import javax.persistence.*;
import java.io.Serializable;
import java.util.UUID;

@javax.persistence.Entity
@jakarta.persistence.Entity
@Table(name = "case_type_correspondent_type")
@NoArgsConstructor
@AllArgsConstructor
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
package uk.gov.digital.ho.hocs.info.domain.model;

import jakarta.persistence.Column;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
import jakarta.persistence.Id;
import jakarta.persistence.Table;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.NoArgsConstructor;

import javax.persistence.*;
import java.io.Serializable;
import java.util.UUID;

@javax.persistence.Entity
@jakarta.persistence.Entity
@Table(name = "case_type_schema")
@NoArgsConstructor
@Getter
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

import lombok.*;

import javax.persistence.*;
import jakarta.persistence.*;
import java.io.Serializable;
import java.util.List;

@AllArgsConstructor()
@NoArgsConstructor()
@Getter
@javax.persistence.Entity
@jakarta.persistence.Entity
@Table(name = "system_configuration")
@EqualsAndHashCode(of = { "systemName" })
@ToString
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
import lombok.Getter;
import lombok.NoArgsConstructor;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
import jakarta.persistence.Id;
import jakarta.persistence.Table;
import java.io.Serializable;
import java.util.UUID;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,20 @@
package uk.gov.digital.ho.hocs.info.domain.model;

import lombok.*;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
import jakarta.persistence.Id;
import jakarta.persistence.Table;
import lombok.AllArgsConstructor;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

import javax.persistence.*;
import java.io.Serializable;

@javax.persistence.Entity
@Entity
@Table(name = "country")
@AllArgsConstructor
@NoArgsConstructor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,16 @@
import lombok.Getter;
import lombok.NoArgsConstructor;

import javax.persistence.Column;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
import jakarta.persistence.Id;
import jakarta.persistence.Table;
import java.io.Serializable;
import java.util.UUID;

@javax.persistence.Entity
@Entity
@Table(name = "document_tag")
@AllArgsConstructor
@NoArgsConstructor
Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
package uk.gov.digital.ho.hocs.info.domain.model;

import jakarta.persistence.Column;
import jakarta.persistence.GeneratedValue;
import jakarta.persistence.GenerationType;
import jakarta.persistence.Id;
import jakarta.persistence.Table;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import uk.gov.digital.ho.hocs.info.api.dto.EntityDto;

import javax.persistence.*;
import java.util.UUID;

@NoArgsConstructor
@AllArgsConstructor
@javax.persistence.Entity
@jakarta.persistence.Entity
@Table(name = "entity")
public class Entity {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
import lombok.Getter;
import lombok.NoArgsConstructor;

import javax.persistence.*;
import jakarta.persistence.*;
import java.util.UUID;

@NoArgsConstructor
@AllArgsConstructor
@javax.persistence.Entity
@jakarta.persistence.Entity
@Table(name = "entity_list")
public class EntityList {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
import lombok.NoArgsConstructor;
import lombok.Setter;

import javax.persistence.*;
import jakarta.persistence.*;
import java.io.Serializable;
import java.time.LocalDate;

@javax.persistence.Entity
@jakarta.persistence.Entity
@Table(name = "exemption_date")
@NoArgsConstructor
@AllArgsConstructor
Expand Down
Loading

0 comments on commit 54f2a3b

Please sign in to comment.