diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 56d09852..8c7b3d5a 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -17,6 +17,8 @@ variables:
ACCEPTANCE_TEST_DIR: "partition-acceptance-test"
+ CIMPL_OPENAPI_YAML_ROUTE: /api/partition/v1/api-docs.yaml
+
include:
- project: "osdu/platform/ci-cd-pipelines"
file: "standard-setup.yml"
@@ -60,6 +62,9 @@ include:
- project: "osdu/platform/ci-cd-pipelines"
file: "cloud-providers/gc-one-pipeline.yml"
+ - project: "osdu/platform/ci-cd-pipelines"
+ file: "reporting/schemathesis.yml"
+
- local: "devops/gc-quarkus/pipeline/override-stages.yml"
- local: "devops/core-plus/pipeline/override-stages.yml"
@@ -80,3 +85,6 @@ download_plugins:
rules:
- if: "$PROTECTED == '1'"
when: on_success
+
+schemathesis-tests:
+ extends: .schemathesis-tests-template
diff --git a/NOTICE b/NOTICE
index 7e327c55..3dd1b3b7 100644
--- a/NOTICE
+++ b/NOTICE
@@ -162,9 +162,13 @@ The following software have components provided under the terms of this license:
- Netty Reactive Streams Implementation (from https://repo1.maven.org/maven2/com/typesafe/netty/netty-reactive-streams)
- Netty/Buffer (from http://netty.io/, https://repo1.maven.org/maven2/io/netty/netty-buffer)
- Netty/Codec (from http://netty.io/, https://repo1.maven.org/maven2/io/netty/netty-codec)
+- Netty/Codec/Base (from https://netty.io/)
+- Netty/Codec/Compression (from https://netty.io/)
- Netty/Codec/DNS (from http://netty.io/, https://repo1.maven.org/maven2/io/netty/netty-codec-dns)
- Netty/Codec/HTTP (from http://netty.io/, https://repo1.maven.org/maven2/io/netty/netty-codec-http)
- Netty/Codec/HTTP2 (from http://netty.io/, https://repo1.maven.org/maven2/io/netty/netty-codec-http2)
+- Netty/Codec/Marshalling (from https://netty.io/)
+- Netty/Codec/Protobuf (from https://netty.io/)
- Netty/Codec/Socks (from http://netty.io/, https://repo1.maven.org/maven2/io/netty/netty-codec-socks)
- Netty/Common (from http://netty.io/, https://repo1.maven.org/maven2/io/netty/netty-common)
- Netty/Handler (from http://netty.io/, https://repo1.maven.org/maven2/io/netty/netty-handler)
@@ -288,6 +292,7 @@ The following software have components provided under the terms of this license:
- Apache Log4j Core (from https://repo1.maven.org/maven2/org/apache/logging/log4j/log4j-core)
- HdrHistogram (from http://hdrhistogram.github.io/HdrHistogram/)
+- Jackson-core (from http://wiki.fasterxml.com/JacksonHome, https://github.com/FasterXML/jackson-core)
- Jodd Util (from https://util.jodd.org/)
- LatencyUtils (from http://latencyutils.github.io/LatencyUtils/)
- MinLog (from https://github.com/EsotericSoftware/minlog)
@@ -321,6 +326,13 @@ The following software have components provided under the terms of this license:
- ReflectASM (from https://github.com/EsotericSoftware/reflectasm)
- Spring Core (from http://www.springframework.org, https://github.com/spring-projects/spring-framework, https://repo1.maven.org/maven2/org/springframework/spring-core)
+========================================================================
+BSL-1.0
+========================================================================
+The following software have components provided under the terms of this license:
+
+- Jackson-core (from http://wiki.fasterxml.com/JacksonHome, https://github.com/FasterXML/jackson-core)
+
========================================================================
BouncyCastle
========================================================================
@@ -408,7 +420,6 @@ The following software have components provided under the terms of this license:
- JUnit Platform Engine API (from http://junit.org/junit5/, https://junit.org/junit5/)
- Jakarta Activation API (from https://github.com/eclipse-ee4j/jaf, https://github.com/jakartaee/jaf-api, https://repo1.maven.org/maven2/jakarta/activation/jakarta.activation-api)
- Jakarta Annotations API (from https://projects.eclipse.org/projects/ee4j.ca)
-- Jakarta Dependency Injection (from https://github.com/eclipse-ee4j/injection-api)
- Jakarta Messaging API (from https://projects.eclipse.org/projects/ee4j.jms)
- Jakarta XML Binding API (from https://repo1.maven.org/maven2/jakarta/xml/bind/jakarta.xml.bind-api, https://repo1.maven.org/maven2/org/jboss/spec/javax/xml/bind/jboss-jaxb-api_2.3_spec)
- Old JAXB Core (from , https://eclipse-ee4j.github.io/jaxb-ri/, https://repo1.maven.org/maven2/com/sun/xml/bind/jaxb-impl)
@@ -557,6 +568,7 @@ The following software have components provided under the terms of this license:
- Guava: Google Core Libraries for Java (from http://code.google.com/p/guava-libraries, https://github.com/google/guava, https://repo1.maven.org/maven2/com/google/guava/guava)
- Netty/Codec (from http://netty.io/, https://repo1.maven.org/maven2/io/netty/netty-codec)
+- Netty/Codec/Base (from https://netty.io/)
========================================================================
gpl-2.0-classpath
diff --git a/devops/core-plus/README.md b/devops/core-plus/README.md
new file mode 100644
index 00000000..4197934d
--- /dev/null
+++ b/devops/core-plus/README.md
@@ -0,0 +1,133 @@
+# OSDU Core Partition Deployment
+
+## Overview
+
+This directory deploys two components via Helm:
+
+| Component | Purpose | Type | Lifecycle |
+|-----------|---------|------|-----------|
+| **Partition Service** | REST API for partition management | Java app | Always running |
+| **Bootstrap** | Initializes partition properties | Bash scripts | Runs once on startup, then idles |
+
+## Quick Start
+
+```bash
+cd deploy/
+helm install core-partition-deploy .
+```
+
+See [Deploy README](./deploy/README.md) for full installation guide.
+
+---
+
+## Component Details
+
+### Bootstrap
+
+**What it does:**
+- Calls Partition API to create/update partition config
+- Sets storage, database, messaging, and feature flags
+- Runs once on startup, then marks ready via `/tmp/bootstrap_ready` and remains idle
+
+> **⚠️ DEPRECATION NOTICE:** MinIO configuration will be deprecated in the next release and replaced with SeaweedFS. Please plan your migration accordingly.
+
+**Key Files:**
+- Deployment: `deploy/templates/deploy-bootstrap.yaml`
+- ConfigMap: `deploy/templates/configmap-bootstrap.yaml` (extensive config)
+- Scripts: `bootstrap/bootstrap_partition.sh`
+
+**Configuration (values.yaml):**
+```yaml
+data:
+ bootstrapImage: "" # Bootstrap image
+ bucketPrefix: "refi"
+ minioExternalEndpoint: ""
+
+ # Feature flags (used by bootstrap)
+ indexerAugmenterEnabled: "true"
+ asIngestedCoordinatesEnabled: "true"
+ keywordLowerEnabled: "true"
+ bagOfWordsEnabled: "true"
+ collaborationsEnabled: "true"
+ autocompleteEnabled: "false"
+ policyServiceEnabled: "false"
+ edsEnabled: "false"
+```
+
+**Full details:** [Bootstrap README](./bootstrap/README.md)
+
+---
+
+### Partition Service (Non-Bootstrap)
+
+**What it does:**
+- Provides partition CRUD API endpoints
+- Runs continuously as a service
+- Connects to PostgreSQL for metadata
+
+**Key Files:**
+- Deployment: `deploy/templates/deploy.yaml`
+- ConfigMap: `deploy/templates/configmap.yaml` (LOG_LEVEL only)
+- Service: `deploy/templates/service.yaml`
+- Virtual Service: `deploy/templates/virtual-service.yaml`
+
+**Configuration (values.yaml):**
+```yaml
+data:
+ image: "" # Service image
+ logLevel: "ERROR" # Application logging
+ requestsCpu: "5m"
+ requestsMemory: "350Mi"
+
+conf:
+ appName: "partition"
+ replicas: 1
+```
+
+**Health Endpoints:**
+- `/health/liveness` (port 8081)
+- `/health/readiness` (port 8081)
+
+---
+
+## Configuration Summary
+
+| Setting | Affects | Used In |
+|---------|---------|---------|
+| `data.image` | Partition Service | deploy.yaml |
+| `data.bootstrapImage` | Bootstrap | deploy-bootstrap.yaml |
+| `data.logLevel` | Partition Service | configmap.yaml |
+| `data.bucket*`, `data.minio*` **(deprecated)** | Bootstrap | configmap-bootstrap.yaml |
+| `data.*Enabled` (feature flags) | Bootstrap | configmap-bootstrap.yaml |
+| `istio.proxyCPU*` | Partition Service | deploy.yaml |
+| `istio.bootstrapProxyCPU*` | Bootstrap | deploy-bootstrap.yaml |
+
+---
+
+## Troubleshooting
+
+**Bootstrap issues:**
+```bash
+# Check bootstrap logs
+kubectl logs -l app=partition-bootstrap -f
+
+# Verify completion
+kubectl exec deployment/partition-bootstrap -- cat /tmp/bootstrap_ready
+```
+
+**Service issues:**
+```bash
+# Check service logs
+kubectl logs -l app=partition -f
+
+# Check health
+kubectl exec deployment/partition -- curl localhost:8081/health/readiness
+```
+
+---
+
+## Documentation
+
+- **[Bootstrap Details](./bootstrap/README.md)** - Scripts and environment variables
+- **[Helm Guide](./deploy/README.md)** - Installation and configuration
+- **[Testing](./test/)** - Validation scripts
diff --git a/devops/core-plus/bootstrap/README.md b/devops/core-plus/bootstrap/README.md
index e688b596..b948aebf 100644
--- a/devops/core-plus/bootstrap/README.md
+++ b/devops/core-plus/bootstrap/README.md
@@ -1,32 +1,27 @@
# Partition Bootstrapping Script
+> **Part of:** [Core-Plus Deployment](../README.md) - runs as one-time initialization job
+
+---
+
## Overview
This folder contains Bash scripts and a Dockerfile to bootstrap and configure a data partition. The scripts initialize partition properties by calling the Partition API, creating or updating the partition as needed.
-## Key Environment Variables
-
-| Environment Variable | Description |
-| --------------------------------- | ---------------------------------------------------------- |
-| `PARTITION_HOST` | Host for the partition API. |
-| `DATA_PARTITION_ID` | Identifier for the data partition. |
-| `BUCKET_PREFIX` | Prefix for bucket names used in the partition. |
-| `PARTITION_SUFFIX` | Suffix used for partition-specific secret references. |
-| `SERVICE_ACCOUNT` | Service account associated with the partition. |
-| `SECRET_SERVICE_NAMESPACE` | Kubernetes namespace for the secret service. |
-| `MINIO_ENDPOINT` | Endpoint for the MinIO service. |
-| `MINIO_EXTERNAL_ENDPOINT` | External endpoint for accessing MinIO. |
-| `MINIO_IGNORE_CERT_CHECK` | Flag to ignore SSL certificate checks for MinIO. |
-| `MINIO_UI_ENDPOINT` | Endpoint for the MinIO user interface. |
-| `ELASTIC_HTTPS` | Flag to enable HTTPS for Elasticsearch connections. |
-| `INDEXER_AUGMENTER_ENABLED` | Flag to enable or disable the index augmenter. |
-| `EDS_ENABLED` | Feature flag to enable or disable EDS. |
-| `POLICY_SERVICE_ENABLED` | Feature flag to enable or disable OPA/policy enforcement. |
-| `AUTOCOMPLETE_ENABLED` | Feature flag to enable or disable autocomplete. |
-| `AS_INGESTED_COORDINATES_ENABLED` | Feature flag to enable or disable as-ingested coordinates. |
-| `KEYWORD_LOWER_ENABLED` | Feature flag to enable or disable lowercase keywords. |
-| `BAG_OF_WORDS_ENABLED` | Feature flag to enable or disable bag-of-words indexing. |
-| `COLLABORATIONS_ENABLED` | Feature flag to enable or disable collaborations. |
+## Environment Variables
+
+### Variables for bootstrap_partition.sh
+
+| Environment Variable | Description |
+| -------------------- | ------------------------------- |
+| `PARTITION_HOST` | Host for the partition API. |
+| `DATA_PARTITION_ID` | Identifier for the data partition. |
+
+### Variables for data_core.sh
+
+The `data_core.sh` script uses additional environment variables to build the partition configuration JSON payload.
+
+For the complete list of variables and their configuration, see the **Bootstrap Configuration** section in [Deploy README](../deploy/README.md).
## Scripts
@@ -48,4 +43,16 @@ This script defines the `core_partition_data` function, which outputs the full J
## Docker
-The `Dockerfile` builds an Alpine-based image that runs `bootstrap_partition.sh` on startup and then sleeps to keep the container alive. Required environment variables must be supplied at runtime (e.g. via Kubernetes environment or Docker `--env`/`--env-file`).
\ No newline at end of file
+The `Dockerfile` builds an Alpine-based image that runs `bootstrap_partition.sh` on startup and then sleeps to keep the container alive. Required environment variables must be supplied at runtime (e.g. via Kubernetes environment or Docker `--env`/`--env-file`).
+
+---
+
+## Deployment Integration
+
+This bootstrap runs automatically via Helm deployment:
+- **Image:** Specified in `values.yaml` → `data.bootstrapImage`
+- **ConfigMap:** `partition-config-bootstrap` (see [template](../deploy/templates/configmap-bootstrap.yaml))
+- **Service Account:** `partition-bootstrap`
+- **Readiness:** Checks `/tmp/bootstrap_ready` file
+
+See [Deploy README](../deploy/README.md) for installation.
diff --git a/devops/core-plus/deploy/README.md b/devops/core-plus/deploy/README.md
index 1ba09ac8..f72a1192 100644
--- a/devops/core-plus/deploy/README.md
+++ b/devops/core-plus/deploy/README.md
@@ -1,6 +1,14 @@
-# Deploy helm chart
+# Partition Service - Helm Deployment
+
+> ⚠️ **This chart deploys TWO components:**
+> - **Partition Service** (main Java API) - always running
+> - **Bootstrap** (one-time initialization on startup) - runs once then idles
+>
+> See [main README](../README.md) for component details.
+
+---
## Introduction
@@ -8,161 +16,121 @@ This chart bootstraps a deployment on a [Kubernetes](https://kubernetes.io) clus
## Prerequisites
-The code was tested on **Kubernetes cluster** (v1.21.11) with **Istio** (1.12.6)
- > Istio is installed with Istio Ingress Gateway
-
-- Kubernetes cluster version can be checked with the command:
-
- `kubectl version --short | grep Server`
-
- The output will be similar to the following:
-
- ```console
- Server Version: v1.21.11-gke.1100
- ```
-
-- Istio version can be checked in different ways, it is out of scope for this README. You can find more information [here](https://istio.io/latest/docs/setup/install/).
-
- The following command shows how to check version if Anthos Service Mesh is used:
-
- `kubectl -n istio-system get pods -lapp=istiod -o=jsonpath='{.items[0].metadata.labels.istio\.io/rev}'`
-
- The output will be similar to the following:
+- **Kubernetes** v1.21.11+ with **Istio** v1.12.6+ (or Anthos Service Mesh)
+- **Helm** v3.7.1+ ([install](https://helm.sh/docs/intro/install/))
+- **kubectl** v1.21.0+ ([install](https://kubernetes.io/docs/tasks/tools/#kubectl))
+- Namespace not labeled with Istio (Development mode)
- ```console
- asm-1132-5
- ```
+> **OS Support:** Debian-based Linux (Debian 10, Ubuntu 20.04), Windows WSL 2
-> It is possible to use other versions, but it hasn't been tested
-
-This example describes installation in **Development mode**:
-
-- In this mode helm chart is installed to the namespace **not labeled with Istio**.
- > More information about labeling can be found [here](https://istio.io/latest/docs/setup/additional-setup/sidecar-injection) (Istio) or [here](https://cloud.google.com/service-mesh/docs/managed/select-a-release-channel#default-injection-labels) (Anthos Service Mesh)
-
- You can find all labels for your namespace with the command:
-
- `kubectl get namespace -o jsonpath={.metadata.labels}`
-
- The output shows that there are no any labels related to Istio:
-
- ```console
- {"kubernetes.io/metadata.name":"default"}
- ```
-
- When the namespace is labeled with Istio, the output could be:
-
- ```console
- {"istio-injection":"enabled","kubernetes.io/metadata.name":"default"}
- ```
-
-### Operation system
+## Installation
-The code works in Debian-based Linux (Debian 10 and Ubuntu 20.04) and Windows WSL 2. Also, it works but is not guaranteed in Google Cloud Shell. All other operating systems, including macOS, are not verified and supported.
+First you need to set variables in **values.yaml** file using any code editor. Some of the values are prefilled, but you need to specify some values as well. You can find more information about them below.
-### Packages
+### What Gets Deployed
-Packages are only needed for installation from a local computer.
+#### Partition Service (Non-Bootstrap)
+- Deployment `partition` with Java application
+- ConfigMap `partition-config` (LOG_LEVEL)
+- Service, VirtualService, AuthorizationPolicy
+- Uses: `data.image`, `data.logLevel`, `conf.*`
-- **HELM** (version: v3.7.1 or higher) [helm](https://helm.sh/docs/intro/install/)
+#### Bootstrap
+- Deployment `partition-bootstrap` with bash scripts
+- ConfigMap `partition-config-bootstrap` (extensive config)
+- Uses: `data.bootstrapImage`, `data.bucket*`, `data.*Enabled` flags
- Helm version can be checked with the command:
+---
- `helm version --short`
+### Global variables (Both Components)
- The output will be similar to the following:
+| Name | Description | Type | Default |Required |
+|------|-------------|------|---------|---------|
+**global.domain** | your domain | string | - | yes
+**global.useHttps** | defines whether to use HTTPS instead of HTTP for external minio s3 endpoint connection | boolean | true | yes
+**global.limitsEnabled** | whether CPU and memory limits are enabled | boolean | true | yes
+**global.dataPartitionId** | data partition id | string | - | yes
- ```console
- v3.7.1+gd141386
- ```
+---
-- **Kubectl** (version: v1.21.0 or higher) [kubectl](https://kubernetes.io/docs/tasks/tools/#kubectl)
+## Common Configuration Variables
- Kubectl version can be checked with the command:
+These variables are shared by both partition service and bootstrap components.
- `kubectl version --short | grep Client`
+### Application Configuration
- The output will be similar to the following:
+| Name | Description | Type | Default |Required |
+|------|-------------|------|---------|---------|
+**auth.localUrl** | authentication local URL | string | keycloak | yes
+**auth.realm** | realm in keycloak | string | osdu | yes
+**conf.appName** | name of the app | string | partition | yes
+**conf.configmap** | configmap to be used | string | partition-config | yes
+**conf.replicas** | number of pod replicas | integer | 1 | yes
+**conf.secret** | secret for postgres | string | partition-postgres-secret | yes
- ```console
- Client Version: v1.21.0
- ```
+### Istio Configuration
-## Installation
+| Name | Description | Type | Default |Required |
+|------|-------------|------|---------|---------|
+**istio.bootstrapProxyCPU** | CPU request for bootstrap Envoy sidecars | string | 5m | yes
+**istio.bootstrapProxyCPULimit** | CPU limit for bootstrap Envoy sidecars | string | 100m | yes
+**istio.proxyCPU** | CPU request for partition service Envoy sidecars | string | 5m | yes
+**istio.proxyCPULimit** | CPU limit for partition service Envoy sidecars | string | 500m | yes
+**istio.proxyMemory** | memory request for partition service Envoy sidecars | string | 64Mi | yes
+**istio.proxyMemoryLimit** | memory limit for partition service Envoy sidecars | string | 512Mi | yes
+**istio.sidecarInject** | whether Istio sidecar will be injected. Setting to "false" reduces security, because disables authorization policy. | boolean | true | yes
-First you need to set variables in **values.yaml** file using any code editor. Some of the values are prefilled, but you need to specify some values as well. You can find more information about them below.
+---
-### Global variables
+## Bootstrap Configuration
-| Name | Description | Type | Default |Required |
-|------|-------------|------|---------|---------|
-**global.domain** | your domain | string | - | yes
-**global.useHttps** | defines whether to use HTTPS instead of HTTP for external minio s3 endpoint connection | boolean | true | yes
-**global.limitsEnabled** | whether CPU and memory limits are enabled | boolean | true | yes
-**global.dataPartitionId** | data partition id | string | - | yes
+> **⚠️ DEPRECATION NOTICE:** MinIO configuration (`data.minio*`, `data.bucketPrefix`) will be deprecated in the next release and replaced with SeaweedFS. Please plan your migration accordingly.
-### Configmap variables
+### Bootstrap Variables
| Name | Description | Type | Default |Required |
|------|-------------|------|---------|---------|
-**data.logLevel** | logging level | string | ERROR | yes
-**data.secretAdminNamespace** | namespace suffix for the secret admin service, combined with release namespace as `-` | string | secret-admin | yes
-**data.partitionSuffix** | suffix for partition secret values | string | _SYSTEM | yes
-**data.datafierSa** | datafier service account | string | datafier | yes
+**data.asIngestedCoordinatesEnabled** | enable as-ingested coordinates feature | string | true | no
+**data.autocompleteEnabled** | enable autocomplete search feature | string | false | no
+**data.bagOfWordsEnabled** | enable bag-of-words search feature | string | true | no
+**data.bootstrapImage** | path to the bootstrap image in a registry | string | - | yes
**data.bucketPrefix** | minio bucket name prefix | string | refi | only in case of Reference installation when _onPremEnabled_ is set to "_true_"
+**data.collaborationsEnabled** | enable collaborations feature | string | true | no
+**data.datafierSa** | datafier service account | string | datafier | yes
+**data.edsEnabled** | enable EDS (External Data Sources) feature | string | false | no
+**data.elasticHttps** | use https(true) or http(false) in interservice communication (search/indexer <-> elasticsearch)| bool | "" | yes
+**data.indexerAugmenterEnabled** | enable indexer Augmenter | string | true | no
+**data.keywordLowerEnabled** | enable lower-case keyword search | string | true | no
**data.minioExternalEndpoint** | api url for external minio, if external minio is configured - this value will be set for MINIO_ENDPOINT and MINIO_EXTERNAL_ENDPOINT in bootstrap configmap | string | - | no
**data.minioIgnoreCertCheck** | whether minio should ignore TLS certs validity check, set to true if external minio is protected by self-signed certificates | string | false | no
**data.minioUIEndpoint** | UI endpoint for gathering minio versions | string | `http://minio:9001` | yes
-**data.elasticHttps** | use https(true) or http(false) in interservice communication (search/indexer <-> elasticsearch)| bool | "" | yes
+**data.partitionSuffix** | suffix for partition secret values | string | _SYSTEM | yes
+**data.policyServiceEnabled** | enable policy service integration | string | false | no
+**data.secretAdminNamespace** | namespace suffix for the secret admin service, combined with release namespace as `-` | string | secret-admin | yes
-### Deployment variables
+---
-| Name | Description | Type | Default |Required |
-|------|-------------|------|---------|---------|
-**data.requestsCpu** | amount of requests CPU | string | 5m | yes
-**data.requestsMemory** | amount of requests memory | string | 350Mi | yes
-**data.limitsCpu** | CPU limit | string | 500m | only if `global.limitsEnabled` is true
-**data.limitsMemory** | memory limit | string | 1G | only if `global.limitsEnabled` is true
-**data.serviceAccountName** | name of your service account | string | partition | yes
-**data.imagePullPolicy** | when to pull the image | string | IfNotPresent | yes
-**data.image** | path to the image in a registry | string | - | yes
-**data.bootstrapImage** | name of the bootstrap image | string | - | yes
-**conf.replicas** | number of pod replicas | integer | 1 | yes
+## Partition Service Variables (Non-Bootstrap)
-### Configuration variables
+### Service ConfigMap Variables
| Name | Description | Type | Default |Required |
|------|-------------|------|---------|---------|
-**conf.appName** | name of the app | string | partition | yes
-**conf.configmap** | configmap to be used | string | partition-config | yes
-**conf.secret** | secret for postgres | string | partition-postgres-secret | yes
-**auth.realm** | realm in keycloak | string | osdu | yes
-**auth.localUrl** | authentication local URL | string | keycloak | yes
+**data.logLevel** | logging level for partition service | string | ERROR | yes
-### ISTIO variables
+### Service Deployment Variables
| Name | Description | Type | Default |Required |
|------|-------------|------|---------|---------|
-**istio.proxyCPU** | CPU request for Envoy sidecars | string | 5m | yes
-**istio.proxyCPULimit** | CPU limit for Envoy sidecars | string | 500m | yes
-**istio.proxyMemory** | memory request for Envoy sidecars | string | 64Mi | yes
-**istio.proxyMemoryLimit** | memory limit for Envoy sidecars | string | 512Mi | yes
-**istio.bootstrapProxyCPU** | CPU request for Envoy sidecars | string | 5m | yes
-**istio.bootstrapProxyCPULimit** | CPU limit for Envoy sidecars | string | 100m | yes
-**istio.sidecarInject** | whether Istio sidecar will be injected. Setting to "false" reduces security, because disables authorization policy. | boolean | true | yes
-
-### Feature flag variables
+**data.requestsCpu** | amount of requests CPU for partition service | string | 5m | yes
+**data.requestsMemory** | amount of requests memory for partition service | string | 350Mi | yes
+**data.limitsCpu** | CPU limit for partition service | string | 500m | only if `global.limitsEnabled` is true
+**data.limitsMemory** | memory limit for partition service | string | 1G | only if `global.limitsEnabled` is true
+**data.serviceAccountName** | name of your service account | string | partition | yes
+**data.imagePullPolicy** | when to pull the image | string | IfNotPresent | yes
+**data.image** | path to the partition service image in a registry | string | - | yes
-| Name | Description | Type | Default |Required |
-|------|-------------|------|---------|---------|
-**data.indexerAugmenterEnabled** | enable indexer Augmenter | string | false | no
-**data.asIngestedCoordinatesEnabled** | enable as-ingested coordinates feature | string | false | no
-**data.keywordLowerEnabled** | enable lower-case keyword search | string | false | no
-**data.bagOfWordsEnabled** | enable bag-of-words search feature | string | false | no
-**data.collaborationsEnabled** | enable collaborations feature | string | true | no
-**data.autocompleteEnabled** | enable autocomplete search feature | string | false | no
-**data.policyServiceEnabled** | enable policy service integration | string | false | no
-**data.edsEnabled** | enable EDS (External Data Sources) feature | string | false | no
+---
### Install the helm chart
diff --git a/devops/core-plus/deploy/templates/request-authorization.yaml b/devops/core-plus/deploy/templates/request-authorization.yaml
index 9637b5d3..0b66621d 100644
--- a/devops/core-plus/deploy/templates/request-authorization.yaml
+++ b/devops/core-plus/deploy/templates/request-authorization.yaml
@@ -1,12 +1,9 @@
apiVersion: security.istio.io/v1beta1
kind: RequestAuthentication
metadata:
- name: {{ printf "%s-jwt-policy" .Values.conf.appName | quote }}
+ name: {{ printf "namespaced-jwt-policy" | quote }}
namespace: {{ .Release.Namespace | quote }}
spec:
- selector:
- matchLabels:
- app: {{ .Values.conf.appName | quote }}
jwtRules:
- issuer: "https://keycloak.{{ .Values.global.domain }}/realms/{{ .Values.auth.realm }}"
jwksUri: "http://{{ .Values.auth.localUrl }}.{{ .Release.Namespace }}.svc.cluster.local/realms/{{ .Values.auth.realm }}/protocol/openid-connect/certs"
diff --git a/devops/core-plus/deploy/values.yaml b/devops/core-plus/deploy/values.yaml
index e552b700..f59e8385 100644
--- a/devops/core-plus/deploy/values.yaml
+++ b/devops/core-plus/deploy/values.yaml
@@ -25,10 +25,10 @@ data:
bootstrapImage: ""
elasticHttps: ""
# featureFlags
- indexerAugmenterEnabled: "false"
- asIngestedCoordinatesEnabled: "false"
- keywordLowerEnabled: "false"
- bagOfWordsEnabled: "false"
+ indexerAugmenterEnabled: "true"
+ asIngestedCoordinatesEnabled: "true"
+ keywordLowerEnabled: "true"
+ bagOfWordsEnabled: "true"
collaborationsEnabled: "true"
autocompleteEnabled: "false"
policyServiceEnabled: "false"
diff --git a/devops/gc-quarkus/deploy/templates/spot-deploy.yaml b/devops/gc-quarkus/deploy/templates/spot-deploy.yaml
index 36fc0f3d..a16dde66 100644
--- a/devops/gc-quarkus/deploy/templates/spot-deploy.yaml
+++ b/devops/gc-quarkus/deploy/templates/spot-deploy.yaml
@@ -72,6 +72,13 @@ spec:
runAsNonRoot: true
ports:
- containerPort: 8080
+ startupProbe:
+ httpGet:
+ path: /api/partition/v1/info
+ port: 8080
+ initialDelaySeconds: 5
+ periodSeconds: 10
+ failureThreshold: 5
volumeMounts:
- name: system-partition
mountPath: {{ .Values.data.systemPartitionConfigPath | quote }}
diff --git a/devops/gc-quarkus/deploy/templates/standard-deploy.yaml b/devops/gc-quarkus/deploy/templates/standard-deploy.yaml
index 00765c13..00810026 100644
--- a/devops/gc-quarkus/deploy/templates/standard-deploy.yaml
+++ b/devops/gc-quarkus/deploy/templates/standard-deploy.yaml
@@ -72,6 +72,13 @@ spec:
runAsNonRoot: true
ports:
- containerPort: 8080
+ startupProbe:
+ httpGet:
+ path: /api/partition/v1/info
+ port: 8080
+ initialDelaySeconds: 5
+ periodSeconds: 10
+ failureThreshold: 5
volumeMounts:
- name: system-partition
mountPath: {{ .Values.data.systemPartitionConfigPath | quote }}
diff --git a/docs/api/community/v1/openapi.yaml b/docs/api/community/v1/openapi.yaml
index ad4ef4b7..9eb3193c 100644
--- a/docs/api/community/v1/openapi.yaml
+++ b/docs/api/community/v1/openapi.yaml
@@ -34,6 +34,8 @@ paths:
in: header
description: Tenant Id
required: true
+ schema:
+ type: string
responses:
"200":
description: OK
@@ -106,6 +108,8 @@ paths:
in: header
description: Tenant Id
required: true
+ schema:
+ type: string
responses:
"200":
description: OK
@@ -169,23 +173,25 @@ paths:
in: header
description: Tenant Id
required: true
+ schema:
+ type: string
responses:
"200":
description: OK
content:
- '*/*':
+ application/json:
schema:
type: string
"502":
description: Bad Gateway
content:
- '*/*':
+ application/json:
schema:
$ref: "#/components/schemas/AppError"
"503":
description: Service Unavailable
content:
- '*/*':
+ application/json:
schema:
$ref: "#/components/schemas/AppError"
/info:
@@ -201,6 +207,8 @@ paths:
in: header
description: Tenant Id
required: true
+ schema:
+ type: string
responses:
"200":
description: Version info.
@@ -215,64 +223,113 @@ components:
properties:
sensitive:
type: boolean
+ example: null
+ default: null
value:
type: object
+ example: null
+ default: null
+ example: null
+ default: null
Map:
properties:
< * >:
type: object
$ref: "#/components/schemas/Property"
+ example: null
+ default: null
+ example: null
+ default: null
AppError:
type: object
+ description: Standard error response returned by OSDU services.
properties:
code:
type: integer
format: int32
+ description: HTTP status code.
+ example: 400
reason:
type: string
+ description: Short error reason.
+ example: Bad Request
message:
type: string
+ description: Detailed error message.
+ example: Invalid record format.
ConnectedOuterService:
type: object
+ description: Name and version of an external service that this OSDU service
+ connects to.
properties:
name:
type: string
+ description: Name of the connected external service.
+ example: storage
version:
type: string
+ description: Version of the connected external service.
+ example: 2.0.0
FeatureFlagState:
type: object
+ description: State of a feature flag for a given partition and source.
properties:
name:
type: string
+ description: Name of the feature flag.
+ example: collaborations-api
enabled:
type: boolean
+ description: Whether the feature flag is currently enabled.
+ example: true
partition:
type: string
+ description: Data partition this flag applies to.
+ example: opendes
source:
type: string
+ description: Source configuration that provided this flag state.
+ example: runtime
VersionInfo:
type: object
+ description: Version and build information for an OSDU service.
properties:
groupId:
type: string
+ description: Maven group ID of the service artifact.
+ example: org.opengroup.osdu
artifactId:
type: string
+ description: Maven artifact ID of the service.
+ example: os-search
version:
type: string
+ description: Semantic version of the deployed service.
+ example: 0.27.0
buildTime:
type: string
+ description: ISO 8601 timestamp of the build.
+ example: 2021-01-26T02:24:13.843Z
branch:
type: string
+ description: Source control branch from which the service was built.
+ example: main
commitId:
type: string
+ description: Short commit SHA of the build.
+ example: "7777777"
commitMessage:
type: string
+ description: Commit message of the build.
+ example: initial commit
connectedOuterServices:
type: array
+ description: List of external services this service depends on.
items:
$ref: "#/components/schemas/ConnectedOuterService"
featureFlagStates:
type: array
+ description: "Current feature flag states for this partition, if any."
items:
$ref: "#/components/schemas/FeatureFlagState"
securitySchemes:
diff --git a/partition-acceptance-test/README.md b/partition-acceptance-test/README.md
index 348f88bb..d9037531 100644
--- a/partition-acceptance-test/README.md
+++ b/partition-acceptance-test/README.md
@@ -4,8 +4,8 @@ You will need to have the following environment variables defined.
| name | value | description | sensitive? | source | required |
|----------------------|----------------------------|----------------------------|------------|--------|----------|
-| `MY_TENANT` | ex `osdu` | Self Tenant name | no | - | yes |
-| `PARTITION_BASE_URL` | ex `http://localhost:8080` | Partition service Base URL | no | - | yes |
+| `HOST` | ex `http://localhost:8080` | Partition service base URL | no | - | yes |
+| `DATA_PARTITION_ID` | ex `osdu` | Data partition identifier | no | - | yes |
Authentication can be provided as OIDC config:
@@ -16,20 +16,24 @@ Authentication can be provided as OIDC config:
| `TEST_OPENID_PROVIDER_URL` | ex `https://keycloak.com/auth/realms/osdu` | OpenID provider url | yes | - |
| `PRIVILEGED_USER_OPENID_PROVIDER_SCOPE` | ex `api://my-app/.default` | OAuth2 scope (optional, defaults to openid)| no | - |
-Or tokens can be used directly from env variables:
+Or a static bearer token can be supplied directly:
-| name | value | description | sensitive? | source |
-|-------------------------|------------|-----------------------|------------|--------|
-| `PRIVILEGED_USER_TOKEN` | `********` | Privileged User Token | yes | - |
+| name | value | description | sensitive? | source |
+|-----------------------------|------------|----------------------------|------------|--------|
+| `PRIVILEGED_USER_TOKEN` | `********` | Privileged User Token | yes | - |
-Authentication configuration is optional and could be omitted if not needed.
+Authentication configuration is optional and can be omitted when the service allows unauthenticated access locally.
-Execute following command to build code and run all the integration tests:
+No specific Entitlements roles are required for the test user. The acceptance tests only exercise read endpoints (`GET /partitions`, `GET /partitions/{id}`, liveness check, swagger) which require authentication but no entitlement group membership.
+
+Environment variables can also be placed in a `.env` file in the working directory or in
+`src/test/resources/.env` (working directory takes precedence).
+
+Execute the following command to build code and run all the integration tests:
```bash
# Note: this assumes that the environment variables for integration tests as outlined
# above are already exported in your environment.
- # build + install integration test core
$ (cd partition-acceptance-test && mvn clean test)
```
diff --git a/partition-acceptance-test/pom.xml b/partition-acceptance-test/pom.xml
index 595e9a42..d99ef91a 100644
--- a/partition-acceptance-test/pom.xml
+++ b/partition-acceptance-test/pom.xml
@@ -25,84 +25,37 @@
17
- 17
- 17
+ 17
UTF-8
2.31.0
-
-
-
- io.qameta.allure
- allure-bom
- ${allure.version}
- pom
- import
-
-
-
-
+
+ org.opengroup.osdu
+ os-core-test
+ 0.2.8
+
org.projectlombok
lombok
- 1.18.24
+ 1.18.42
provided
-
-
- com.sun.jersey
- jersey-client
- 1.19.4
-
-
- junit
- junit
- 4.13.2
-
-
- com.google.code.gson
- gson
- 2.10.1
-
-
- ch.qos.logback
- logback-classic
- 1.5.6
- test
-
-
- org.springframework
- spring-web
- 6.2.12
-
-
- org.apache.httpcomponents.client5
- httpclient5
- 5.2.1
-
-
- com.nimbusds
- oauth2-oidc-sdk
- 9.15
-
-
- com.fasterxml.jackson.core
- jackson-databind
- 2.15.2
-
-
- io.qameta.allure
- allure-junit4
+ true
+
+ org.apache.maven.plugins
+ maven-compiler-plugin
+ 3.13.0
+
org.apache.maven.plugins
maven-surefire-plugin
- 3.2.5
+ 3.5.4
@@ -132,4 +85,23 @@
${publish.snapshots.url}
+
+
+
+ Default
+
+
+ !repo.releases.id
+
+
+
+ community-maven-repo
+ community-maven-via-job-token
+ community-maven-via-job-token
+ https://community.opengroup.org/api/v4/groups/17/-/packages/maven
+ https://community.opengroup.org/api/v4/projects/221/packages/maven
+ https://community.opengroup.org/api/v4/projects/221/packages/maven
+
+
+
diff --git a/partition-acceptance-test/src/test/java/org/opengroup/osdu/partition/api/GetInfoApiTest.java b/partition-acceptance-test/src/test/java/org/opengroup/osdu/partition/api/GetInfoApiTest.java
new file mode 100644
index 00000000..89b4336c
--- /dev/null
+++ b/partition-acceptance-test/src/test/java/org/opengroup/osdu/partition/api/GetInfoApiTest.java
@@ -0,0 +1,35 @@
+/*
+ * Copyright 2021-2026 Google LLC
+ * Copyright 2021-2026 EPAM Systems, Inc
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * https://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opengroup.osdu.partition.api;
+
+import org.opengroup.osdu.core.test.auth.UserType;
+import org.opengroup.osdu.core.test.base.BaseGetInfoAcceptanceTests;
+import org.opengroup.osdu.core.test.service.ServiceType;
+
+import java.util.List;
+
+/**
+ * Acceptance tests for the Partition service /info endpoint.
+ */
+public final class GetInfoApiTest extends BaseGetInfoAcceptanceTests {
+
+ public GetInfoApiTest() {
+ super(UserType.PRIVILEGED_USER, ServiceType.PARTITION_V1, List.of());
+ }
+}
+
diff --git a/partition-acceptance-test/src/test/java/org/opengroup/osdu/partition/api/GetPartitionByIdApiTest.java b/partition-acceptance-test/src/test/java/org/opengroup/osdu/partition/api/GetPartitionByIdApiTest.java
index 26cd65ef..6671b99d 100644
--- a/partition-acceptance-test/src/test/java/org/opengroup/osdu/partition/api/GetPartitionByIdApiTest.java
+++ b/partition-acceptance-test/src/test/java/org/opengroup/osdu/partition/api/GetPartitionByIdApiTest.java
@@ -14,62 +14,39 @@
package org.opengroup.osdu.partition.api;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertThrows;
-import org.apache.hc.client5.http.impl.classic.CloseableHttpResponse;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-import org.opengroup.osdu.partition.api.descriptor.GetPartitionDescriptor;
-import org.opengroup.osdu.partition.util.BaseTestTemplate;
-import org.opengroup.osdu.partition.util.Config;
-import org.opengroup.osdu.partition.util.TestTokenUtils;
-import org.opengroup.osdu.partition.util.TestUtils;
-import org.springframework.http.HttpStatus;
+import org.apache.hc.core5.http.HttpStatus;
+import org.apache.hc.core5.http.Method;
+import org.junit.jupiter.api.Test;
+import org.opengroup.osdu.core.test.client.ClientException;
+import org.opengroup.osdu.core.test.client.HttpResponse;
+import org.opengroup.osdu.core.test.client.model.partition.PartitionInfo;
+import org.opengroup.osdu.partition.util.BasePartitionAcceptanceTests;
-public final class GetPartitionByIdApiTest extends BaseTestTemplate {
+public final class GetPartitionByIdApiTest extends BasePartitionAcceptanceTests {
- private String partitionId = Config.Instance().osduTenant;
-
- @Override
- @Before
- public void setup() {
- this.testUtils = new TestTokenUtils();
- }
-
- @Override
- @After
- public void tearDown() {
- this.testUtils = null;
- }
-
- @Override
- protected String getId() {
- return partitionId;
- }
-
- public GetPartitionByIdApiTest() {
- super(new GetPartitionDescriptor());
- }
+ @Test
+ public void read_partition() {
+ HttpResponse response = partitionClient.getPartition(servicesConfig.getDataPartitionId());
- @Override
- protected int expectedOkResponseCode() {
- return HttpStatus.OK.value();
+ assertNotNull(response.body());
+ assertEquals(HttpStatus.SC_OK, response.statusCode());
}
@Test
- public void read_partition() throws Exception {
- CloseableHttpResponse response = this.descriptor.run(this.getId(), this.testUtils.getAccessToken());
- Object partitionProperties = TestUtils.parseResponse(response);
-
- assertNotNull(partitionProperties);
- assertEquals(HttpStatus.OK.value(), response.getCode());
+ public void read_not_existing_partition() {
+ ClientException ex = assertThrows(ClientException.class,
+ () -> partitionClient.getPartition("not-existing-partition"));
+
+ assertEquals(HttpStatus.SC_NOT_FOUND, ex.getStatusCode());
}
@Test
- public void read_not_existing_partition() throws Exception {
- CloseableHttpResponse response = this.descriptor.run("not-existing-partition", this.testUtils.getAccessToken());
- assertEquals(HttpStatus.NOT_FOUND.value(), response.getCode());
+ public void should_return400_when_makingHttpRequestWithoutValidUrl() throws Exception {
+ String invalidPath = "partitions/" + servicesConfig.getDataPartitionId() + "//";
+ assertEquals(HttpStatus.SC_BAD_REQUEST, send(invalidPath, Method.GET).statusCode());
}
}
diff --git a/partition-acceptance-test/src/test/java/org/opengroup/osdu/partition/api/HealthCheckApiTest.java b/partition-acceptance-test/src/test/java/org/opengroup/osdu/partition/api/HealthCheckApiTest.java
index c5719498..61107901 100644
--- a/partition-acceptance-test/src/test/java/org/opengroup/osdu/partition/api/HealthCheckApiTest.java
+++ b/partition-acceptance-test/src/test/java/org/opengroup/osdu/partition/api/HealthCheckApiTest.java
@@ -17,55 +17,24 @@
package org.opengroup.osdu.partition.api;
-import static org.junit.Assert.assertEquals;
-
-import org.apache.hc.client5.http.impl.classic.CloseableHttpResponse;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-import org.opengroup.osdu.partition.util.TestBase;
-import org.opengroup.osdu.partition.util.TestTokenUtils;
-import org.opengroup.osdu.partition.util.TestUtils;
-import org.springframework.http.HttpMethod;
-import org.springframework.http.HttpStatus;
-
-public final class HealthCheckApiTest extends TestBase {
-
- @Override
- @Before
- public void setup() throws Exception {
- this.testUtils = new TestTokenUtils();
- }
-
- @Override
- @After
- public void tearDown() throws Exception {
- this.testUtils = new TestTokenUtils();
- }
-
- @Test
- public void should_returnOk() throws Exception {
- CloseableHttpResponse response = TestUtils.send(
- "api/partition/v1/liveness_check",
- HttpMethod.GET.name(),
- null,
- "",
- "",
- false
- );
- assertEquals(HttpStatus.OK.value(), response.getCode());
- }
-
- @Test
- public void should_returnTrailingOk() throws Exception {
- CloseableHttpResponse response = TestUtils.send(
- "api/partition/v1/liveness_check/",
- HttpMethod.GET.name(),
- this.testUtils.getAccessToken(),
- "",
- "",
- false
- );
- assertEquals(HttpStatus.OK.value(), response.getCode());
- }
+import static org.apache.hc.core5.http.HttpStatus.SC_OK;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+
+import org.junit.jupiter.api.Test;
+import org.opengroup.osdu.core.test.client.HttpResponse;
+import org.opengroup.osdu.partition.util.BasePartitionAcceptanceTests;
+
+public final class HealthCheckApiTest extends BasePartitionAcceptanceTests {
+
+ @Test
+ public void should_returnOk() {
+ HttpResponse response = partitionClient.livenessCheck();
+ assertEquals(SC_OK, response.statusCode());
+ }
+
+ @Test
+ public void should_returnOkWithTrailingSlash() {
+ HttpResponse response = partitionClient.livenessCheckTrailingSlash();
+ assertEquals(SC_OK, response.statusCode());
+ }
}
diff --git a/partition-acceptance-test/src/test/java/org/opengroup/osdu/partition/api/ListPartitionsApiTest.java b/partition-acceptance-test/src/test/java/org/opengroup/osdu/partition/api/ListPartitionsApiTest.java
index 9e8d9e6e..7438f3af 100644
--- a/partition-acceptance-test/src/test/java/org/opengroup/osdu/partition/api/ListPartitionsApiTest.java
+++ b/partition-acceptance-test/src/test/java/org/opengroup/osdu/partition/api/ListPartitionsApiTest.java
@@ -14,59 +14,29 @@
package org.opengroup.osdu.partition.api;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
+import static org.apache.hc.core5.http.HttpStatus.SC_BAD_REQUEST;
+import static org.apache.hc.core5.http.HttpStatus.SC_OK;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
-import java.util.List;
-import org.apache.hc.client5.http.impl.classic.CloseableHttpResponse;
-import org.junit.After;
-import org.junit.Assert;
-import org.junit.Before;
-import org.junit.Test;
-import org.opengroup.osdu.partition.api.descriptor.ListPartitionDescriptor;
-import org.opengroup.osdu.partition.util.BaseTestTemplate;
-import org.opengroup.osdu.partition.util.Config;
-import org.opengroup.osdu.partition.util.TestTokenUtils;
-import org.opengroup.osdu.partition.util.TestUtils;
-import org.springframework.http.HttpStatus;
+import org.apache.hc.core5.http.Method;
+import org.junit.jupiter.api.Test;
+import org.opengroup.osdu.core.test.client.HttpResponse;
+import org.opengroup.osdu.core.test.client.model.partition.PartitionListResponse;
+import org.opengroup.osdu.partition.util.BasePartitionAcceptanceTests;
-public final class ListPartitionsApiTest extends BaseTestTemplate {
+public final class ListPartitionsApiTest extends BasePartitionAcceptanceTests {
- private String partitionId = Config.Instance().osduTenant;
-
- @Override
- @Before
- public void setup() {
- this.testUtils = new TestTokenUtils();
- }
-
- @Override
- @After
- public void tearDown() {
- this.testUtils = null;
- }
-
- @Override
- protected String getId() {
- return partitionId;
- }
-
- public ListPartitionsApiTest() {
- super(new ListPartitionDescriptor());
- }
+ @Test
+ public void retrieve_partition_list() {
+ HttpResponse response = partitionClient.listPartitions();
- @Override
- protected int expectedOkResponseCode() {
- return HttpStatus.OK.value();
+ assertNotNull(response.body());
+ assertEquals(SC_OK, response.statusCode());
}
@Test
- public void retrieve_partition_list() throws Exception {
- CloseableHttpResponse response = this.descriptor.run(null, this.testUtils.getAccessToken());
- Object partitionIds = TestUtils.parseResponse(response);
-
- Assert.assertNotNull(partitionIds);
- // assertTrue(partitionIds.contains(partitionId));
- assertEquals(HttpStatus.OK.value(), response.getCode());
+ public void should_return400_when_makingHttpRequestWithoutValidUrl() throws Exception {
+ assertEquals(SC_BAD_REQUEST, send("partitions//", Method.GET).statusCode());
}
}
diff --git a/partition-acceptance-test/src/test/java/org/opengroup/osdu/partition/api/SwaggerApiTest.java b/partition-acceptance-test/src/test/java/org/opengroup/osdu/partition/api/SwaggerApiTest.java
index 5df00373..f3a8c415 100644
--- a/partition-acceptance-test/src/test/java/org/opengroup/osdu/partition/api/SwaggerApiTest.java
+++ b/partition-acceptance-test/src/test/java/org/opengroup/osdu/partition/api/SwaggerApiTest.java
@@ -17,42 +17,20 @@
package org.opengroup.osdu.partition.api;
-import static org.junit.Assert.assertEquals;
-
-import org.apache.hc.client5.http.impl.classic.CloseableHttpResponse;
-import org.junit.After;
-import org.junit.Before;
-import org.junit.Test;
-import org.opengroup.osdu.partition.util.TestBase;
-import org.opengroup.osdu.partition.util.TestUtils;
-import org.springframework.http.HttpMethod;
-import org.springframework.http.HttpStatus;
-
-public final class SwaggerApiTest extends TestBase {
-
- private static final String CONTEXT_PATH = "api/partition/v1/";
- private static final String SWAGGER_API_PATH = "swagger";
- private static final String SWAGGER_API_DOCS_PATH = "api-docs";
-
- @Override
- @Before
- public void setup() throws Exception {
- }
-
- @Override
- @After
- public void tearDown() throws Exception {
- }
-
- @Test
- public void shouldReturn200_whenSwaggerApiIsCalled() throws Exception {
- CloseableHttpResponse response = TestUtils.send(CONTEXT_PATH + SWAGGER_API_PATH, HttpMethod.GET.name(),false);
- assertEquals(HttpStatus.OK.value(), response.getCode());
- }
-
- @Test
- public void shouldReturn200_whenSwaggerApiDocsIsCalled() throws Exception {
- CloseableHttpResponse response = TestUtils.send(CONTEXT_PATH + SWAGGER_API_DOCS_PATH, HttpMethod.GET.name(),false);
- assertEquals(HttpStatus.OK.value(), response.getCode());
- }
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import org.apache.hc.core5.http.HttpStatus;
+import org.junit.jupiter.api.Test;
+import org.opengroup.osdu.partition.util.BasePartitionAcceptanceTests;
+
+public final class SwaggerApiTest extends BasePartitionAcceptanceTests {
+
+ @Test
+ public void shouldReturn200_whenSwaggerApiIsCalled() {
+ assertEquals(HttpStatus.SC_OK, partitionClient.getSwagger().statusCode());
+ }
+
+ @Test
+ public void shouldReturn200_whenSwaggerApiDocsIsCalled() {
+ assertEquals(HttpStatus.SC_OK, partitionClient.getApiDocs().statusCode());
+ }
}
diff --git a/partition-acceptance-test/src/test/java/org/opengroup/osdu/partition/api/descriptor/GetPartitionDescriptor.java b/partition-acceptance-test/src/test/java/org/opengroup/osdu/partition/api/descriptor/GetPartitionDescriptor.java
deleted file mode 100644
index f1e5a264..00000000
--- a/partition-acceptance-test/src/test/java/org/opengroup/osdu/partition/api/descriptor/GetPartitionDescriptor.java
+++ /dev/null
@@ -1,36 +0,0 @@
-// Copyright 2017-2020, Schlumberger
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package org.opengroup.osdu.partition.api.descriptor;
-
-import org.opengroup.osdu.partition.util.RestDescriptor;
-import org.springframework.web.bind.annotation.RequestMethod;
-
-public class GetPartitionDescriptor extends RestDescriptor {
-
- @Override
- public String getPath() {
- return "api/partition/v1/partitions/" + arg();
- }
-
- @Override
- public String getHttpMethod() {
- return RequestMethod.GET.toString();
- }
-
- @Override
- public String getValidBody() {
- return "";
- }
-}
diff --git a/partition-acceptance-test/src/test/java/org/opengroup/osdu/partition/api/descriptor/ListPartitionDescriptor.java b/partition-acceptance-test/src/test/java/org/opengroup/osdu/partition/api/descriptor/ListPartitionDescriptor.java
deleted file mode 100644
index 29838f60..00000000
--- a/partition-acceptance-test/src/test/java/org/opengroup/osdu/partition/api/descriptor/ListPartitionDescriptor.java
+++ /dev/null
@@ -1,36 +0,0 @@
-// Copyright 2017-2020, Schlumberger
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-package org.opengroup.osdu.partition.api.descriptor;
-
-import org.opengroup.osdu.partition.util.RestDescriptor;
-import org.springframework.web.bind.annotation.RequestMethod;
-
-public class ListPartitionDescriptor extends RestDescriptor {
-
- @Override
- public String getPath() {
- return "api/partition/v1/partitions";
- }
-
- @Override
- public String getHttpMethod() {
- return RequestMethod.GET.toString();
- }
-
- @Override
- public String getValidBody() {
- return "";
- }
-}
diff --git a/partition-acceptance-test/src/test/java/org/opengroup/osdu/partition/util/BasePartitionAcceptanceTests.java b/partition-acceptance-test/src/test/java/org/opengroup/osdu/partition/util/BasePartitionAcceptanceTests.java
new file mode 100644
index 00000000..bad90fa2
--- /dev/null
+++ b/partition-acceptance-test/src/test/java/org/opengroup/osdu/partition/util/BasePartitionAcceptanceTests.java
@@ -0,0 +1,50 @@
+/*
+ * Copyright 2017-2020, Schlumberger
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.opengroup.osdu.partition.util;
+
+import java.util.List;
+import org.junit.jupiter.api.AfterEach;
+import org.junit.jupiter.api.BeforeEach;
+import org.opengroup.osdu.core.test.auth.UserType;
+import org.opengroup.osdu.core.test.base.BaseAcceptanceTests;
+import org.opengroup.osdu.core.test.client.PartitionClient;
+import org.opengroup.osdu.core.test.service.ServiceType;
+
+/**
+ * Base acceptance test class for the Partition service.
+ * Initialises a {@link PartitionClient} and exposes the data partition ID from the environment.
+ */
+public abstract class BasePartitionAcceptanceTests extends BaseAcceptanceTests {
+
+ protected PartitionClient partitionClient;
+
+ protected BasePartitionAcceptanceTests() {
+ super(List.of(UserType.PRIVILEGED_USER),
+ List.of(ServiceType.PARTITION_V1, ServiceType.ENTITLEMENTS_V2));
+ }
+
+ @BeforeEach
+ @Override
+ protected void setup() throws Exception {
+ partitionClient = new PartitionClient(stringHttpClient, UserType.PRIVILEGED_USER);
+ }
+
+ @AfterEach
+ @Override
+ protected void teardown() throws Exception {
+ }
+}
diff --git a/partition-acceptance-test/src/test/java/org/opengroup/osdu/partition/util/BaseTestTemplate.java b/partition-acceptance-test/src/test/java/org/opengroup/osdu/partition/util/BaseTestTemplate.java
deleted file mode 100644
index 7ab75a28..00000000
--- a/partition-acceptance-test/src/test/java/org/opengroup/osdu/partition/util/BaseTestTemplate.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Copyright 2017-2020, Schlumberger
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.opengroup.osdu.partition.util;
-
-import static org.junit.Assert.assertEquals;
-
-import org.apache.hc.client5.http.impl.classic.CloseableHttpResponse;
-import org.apache.hc.core5.http.io.entity.EntityUtils;
-import org.junit.Test;
-
-public abstract class BaseTestTemplate extends TestBase {
-
- protected RestDescriptor descriptor;
-
- public BaseTestTemplate(RestDescriptor descriptor) {
- this.descriptor = descriptor;
- }
-
- protected abstract String getId();
-
- protected abstract int expectedOkResponseCode();
-
- protected String error(String body) {
- return String.format("%s: %s %s %s", descriptor.getHttpMethod(), descriptor.getPath(), descriptor.getQuery(), body);
- }
-
- @Test
- public void should_return20XResponseCode_when_makingValidHttpsRequest() throws Exception {
- should_return20X_when_usingCredentialsWithPermission(testUtils.getAccessToken());
- }
-
- @Test
- public void should_return400_when_makingHttpRequestWithoutValidUrl() throws Exception {
- CloseableHttpResponse response = descriptor.runWithInvalidPath(getId(), testUtils.getAccessToken());
- assertEquals(error(EntityUtils.toString(response.getEntity())), 400, response.getCode());
- }
-
- public void should_return20X_when_usingCredentialsWithPermission(String token) throws Exception {
- CloseableHttpResponse response = descriptor.run(getId(), token);
- assertEquals(error(response.getCode() == 204 ? "" : EntityUtils.toString(response.getEntity())), expectedOkResponseCode(), response.getCode());
- }
-}
diff --git a/partition-acceptance-test/src/test/java/org/opengroup/osdu/partition/util/Config.java b/partition-acceptance-test/src/test/java/org/opengroup/osdu/partition/util/Config.java
deleted file mode 100644
index b513002c..00000000
--- a/partition-acceptance-test/src/test/java/org/opengroup/osdu/partition/util/Config.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * Copyright 2017-2020, Schlumberger
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.opengroup.osdu.partition.util;
-
-public class Config {
-
- public String hostUrl;
- public String osduTenant;
-
- private static final Config config = new Config();
-
- public static Config Instance() {
- //Note: PARTITION_BASE_URL has a '/' at the end of it
- config.hostUrl = System.getProperty("PARTITION_BASE_URL", System.getenv("PARTITION_BASE_URL"));
- config.osduTenant = System.getProperty("MY_TENANT", System.getenv("MY_TENANT"));
- return config;
- }
-}
diff --git a/partition-acceptance-test/src/test/java/org/opengroup/osdu/partition/util/CustomHttpClientResponseHandler.java b/partition-acceptance-test/src/test/java/org/opengroup/osdu/partition/util/CustomHttpClientResponseHandler.java
deleted file mode 100644
index 5b8790f2..00000000
--- a/partition-acceptance-test/src/test/java/org/opengroup/osdu/partition/util/CustomHttpClientResponseHandler.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * Copyright 2017-2020, Schlumberger
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.opengroup.osdu.partition.util;
-
-import java.io.IOException;
-import lombok.extern.slf4j.Slf4j;
-import org.apache.hc.client5.http.impl.classic.CloseableHttpResponse;
-import org.apache.hc.core5.http.ClassicHttpResponse;
-import org.apache.hc.core5.http.ContentType;
-import org.apache.hc.core5.http.HttpEntity;
-import org.apache.hc.core5.http.HttpStatus;
-import org.apache.hc.core5.http.ParseException;
-import org.apache.hc.core5.http.io.HttpClientResponseHandler;
-import org.apache.hc.core5.http.io.entity.EntityUtils;
-import org.apache.hc.core5.http.io.entity.StringEntity;
-
-@Slf4j
-public class CustomHttpClientResponseHandler implements HttpClientResponseHandler {
-
- @Override
- public CloseableHttpResponse handleResponse(ClassicHttpResponse classicHttpResponse) {
- HttpEntity entity = classicHttpResponse.getEntity();
- if(classicHttpResponse.getCode() != HttpStatus.SC_NO_CONTENT) {
- String body = "";
- try {
- body = EntityUtils.toString(entity);
- } catch (IOException | ParseException e) {
- log.error("unable to parse response");
- }
- HttpEntity newEntity = new StringEntity(body, ContentType.parse(entity.getContentType()));
- classicHttpResponse.setEntity(newEntity);
- }
- return (CloseableHttpResponse) classicHttpResponse;
- }
-}
diff --git a/partition-acceptance-test/src/test/java/org/opengroup/osdu/partition/util/RestDescriptor.java b/partition-acceptance-test/src/test/java/org/opengroup/osdu/partition/util/RestDescriptor.java
deleted file mode 100644
index 12bd2792..00000000
--- a/partition-acceptance-test/src/test/java/org/opengroup/osdu/partition/util/RestDescriptor.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Copyright 2017-2020, Schlumberger
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.opengroup.osdu.partition.util;
-
-import org.apache.hc.client5.http.impl.classic.CloseableHttpResponse;
-
-public abstract class RestDescriptor {
-
- public RestDescriptor() {
- }
-
- private String arg = "";
- public String arg(){
- return arg;
- }
- public abstract String getPath();
- public abstract String getHttpMethod();
- public abstract String getValidBody();
- public String getQuery() { return ""; }
-
- public CloseableHttpResponse run(String arg, String token) throws Exception{
- this.arg = arg;
- return TestUtils.send(getPath(), getHttpMethod(), token, getValidBody(), getQuery(), false);
- }
-
- public CloseableHttpResponse runWithInvalidPath(String arg, String token) throws Exception {
- this.arg = arg;
- return TestUtils.send(getPath() + "//", getHttpMethod(), token, getValidBody(), getQuery(), false);
- }
-}
diff --git a/partition-acceptance-test/src/test/java/org/opengroup/osdu/partition/util/TestBase.java b/partition-acceptance-test/src/test/java/org/opengroup/osdu/partition/util/TestBase.java
deleted file mode 100644
index a6d2b4b7..00000000
--- a/partition-acceptance-test/src/test/java/org/opengroup/osdu/partition/util/TestBase.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * Copyright 2017-2020, Schlumberger
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.opengroup.osdu.partition.util;
-
-public abstract class TestBase {
-
- protected TestUtils testUtils = null;
-
- public static String getIntegrationTestPrefix() {
- return "integrationtest-";
- }
-
- public abstract void setup() throws Exception;
-
- public abstract void tearDown() throws Exception;
-}
diff --git a/partition-acceptance-test/src/test/java/org/opengroup/osdu/partition/util/TestTokenUtils.java b/partition-acceptance-test/src/test/java/org/opengroup/osdu/partition/util/TestTokenUtils.java
deleted file mode 100644
index e73f5324..00000000
--- a/partition-acceptance-test/src/test/java/org/opengroup/osdu/partition/util/TestTokenUtils.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Copyright 2020-2022 Google LLC
- * Copyright 2020-2022 EPAM Systems, Inc
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.opengroup.osdu.partition.util;
-
-import org.opengroup.osdu.partition.util.conf.OpenIDTokenProvider;
-import org.springframework.util.StringUtils;
-
-public class TestTokenUtils extends TestUtils {
-
- private OpenIDTokenProvider tokenProvider = null;
- private static final String TOKEN_PREFIX = "Bearer ";
-
- public TestTokenUtils() {
- token = System.getProperty("ROOT_USER_TOKEN", System.getenv("ROOT_USER_TOKEN"));
-
- if (token != null && !token.trim().isEmpty()) {
- token = TOKEN_PREFIX + token;
- }
- else {
- tokenProvider = new OpenIDTokenProvider();
- }
- }
-
- @Override
- public String getAccessToken() {
- if (StringUtils.isEmpty(token)) {
- token = tokenProvider.getToken();
- }
- return token;
- }
-}
diff --git a/partition-acceptance-test/src/test/java/org/opengroup/osdu/partition/util/TestUtils.java b/partition-acceptance-test/src/test/java/org/opengroup/osdu/partition/util/TestUtils.java
deleted file mode 100644
index 36d037cc..00000000
--- a/partition-acceptance-test/src/test/java/org/opengroup/osdu/partition/util/TestUtils.java
+++ /dev/null
@@ -1,129 +0,0 @@
-/*
- * Copyright 2017-2020, Schlumberger
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.opengroup.osdu.partition.util;
-
-import com.fasterxml.jackson.core.type.TypeReference;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import java.io.IOException;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.concurrent.TimeUnit;
-import org.apache.hc.client5.http.config.ConnectionConfig;
-import org.apache.hc.client5.http.impl.classic.CloseableHttpClient;
-import org.apache.hc.client5.http.impl.classic.CloseableHttpResponse;
-import org.apache.hc.client5.http.impl.classic.HttpClientBuilder;
-import org.apache.hc.client5.http.impl.io.BasicHttpClientConnectionManager;
-import org.apache.hc.core5.http.ClassicHttpRequest;
-import org.apache.hc.core5.http.ContentType;
-import org.apache.hc.core5.http.ParseException;
-import org.apache.hc.core5.http.io.entity.EntityUtils;
-import org.apache.hc.core5.http.io.support.ClassicRequestBuilder;
-
-public abstract class TestUtils {
-
- protected static String token = null;
-
- public static String getApiPath(String api, boolean enforceHttp) throws MalformedURLException {
- String baseUrl = Config.Instance().hostUrl;
- if(enforceHttp)
- baseUrl = baseUrl.replaceFirst("https", "http");
- URL mergedURL = new URL(baseUrl + api);
- return mergedURL.toString();
- }
-
- public abstract String getAccessToken() throws Exception;
-
- public static Map getOsduTenantHeaders() {
- Map headers = new HashMap<>();
- headers.put("data-partition-id", Config.Instance().osduTenant);
- return headers;
- }
-
- public static CloseableHttpResponse send(String path, String httpMethod, String token, String requestBody, String query, boolean enforceHttp)
- throws IOException {
-
- Map headers = getOsduTenantHeaders();
- return send(path, httpMethod, token, requestBody, query, headers, enforceHttp);
- }
-
- public static CloseableHttpResponse send(String path, String httpMethod, String token, String requestBody, String query,
- Map headers, boolean enforceHttp)
- throws IOException {
-
- BasicHttpClientConnectionManager cm = createBasicHttpClientConnectionManager();
- ClassicHttpRequest httpRequest = createHttpRequest(path, httpMethod, token, requestBody, headers, enforceHttp);
-
- try (CloseableHttpClient httpClient = HttpClientBuilder.create().setConnectionManager(cm).build()) {
- return httpClient.execute(httpRequest, new CustomHttpClientResponseHandler());
- }
- }
-
- /**
- * Referenced for Test cases where [Token, body] not required. ex [Swagger API]
- **/
- public static CloseableHttpResponse send(String path, String httpMethod, boolean enforceHttp) throws IOException {
-
- BasicHttpClientConnectionManager cm = createBasicHttpClientConnectionManager();
- ClassicHttpRequest httpRequest = createHttpRequest(path, httpMethod, enforceHttp);
-
- try (CloseableHttpClient httpClient = HttpClientBuilder.create().setConnectionManager(cm).build()) {
- return httpClient.execute(httpRequest, new CustomHttpClientResponseHandler());
- }
- }
-
- private static ClassicHttpRequest createHttpRequest(String path, String httpMethod, String token, String requestBody,
- Map headers, boolean enforceHttp) throws MalformedURLException {
- String url = getApiPath(path, enforceHttp);
- ClassicRequestBuilder classicRequestBuilder = ClassicRequestBuilder.create(httpMethod)
- .setUri(url)
- .addHeader("Authorization", token)
- .setEntity(requestBody, ContentType.APPLICATION_JSON);
- headers.forEach(classicRequestBuilder::addHeader);
- return classicRequestBuilder.build();
- }
-
- private static ClassicHttpRequest createHttpRequest(String path, String httpMethod, boolean enforceHttp) throws MalformedURLException {
- String url = getApiPath(path, enforceHttp);
- return ClassicRequestBuilder.create(httpMethod).setUri(url).build();
- }
-
- private static BasicHttpClientConnectionManager createBasicHttpClientConnectionManager() {
- ConnectionConfig connConfig = ConnectionConfig.custom()
- .setConnectTimeout(1500000, TimeUnit.MILLISECONDS)
- .setSocketTimeout(1500000, TimeUnit.MILLISECONDS)
- .build();
- BasicHttpClientConnectionManager cm = new BasicHttpClientConnectionManager();
- cm.setConnectionConfig(connConfig);
- return cm;
- }
-
- public static T parseResponse(CloseableHttpResponse response) throws IOException {
- String jsonString;
- try {
- jsonString = EntityUtils.toString(response.getEntity());
- } catch (ParseException e) {
- return null;
- }
-
- ObjectMapper objectMapper = new ObjectMapper();
- return objectMapper.readValue(jsonString, new TypeReference<>() {
- });
- }
-
-}
diff --git a/partition-acceptance-test/src/test/java/org/opengroup/osdu/partition/util/conf/OpenIDProviderConfig.java b/partition-acceptance-test/src/test/java/org/opengroup/osdu/partition/util/conf/OpenIDProviderConfig.java
deleted file mode 100644
index 1e29efe6..00000000
--- a/partition-acceptance-test/src/test/java/org/opengroup/osdu/partition/util/conf/OpenIDProviderConfig.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * Copyright 2020-2022 Google LLC
- * Copyright 2020-2022 EPAM Systems, Inc
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.opengroup.osdu.partition.util.conf;
-
-import com.nimbusds.oauth2.sdk.http.HTTPRequest;
-import com.nimbusds.oauth2.sdk.http.HTTPResponse;
-import com.nimbusds.oauth2.sdk.id.Issuer;
-import com.nimbusds.openid.connect.sdk.op.OIDCProviderConfigurationRequest;
-import com.nimbusds.openid.connect.sdk.op.OIDCProviderMetadata;
-import org.springframework.util.StringUtils;
-
-public class OpenIDProviderConfig {
-
- private String clientId;
- private String clientSecret;
- private String url;
- private String[] scopes = {"openid"};
- private static final OpenIDProviderConfig openIDProviderConfig = new OpenIDProviderConfig();
- private static OIDCProviderMetadata providerMetadata;
-
- public static OpenIDProviderConfig Instance() {
- try {
- openIDProviderConfig.clientId = System.getProperty("PRIVILEGED_USER_OPENID_PROVIDER_CLIENT_ID", System.getenv("PRIVILEGED_USER_OPENID_PROVIDER_CLIENT_ID"));
- openIDProviderConfig.clientSecret = System.getProperty("PRIVILEGED_USER_OPENID_PROVIDER_CLIENT_SECRET", System.getenv("PRIVILEGED_USER_OPENID_PROVIDER_CLIENT_SECRET"));
- openIDProviderConfig.url = System.getProperty("TEST_OPENID_PROVIDER_URL", System.getenv("TEST_OPENID_PROVIDER_URL"));
- // Override default scope if provided
- String scopeEnv = System.getProperty("PRIVILEGED_USER_OPENID_PROVIDER_SCOPE", System.getenv("PRIVILEGED_USER_OPENID_PROVIDER_SCOPE"));
- if (scopeEnv != null && !scopeEnv.isEmpty()) {
- openIDProviderConfig.scopes = new String[]{scopeEnv};
- }
- if(StringUtils.isEmpty(openIDProviderConfig.clientId) || StringUtils.isEmpty(openIDProviderConfig.clientSecret) || StringUtils.isEmpty(openIDProviderConfig.url)){
- return null;
- }
- Issuer issuer = new Issuer(openIDProviderConfig.url);
- OIDCProviderConfigurationRequest request = new OIDCProviderConfigurationRequest(issuer);
- HTTPRequest httpRequest = request.toHTTPRequest();
- HTTPResponse httpResponse = httpRequest.send();
- providerMetadata = OIDCProviderMetadata.parse(httpResponse.getContentAsJSONObject());
- } catch (Exception e) {
- throw new RuntimeException("Malformed token provider configuration", e);
- }
- return openIDProviderConfig;
- }
-
- public String getClientId() {
- return clientId;
- }
-
- public String getClientSecret() {
- return clientSecret;
- }
-
- public String[] getScopes() {
- return scopes;
- }
-
- public OIDCProviderMetadata getProviderMetadata() {
- return providerMetadata;
- }
-}
diff --git a/partition-acceptance-test/src/test/java/org/opengroup/osdu/partition/util/conf/OpenIDTokenProvider.java b/partition-acceptance-test/src/test/java/org/opengroup/osdu/partition/util/conf/OpenIDTokenProvider.java
deleted file mode 100644
index 61351b0a..00000000
--- a/partition-acceptance-test/src/test/java/org/opengroup/osdu/partition/util/conf/OpenIDTokenProvider.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * Copyright 2020-2022 Google LLC
- * Copyright 2020-2022 EPAM Systems, Inc
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.opengroup.osdu.partition.util.conf;
-
-import com.nimbusds.oauth2.sdk.AuthorizationGrant;
-import com.nimbusds.oauth2.sdk.ClientCredentialsGrant;
-import com.nimbusds.oauth2.sdk.ParseException;
-import com.nimbusds.oauth2.sdk.Scope;
-import com.nimbusds.oauth2.sdk.TokenRequest;
-import com.nimbusds.oauth2.sdk.TokenResponse;
-import com.nimbusds.oauth2.sdk.auth.ClientAuthentication;
-import com.nimbusds.oauth2.sdk.auth.ClientSecretBasic;
-import com.nimbusds.oauth2.sdk.auth.Secret;
-import com.nimbusds.oauth2.sdk.id.ClientID;
-import com.nimbusds.openid.connect.sdk.OIDCTokenResponseParser;
-import java.io.IOException;
-import java.net.URI;
-import java.util.Objects;
-import net.minidev.json.JSONObject;
-
-public class OpenIDTokenProvider {
-
- private static final OpenIDProviderConfig openIDProviderConfig = OpenIDProviderConfig.Instance();
- private final AuthorizationGrant clientGrant = new ClientCredentialsGrant();
- private final URI tokenEndpointURI;
- private final Scope scope;
- private final ClientAuthentication clientAuthentication;
-
- public OpenIDTokenProvider() {
- if(openIDProviderConfig != null) {
- this.tokenEndpointURI = openIDProviderConfig.getProviderMetadata().getTokenEndpointURI();
- this.scope = new Scope(openIDProviderConfig.getScopes());
- this.clientAuthentication =
- new ClientSecretBasic(
- new ClientID(openIDProviderConfig.getClientId()),
- new Secret(openIDProviderConfig.getClientSecret())
- );
- }else {
- this.tokenEndpointURI = null;
- this.scope = null;
- this.clientAuthentication = null;
- }
- }
-
- public String getToken() {
- try {
- if (anyIsNull(this.tokenEndpointURI, this.scope, this.clientAuthentication)) {
- return null;
- }
- TokenRequest request = new TokenRequest(
- this.tokenEndpointURI,
- this.clientAuthentication,
- this.clientGrant,
- this.scope
- );
- return "Bearer " + requestToken(request);
- } catch (ParseException | IOException e) {
- throw new RuntimeException("Unable get credentials from INTEGRATION_TESTER variables", e);
- }
- }
-
- private boolean anyIsNull(URI tokenEndpointURI, Scope scope, ClientAuthentication clientAuthentication) {
- return tokenEndpointURI == null || scope == null || clientAuthentication == null;
- }
-
- private String requestToken(TokenRequest tokenRequest) throws ParseException, IOException {
-
- TokenResponse parse = OIDCTokenResponseParser.parse(tokenRequest.toHTTPRequest().send());
-
- if (!parse.indicatesSuccess()) {
- throw new RuntimeException("Unable get credentials from INTEGRATION_TESTER variables");
- }
-
- JSONObject jsonObject = parse.toSuccessResponse().toJSONObject();
- // OAuth2 client_credentials returns access_token; some OIDC providers return id_token
- String tokenValue = jsonObject.getAsString("access_token");
- if (Objects.isNull(tokenValue) || tokenValue.isEmpty()) {
- tokenValue = jsonObject.getAsString("id_token");
- }
- if (Objects.isNull(tokenValue) || tokenValue.isEmpty()) {
- throw new RuntimeException("Unable get credentials from INTEGRATION_TESTER variables");
- }
- return tokenValue;
- }
-}
diff --git a/partition-acceptance-test/src/test/resources/required-roles.json b/partition-acceptance-test/src/test/resources/required-roles.json
new file mode 100644
index 00000000..d1ec23d8
--- /dev/null
+++ b/partition-acceptance-test/src/test/resources/required-roles.json
@@ -0,0 +1,5 @@
+{
+ "PRIVILEGED_USER": [
+ "users"
+ ]
+}
diff --git a/partition-core-plus/pom.xml b/partition-core-plus/pom.xml
index 9795b844..e4e02c52 100644
--- a/partition-core-plus/pom.xml
+++ b/partition-core-plus/pom.xml
@@ -12,31 +12,8 @@
partition-core-plus
- 17
- 17
UTF-8
- 2.21.1
-
-
-
-
-
- com.fasterxml.jackson
- jackson-bom
- ${jackson.version}
- pom
- import
-
-
- org.springframework.boot
- spring-boot-dependencies
- ${spring-boot.version}
- pom
- import
-
-
-
org.opengroup.osdu
@@ -60,6 +37,8 @@
org.projectlombok
lombok
+ provided
+ true
org.junit.jupiter
@@ -105,16 +84,14 @@
org.apache.maven.plugins
maven-surefire-plugin
- 3.2.5
- @{argLine} --add-opens java.base/java.lang=ALL_UNNAMED
+ @{argLine} --add-opens java.base/java.lang=ALL-UNNAMED
org.jacoco
jacoco-maven-plugin
- 0.8.14
prepare-agent
diff --git a/partition-core-plus/src/main/resources/application.properties b/partition-core-plus/src/main/resources/application.properties
index 4dc59dfd..caeab43b 100644
--- a/partition-core-plus/src/main/resources/application.properties
+++ b/partition-core-plus/src/main/resources/application.properties
@@ -18,7 +18,6 @@
#server config
server.servlet.contextPath=/api/partition/v1
server.port=8080
-springfox.documentation.swagger.v2.path=/api-docs
management.endpoint.health.show-details=always
management.health.diskspace.enabled=false
ACCEPT_HTTP=true
diff --git a/partition-core/pom.xml b/partition-core/pom.xml
index aa414e4c..637a9233 100644
--- a/partition-core/pom.xml
+++ b/partition-core/pom.xml
@@ -29,33 +29,13 @@
1.3.72
- 2.7
- 2.8.14
- 1.9.4
- 2.6.0
-
-
- 3.4.0
- 3.12.4
- 3.27.6
-
-
- 3.5.4
- 3.5.4
- 2.21.1
+ 1.11.0
+
+ 3.27.7
-
-
-
- com.fasterxml.jackson
- jackson-bom
- ${jackson.version}
- pom
- import
-
xerces
xercesImpl
@@ -111,18 +91,15 @@
org.projectlombok
lombok
- ${lombok.version}
provided
net.minidev
json-smart
- ${json-smart.version}
org.springdoc
springdoc-openapi-starter-webmvc-ui
- ${openapi.version}
@@ -142,16 +119,10 @@
-
- org.mockito
- mockito-inline
- ${mockito.inline.version}
- test
-
org.codehaus.plexus
plexus-utils
- 4.0.2
+ 4.0.3
test
@@ -160,35 +131,31 @@
${assertj_core_version}
test
-
- junit
- junit
- test
-
-
+
+ org.junit.jupiter
+ junit-jupiter
+ test
+
+
+ org.mockito
+ mockito-junit-jupiter
+ test
+
+
org.apache.maven.plugins
maven-surefire-plugin
- ${maven_surefire_plugin_version}
false
1
-
-
- org.apache.maven.surefire
- surefire-junit47
- ${maven_surefire_plugin_version}
-
-
org.jacoco
jacoco-maven-plugin
- 0.8.14
diff --git a/partition-core/src/main/java/org/opengroup/osdu/partition/model/Property.java b/partition-core/src/main/java/org/opengroup/osdu/partition/model/Property.java
index 955ef32e..ba2d3386 100644
--- a/partition-core/src/main/java/org/opengroup/osdu/partition/model/Property.java
+++ b/partition-core/src/main/java/org/opengroup/osdu/partition/model/Property.java
@@ -14,6 +14,7 @@
package org.opengroup.osdu.partition.model;
+import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
@@ -23,8 +24,13 @@
@Builder
@AllArgsConstructor
@NoArgsConstructor
+@Schema(description = "A single partition property entry, paired with a sensitivity flag")
public class Property {
@Builder.Default
+ @Schema(description = "When true, the value is treated as a secret and resolved through the configured secret store",
+ example = "false")
private boolean sensitive = false;
+ @Schema(description = "The property value. May be a literal or a reference to a secret when sensitive=true",
+ example = "shared")
private Object value;
}
diff --git a/partition-core/src/main/java/org/opengroup/osdu/partition/swagger/SwaggerConfiguration.java b/partition-core/src/main/java/org/opengroup/osdu/partition/swagger/SwaggerConfiguration.java
index 72427376..da114ceb 100644
--- a/partition-core/src/main/java/org/opengroup/osdu/partition/swagger/SwaggerConfiguration.java
+++ b/partition-core/src/main/java/org/opengroup/osdu/partition/swagger/SwaggerConfiguration.java
@@ -26,6 +26,7 @@
import io.swagger.v3.oas.models.media.BooleanSchema;
import io.swagger.v3.oas.models.media.ObjectSchema;
import io.swagger.v3.oas.models.media.Schema;
+import io.swagger.v3.oas.models.media.StringSchema;
import io.swagger.v3.oas.models.security.SecurityRequirement;
import io.swagger.v3.oas.models.security.SecurityScheme;
import io.swagger.v3.oas.models.servers.Server;
@@ -95,8 +96,10 @@ public OperationCustomizer customize() {
.in("header")
.required(true)
.description("Tenant Id")
+ .schema(new StringSchema())
.name(DpsHeaders.DATA_PARTITION_ID));
return operation;
};
}
+
}
diff --git a/partition-core/src/main/resources/swagger.properties b/partition-core/src/main/resources/swagger.properties
index b01211bf..962358e5 100644
--- a/partition-core/src/main/resources/swagger.properties
+++ b/partition-core/src/main/resources/swagger.properties
@@ -1,6 +1,9 @@
#Manage common SpringDoc and OpenAPI related properties
#SpringDoc related properties
+springdoc.api-docs.version=openapi_3_1
+springdoc.default-produces-media-type=application/json
+springdoc.default-consumes-media-type=application/json
springdoc.swagger-ui.tagsSorter=alpha
springdoc.swagger-ui.operationsSorter=alpha
springdoc.swagger-ui.doc-expansion=none
diff --git a/partition-core/src/test/java/org/opengroup/osdu/partition/auth/AuthorizationFilterTest.java b/partition-core/src/test/java/org/opengroup/osdu/partition/auth/AuthorizationFilterTest.java
index ffe4fe6a..7e17b1d0 100644
--- a/partition-core/src/test/java/org/opengroup/osdu/partition/auth/AuthorizationFilterTest.java
+++ b/partition-core/src/test/java/org/opengroup/osdu/partition/auth/AuthorizationFilterTest.java
@@ -14,22 +14,25 @@
package org.opengroup.osdu.partition.auth;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.verifyNoInteractions;
import static org.mockito.Mockito.when;
import static org.opengroup.osdu.partition.service.PartitionServiceRole.DOMAIN_ADMIN;
-import org.junit.Test;
-import org.junit.runner.RunWith;
+import org.junit.jupiter.api.Test;
import org.mockito.InjectMocks;
import org.mockito.Mock;
-import org.mockito.junit.MockitoJUnitRunner;
import org.opengroup.osdu.core.common.model.http.DpsHeaders;
import org.opengroup.osdu.partition.provider.interfaces.IAuthorizationService;
+import org.junit.jupiter.api.extension.ExtendWith;
+import org.mockito.junit.jupiter.MockitoExtension;
+import org.mockito.junit.jupiter.MockitoSettings;
+import org.mockito.quality.Strictness;
-@RunWith(MockitoJUnitRunner.class)
+@ExtendWith(MockitoExtension.class)
+@MockitoSettings(strictness = Strictness.LENIENT)
public class AuthorizationFilterTest {
@Mock
diff --git a/partition-core/src/test/java/org/opengroup/osdu/partition/controller/HealthCheckControllerTests.java b/partition-core/src/test/java/org/opengroup/osdu/partition/controller/HealthCheckControllerTests.java
index 078ecf2c..8814ec6a 100644
--- a/partition-core/src/test/java/org/opengroup/osdu/partition/controller/HealthCheckControllerTests.java
+++ b/partition-core/src/test/java/org/opengroup/osdu/partition/controller/HealthCheckControllerTests.java
@@ -16,17 +16,17 @@
package org.opengroup.osdu.partition.controller;
-import org.junit.Before;
-import org.junit.Test;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
import org.springframework.http.HttpStatus;
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
public class HealthCheckControllerTests {
private HealthCheckController sut;
- @Before
+ @BeforeEach
public void setup() {
this.sut = new HealthCheckController();
}
diff --git a/partition-core/src/test/java/org/opengroup/osdu/partition/controller/InfoControllerTest.java b/partition-core/src/test/java/org/opengroup/osdu/partition/controller/InfoControllerTest.java
index a2c08583..5ebae44f 100644
--- a/partition-core/src/test/java/org/opengroup/osdu/partition/controller/InfoControllerTest.java
+++ b/partition-core/src/test/java/org/opengroup/osdu/partition/controller/InfoControllerTest.java
@@ -16,21 +16,23 @@
package org.opengroup.osdu.partition.controller;
-import org.junit.Test;
-import org.junit.runner.RunWith;
+import org.junit.jupiter.api.Test;
import org.mockito.InjectMocks;
import org.mockito.Mock;
-import org.mockito.junit.MockitoJUnitRunner;
import org.opengroup.osdu.core.common.info.VersionInfoBuilder;
import org.opengroup.osdu.core.common.model.info.VersionInfo;
import java.io.IOException;
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.mockito.Mockito.when;
+import org.junit.jupiter.api.extension.ExtendWith;
+import org.mockito.junit.jupiter.MockitoExtension;
+import org.mockito.junit.jupiter.MockitoSettings;
+import org.mockito.quality.Strictness;
-
-@RunWith(MockitoJUnitRunner.class)
+@ExtendWith(MockitoExtension.class)
+@MockitoSettings(strictness = Strictness.LENIENT)
public class InfoControllerTest {
@InjectMocks
private InfoController sut;
diff --git a/partition-core/src/test/java/org/opengroup/osdu/partition/controller/PartitionControllerTest.java b/partition-core/src/test/java/org/opengroup/osdu/partition/controller/PartitionControllerTest.java
index 06e161d8..90727618 100644
--- a/partition-core/src/test/java/org/opengroup/osdu/partition/controller/PartitionControllerTest.java
+++ b/partition-core/src/test/java/org/opengroup/osdu/partition/controller/PartitionControllerTest.java
@@ -14,12 +14,10 @@
package org.opengroup.osdu.partition.controller;
-import org.junit.Test;
-import org.junit.runner.RunWith;
+import org.junit.jupiter.api.Test;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.MockedStatic;
-import org.mockito.junit.MockitoJUnitRunner;
import org.opengroup.osdu.core.common.model.http.AppException;
import org.opengroup.osdu.partition.logging.AuditLogger;
import org.opengroup.osdu.partition.model.PartitionInfo;
@@ -35,11 +33,16 @@
import java.util.List;
import java.util.Map;
-import static org.junit.Assert.*;
+import static org.junit.jupiter.api.Assertions.*;
import static org.mockito.ArgumentMatchers.anyString;
import static org.mockito.Mockito.*;
+import org.junit.jupiter.api.extension.ExtendWith;
+import org.mockito.junit.jupiter.MockitoExtension;
+import org.mockito.junit.jupiter.MockitoSettings;
+import org.mockito.quality.Strictness;
-@RunWith(MockitoJUnitRunner.class)
+@ExtendWith(MockitoExtension.class)
+@MockitoSettings(strictness = Strictness.LENIENT)
public class PartitionControllerTest {
private final AppException NOT_FOUND_EXCEPTION =
@@ -108,22 +111,19 @@ public void should_returnHttp204_when_deletingPartitionSuccessfully() {
assertEquals(HttpStatus.NO_CONTENT.value(), result.getStatusCodeValue());
}
- @Test(expected = AppException.class)
+ @Test
public void should_throwException_when_deletingOfNonExistentPartition() {
when(partitionService.deletePartition(anyString())).thenThrow(NOT_FOUND_EXCEPTION);
- this.sut.delete("fakePartition");
+
+ assertThrows(AppException.class, () -> this.sut.delete("fakePartition"));
}
- @Test(expected = AppException.class)
+ @Test
public void should_throwException_when_deletingNonExistentPartition() {
when(partitionService.deletePartition(anyString())).thenThrow(NOT_FOUND_EXCEPTION);
- try {
- this.sut.delete("fakePartition");
- }
- catch (AppException ae) {
- assertEquals(HttpStatus.NOT_FOUND.value(), ae.getError().getCode());
- throw ae;
- }
+
+ AppException ae = assertThrows(AppException.class, () -> this.sut.delete("fakePartition"));
+ assertEquals(HttpStatus.NOT_FOUND.value(), ae.getError().getCode());
}
@Test
diff --git a/partition-core/src/test/java/org/opengroup/osdu/partition/di/BeanConfigurationTest.java b/partition-core/src/test/java/org/opengroup/osdu/partition/di/BeanConfigurationTest.java
index aff2132d..d3f56918 100644
--- a/partition-core/src/test/java/org/opengroup/osdu/partition/di/BeanConfigurationTest.java
+++ b/partition-core/src/test/java/org/opengroup/osdu/partition/di/BeanConfigurationTest.java
@@ -14,18 +14,15 @@
package org.opengroup.osdu.partition.di;
-import org.junit.Test;
-import org.junit.runner.RunWith;
+import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;
import org.springframework.boot.test.context.SpringBootTest;
-import org.springframework.test.context.junit4.SpringRunner;
import org.springframework.test.web.servlet.MockMvc;
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
-@RunWith(SpringRunner.class)
@SpringBootTest(classes = BeanConfiguration.class)
@AutoConfigureMockMvc
public class BeanConfigurationTest {
diff --git a/partition-core/src/test/java/org/opengroup/osdu/partition/logging/AuditEventsTest.java b/partition-core/src/test/java/org/opengroup/osdu/partition/logging/AuditEventsTest.java
index dd4a1b09..998d5907 100644
--- a/partition-core/src/test/java/org/opengroup/osdu/partition/logging/AuditEventsTest.java
+++ b/partition-core/src/test/java/org/opengroup/osdu/partition/logging/AuditEventsTest.java
@@ -16,11 +16,11 @@
package org.opengroup.osdu.partition.logging;
-import static org.junit.Assert.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
import java.util.Collections;
import java.util.List;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import org.opengroup.osdu.core.common.logging.audit.AuditStatus;
public class AuditEventsTest {
diff --git a/partition-core/src/test/java/org/opengroup/osdu/partition/logging/AuditLoggerTest.java b/partition-core/src/test/java/org/opengroup/osdu/partition/logging/AuditLoggerTest.java
index a2808e00..fe8b3891 100644
--- a/partition-core/src/test/java/org/opengroup/osdu/partition/logging/AuditLoggerTest.java
+++ b/partition-core/src/test/java/org/opengroup/osdu/partition/logging/AuditLoggerTest.java
@@ -17,7 +17,7 @@
package org.opengroup.osdu.partition.logging;
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
@@ -25,18 +25,21 @@
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
-import org.junit.Before;
-import org.junit.Test;
-import org.junit.runner.RunWith;
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Test;
import org.mockito.InjectMocks;
import org.mockito.Mock;
-import org.mockito.junit.MockitoJUnitRunner;
import org.opengroup.osdu.core.common.logging.JaxRsDpsLog;
import org.opengroup.osdu.core.common.logging.audit.AuditStatus;
import org.opengroup.osdu.core.common.model.http.DpsHeaders;
import org.springframework.test.util.ReflectionTestUtils;
+import org.junit.jupiter.api.extension.ExtendWith;
+import org.mockito.junit.jupiter.MockitoExtension;
+import org.mockito.junit.jupiter.MockitoSettings;
+import org.mockito.quality.Strictness;
-@RunWith(MockitoJUnitRunner.class)
+@ExtendWith(MockitoExtension.class)
+@MockitoSettings(strictness = Strictness.LENIENT)
public class AuditLoggerTest {
private static final String TEST_USER = "partitionAccountUser";
@@ -59,7 +62,7 @@ public class AuditLoggerTest {
private List resources;
private AuditEvents auditEvents;
- @Before
+ @BeforeEach
public void setup() {
resources = Collections.singletonList("resources");
diff --git a/partition-core/src/test/java/org/opengroup/osdu/partition/logging/AuditOperationTest.java b/partition-core/src/test/java/org/opengroup/osdu/partition/logging/AuditOperationTest.java
index 8ed89252..9d24efc5 100644
--- a/partition-core/src/test/java/org/opengroup/osdu/partition/logging/AuditOperationTest.java
+++ b/partition-core/src/test/java/org/opengroup/osdu/partition/logging/AuditOperationTest.java
@@ -17,13 +17,14 @@
package org.opengroup.osdu.partition.logging;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertNotNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+import static org.junit.jupiter.api.Assertions.fail;
import java.util.Collections;
import java.util.List;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import org.opengroup.osdu.partition.service.PartitionServiceRole;
public class AuditOperationTest {
@@ -76,7 +77,7 @@ public void should_returnUnmodifiableList() {
assertNotNull(roles);
try {
roles.add("should-fail");
- assertTrue("Expected UnsupportedOperationException", false);
+ fail("Expected UnsupportedOperationException");
} catch (UnsupportedOperationException e) {
// expected
}
@@ -86,7 +87,7 @@ public void should_returnUnmodifiableList() {
public void should_haveAllOperationsDefined() {
for (AuditOperation op : AuditOperation.values()) {
assertNotNull(op.getRequiredGroups());
- assertTrue(op.name() + " should have at least one required group", op.getRequiredGroups().size() > 0);
+ assertTrue(op.getRequiredGroups().size() > 0, op.name() + " should have at least one required group");
}
}
}
diff --git a/partition-core/src/test/java/org/opengroup/osdu/partition/middleware/GlobalExceptionMapperTest.java b/partition-core/src/test/java/org/opengroup/osdu/partition/middleware/GlobalExceptionMapperTest.java
index f27bc766..ad88359f 100644
--- a/partition-core/src/test/java/org/opengroup/osdu/partition/middleware/GlobalExceptionMapperTest.java
+++ b/partition-core/src/test/java/org/opengroup/osdu/partition/middleware/GlobalExceptionMapperTest.java
@@ -18,11 +18,9 @@
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException;
import com.google.gson.Gson;
-import org.junit.Test;
-import org.junit.runner.RunWith;
+import org.junit.jupiter.api.Test;
import org.mockito.InjectMocks;
import org.mockito.Mock;
-import org.mockito.junit.MockitoJUnitRunner;
import org.opengroup.osdu.core.common.exception.NotFoundException;
import org.opengroup.osdu.core.common.logging.JaxRsDpsLog;
import org.opengroup.osdu.core.common.model.http.AppException;
@@ -36,12 +34,17 @@
import jakarta.validation.ConstraintViolationException;
import jakarta.validation.ValidationException;
import java.util.HashSet;
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
import static org.mockito.Mockito.verify;
+import org.junit.jupiter.api.extension.ExtendWith;
+import org.mockito.junit.jupiter.MockitoExtension;
+import org.mockito.junit.jupiter.MockitoSettings;
+import org.mockito.quality.Strictness;
-@RunWith(MockitoJUnitRunner.class)
+@ExtendWith(MockitoExtension.class)
+@MockitoSettings(strictness = Strictness.LENIENT)
public class GlobalExceptionMapperTest {
private static final Gson gson = new Gson();
@@ -78,7 +81,6 @@ public void should_useGenericResponse_when_exceptionIsThrownDuringMapping() {
assertEquals(gson.toJson("any message"), response.getBody());
}
-
@Test
public void should_use404ValueInResponse_When_NotFoundExceptionIsHandledByGlobalExceptionMapper() {
NotFoundException exception = new NotFoundException("any message");
@@ -166,7 +168,6 @@ public void should_logErrorMessage_when_statusCodeLargerThan499() {
verify(this.log).error("An unknown error has occurred.", appException);
}
-
@Test
public void should_logWarningMessage_when_statusCodeSmallerThan499() {
NotFoundException originalException = new NotFoundException("any message");
diff --git a/partition-core/src/test/java/org/opengroup/osdu/partition/middleware/PartitionFilterTest.java b/partition-core/src/test/java/org/opengroup/osdu/partition/middleware/PartitionFilterTest.java
index 56db12f1..ededc2d4 100644
--- a/partition-core/src/test/java/org/opengroup/osdu/partition/middleware/PartitionFilterTest.java
+++ b/partition-core/src/test/java/org/opengroup/osdu/partition/middleware/PartitionFilterTest.java
@@ -17,12 +17,10 @@
import jakarta.servlet.ServletRequest;
import jakarta.servlet.ServletResponse;
-import org.junit.Test;
-import org.junit.runner.RunWith;
+import org.junit.jupiter.api.Test;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.Mockito;
-import org.mockito.junit.MockitoJUnitRunner;
import org.opengroup.osdu.core.common.logging.JaxRsDpsLog;
import org.opengroup.osdu.core.common.model.http.DpsHeaders;
@@ -33,8 +31,13 @@
import java.io.IOException;
import static org.mockito.Mockito.*;
+import org.junit.jupiter.api.extension.ExtendWith;
+import org.mockito.junit.jupiter.MockitoExtension;
+import org.mockito.junit.jupiter.MockitoSettings;
+import org.mockito.quality.Strictness;
-@RunWith(MockitoJUnitRunner.class)
+@ExtendWith(MockitoExtension.class)
+@MockitoSettings(strictness = Strictness.LENIENT)
public class PartitionFilterTest {
@Mock
diff --git a/partition-core/src/test/java/org/opengroup/osdu/partition/model/PartitionInfoTest.java b/partition-core/src/test/java/org/opengroup/osdu/partition/model/PartitionInfoTest.java
index a83e962f..53b5e036 100644
--- a/partition-core/src/test/java/org/opengroup/osdu/partition/model/PartitionInfoTest.java
+++ b/partition-core/src/test/java/org/opengroup/osdu/partition/model/PartitionInfoTest.java
@@ -14,15 +14,18 @@
package org.opengroup.osdu.partition.model;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.mockito.junit.MockitoJUnitRunner;
+import org.junit.jupiter.api.Test;
import java.util.HashMap;
-import static org.junit.Assert.*;
+import static org.junit.jupiter.api.Assertions.*;
+import org.junit.jupiter.api.extension.ExtendWith;
+import org.mockito.junit.jupiter.MockitoExtension;
+import org.mockito.junit.jupiter.MockitoSettings;
+import org.mockito.quality.Strictness;
-@RunWith(MockitoJUnitRunner.class)
+@ExtendWith(MockitoExtension.class)
+@MockitoSettings(strictness = Strictness.LENIENT)
public class PartitionInfoTest {
@Test
diff --git a/partition-core/src/test/java/org/opengroup/osdu/partition/model/PropertyTest.java b/partition-core/src/test/java/org/opengroup/osdu/partition/model/PropertyTest.java
index d6491d4c..08929260 100644
--- a/partition-core/src/test/java/org/opengroup/osdu/partition/model/PropertyTest.java
+++ b/partition-core/src/test/java/org/opengroup/osdu/partition/model/PropertyTest.java
@@ -14,20 +14,20 @@
package org.opengroup.osdu.partition.model;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertNull;
+import static org.junit.jupiter.api.Assertions.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
public class PropertyTest {
@Test
public void defaultSensitive_shouldBeFalse() {
Property property = new Property();
- assertFalse("Default sensitive should be false", property.isSensitive());
- assertNull("Default value should be null", property.getValue());
+ assertFalse(property.isSensitive(), "Default sensitive should be false");
+ assertNull(property.getValue(), "Default value should be null");
}
@Test
diff --git a/partition-core/src/test/java/org/opengroup/osdu/partition/swagger/SwaggerConfigurationTest.java b/partition-core/src/test/java/org/opengroup/osdu/partition/swagger/SwaggerConfigurationTest.java
index c3d0b071..e3585c24 100644
--- a/partition-core/src/test/java/org/opengroup/osdu/partition/swagger/SwaggerConfigurationTest.java
+++ b/partition-core/src/test/java/org/opengroup/osdu/partition/swagger/SwaggerConfigurationTest.java
@@ -14,20 +14,21 @@
package org.opengroup.osdu.partition.swagger;
-import org.junit.Test;
+import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
-import org.junit.runner.RunWith;
import org.mockito.InjectMocks;
import org.mockito.Mock;
-import org.mockito.junit.MockitoJUnitRunner;
import org.mockito.junit.jupiter.MockitoExtension;
+import org.mockito.junit.jupiter.MockitoSettings;
+import org.mockito.quality.Strictness;
import org.springframework.mock.web.MockServletContext;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
+import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.mockito.Mockito.when;
-@RunWith(MockitoJUnitRunner.class)
+@ExtendWith(MockitoExtension.class)
+@MockitoSettings(strictness = Strictness.LENIENT)
public class SwaggerConfigurationTest {
@InjectMocks
diff --git a/pom.xml b/pom.xml
index 3b94a18b..84326143 100644
--- a/pom.xml
+++ b/pom.xml
@@ -24,26 +24,36 @@
17
- 17
- 17
+ ${java.version}
UTF-8
- 5.4.1
+ 7.1.2
- 3.5.12
- 6.5.9
- 6.2.17
- 10.1.54
+ 3.5.16
+ 6.5.11
+ 6.2.19
+ 10.1.57
1.18.42
33.5.0-jre
3.20.0
+ 2.2.45
+
+ 7.5.2.RELEASE
+
+ 4.2.16.Final
+ 2.8.16
+ 2.6.0
8.0.2
+ 3.13.0
+ 3.5.4
+ 3.5.4
+ 0.8.14
@@ -58,11 +68,12 @@
commons-lang3
${commons-lang3.version}
-
@@ -83,6 +94,13 @@
+
+ io.netty
+ netty-bom
+ ${netty.version}
+ pom
+ import
+
org.springframework.boot
spring-boot-dependencies
@@ -106,35 +124,32 @@
-
+
+
+
- org.opengroup.osdu
- os-core-common
- ${os-core-common.version}
- pom
- import
+ io.swagger.core.v3
+ swagger-annotations-jakarta
+ ${swagger-core.version}
+
+
+ io.swagger.core.v3
+ swagger-core-jakarta
+ ${swagger-core.version}
+
+
+ io.swagger.core.v3
+ swagger-models-jakarta
+ ${swagger-core.version}
-
org.opengroup.osdu
os-core-common
${os-core-common.version}
-
-
- org.elasticsearch.client
- elasticsearch-rest-client
-
-
- org.elasticsearch
- elasticsearch
-
-
- org.elasticsearch.client
- elasticsearch-rest-high-level-client
-
-
org.yaml
@@ -149,6 +164,23 @@
guava
${guava.version}
+
+ org.springdoc
+ springdoc-openapi-starter-webmvc-ui
+ ${springdoc.version}
+
+
+ net.minidev
+ json-smart
+ ${json-smart.version}
+
+
+ org.projectlombok
+ lombok
+ ${lombok.version}
+ provided
+ true
+
@@ -158,14 +190,42 @@
org.projectlombok
lombok
- ${lombok.version}
- provided
+
+ org.apache.maven.plugins
+ maven-surefire-plugin
+ ${maven-surefire-plugin.version}
+
+
+ org.apache.maven.plugins
+ maven-failsafe-plugin
+ ${maven-failsafe-plugin.version}
+
+
+ org.jacoco
+ jacoco-maven-plugin
+ ${jacoco-maven-plugin.version}
+
+
+ org.apache.maven.plugins
+ maven-compiler-plugin
+ ${maven-compiler-plugin.version}
+
+ true
+
+
+ org.projectlombok
+ lombok
+ ${lombok.version}
+
+
+
+
org.springframework.boot
spring-boot-maven-plugin
@@ -183,6 +243,55 @@
+
+ org.apache.maven.plugins
+ maven-enforcer-plugin
+ 3.6.2
+
+
+ org.opengroup.osdu
+ osdu-enforcer-rules
+ 1.0.1
+
+
+
+
+ enforce-config-hygiene
+ validate
+
+ enforce
+
+
+
+
+ [3.6.3,)
+
+
+ [17,)
+
+
+
+
+ org.apache.maven.plugins:maven-compiler-plugin
+
+
+
+
+
+
+ enforce-test-execution
+ verify
+
+ enforce
+
+
+
+
+
+
+
+
+
io.github.git-commit-id
git-commit-id-maven-plugin
@@ -266,6 +375,13 @@
+
+
+ ${repo.releases.id}
+ ${repo.releases.url}
+
+
+
${publish.releases.id}
diff --git a/provider/partition-aws/pom.xml b/provider/partition-aws/pom.xml
index 1e137915..37006c5d 100644
--- a/provider/partition-aws/pom.xml
+++ b/provider/partition-aws/pom.xml
@@ -31,27 +31,10 @@
jar
- 17
- 17
- 3.0.0-M4
- 6.2.11
- 4.1.124.Final
- 10.1.48
- 2.5.2
-
- org.springframework
- spring-core
- ${spring-core.version}
-
-
- com.fasterxml.jackson.core
- jackson-databind
- 2.15.2
-
io.netty
netty-handler
@@ -67,16 +50,6 @@
netty-common
${netty.version}
-
- org.apache.tomcat.embed
- tomcat-embed-core
- ${tomcat.version}
-
-
- net.minidev
- json-smart
- ${json-smart.version}
-
@@ -93,6 +66,13 @@
+
+
+ io.lettuce
+ lettuce-core
+ ${lettuce.version}
+
org.opengroup.osdu
partition-core
@@ -109,7 +89,6 @@
org.projectlombok
lombok
- 1.18.26
io.netty
@@ -209,12 +188,10 @@
org.apache.maven.plugins
maven-surefire-plugin
- ${maven_surefire_plugin_version}
org.jacoco
jacoco-maven-plugin
- 0.8.10
diff --git a/provider/partition-aws/src/main/java/org/opengroup/osdu/partition/provider/aws/security/AuthorizationService.java b/provider/partition-aws/src/main/java/org/opengroup/osdu/partition/provider/aws/security/AuthorizationService.java
index 5a165ac1..a02e9c17 100644
--- a/provider/partition-aws/src/main/java/org/opengroup/osdu/partition/provider/aws/security/AuthorizationService.java
+++ b/provider/partition-aws/src/main/java/org/opengroup/osdu/partition/provider/aws/security/AuthorizationService.java
@@ -16,11 +16,8 @@
package org.opengroup.osdu.partition.provider.aws.security;
-import java.text.ParseException;
import java.util.Map;
-import com.nimbusds.jwt.JWTClaimsSet;
-import com.nimbusds.jwt.SignedJWT;
import org.opengroup.osdu.core.aws.v2.entitlements.RequestKeys;
import org.opengroup.osdu.core.aws.v2.ssm.K8sLocalParameterProvider;
import org.opengroup.osdu.core.aws.v2.ssm.K8sParameterNotFoundException;
diff --git a/provider/partition-aws/src/main/resources/application.properties b/provider/partition-aws/src/main/resources/application.properties
index 26cbf65b..6bf6f34e 100644
--- a/provider/partition-aws/src/main/resources/application.properties
+++ b/provider/partition-aws/src/main/resources/application.properties
@@ -16,7 +16,6 @@ server.servlet.contextPath=/api/partition/v1
logging.level.org.springframework.web=${LOG_LEVEL:INFO}
server.port=${APPLICATION_PORT:8080}
spring.data.redis.repositories.enabled=false
-springfox.documentation.swagger.v2.path=/api-docs
ACCEPT_HTTP=true
AUTHORIZE_API=${ENTITLEMENTS_BASE_URL}/api/entitlements/v2
diff --git a/provider/partition-azure/pom.xml b/provider/partition-azure/pom.xml
index 252d2542..5be01e98 100644
--- a/provider/partition-azure/pom.xml
+++ b/provider/partition-azure/pom.xml
@@ -30,17 +30,24 @@
- 2.5.5
+ 2.5.12
3.5.4
0.8.12
- 2.21.1
+ 2.21.2
-
-
+
+ io.netty
+ netty-bom
+ ${netty.version}
+ pom
+ import
+
+
+
com.fasterxml.jackson
jackson-bom
@@ -77,6 +84,16 @@
core-lib-azure
${core-lib-azure.version}
+
+
+ io.lettuce
+ lettuce-core
+ ${lettuce.version}
+
diff --git a/provider/partition-azure/src/main/java/org/opengroup/osdu/partition/provider/azure/di/TableStorageBootstrapConfig.java b/provider/partition-azure/src/main/java/org/opengroup/osdu/partition/provider/azure/di/TableStorageBootstrapConfig.java
index 348350a7..b62805b6 100644
--- a/provider/partition-azure/src/main/java/org/opengroup/osdu/partition/provider/azure/di/TableStorageBootstrapConfig.java
+++ b/provider/partition-azure/src/main/java/org/opengroup/osdu/partition/provider/azure/di/TableStorageBootstrapConfig.java
@@ -19,8 +19,7 @@
import com.azure.data.tables.TableClient;
import com.azure.data.tables.TableServiceClient;
import com.azure.data.tables.TableServiceClientBuilder;
-import com.azure.identity.DefaultAzureCredentialBuilder;
-import com.azure.core.credential.TokenCredential;
+import com.azure.identity.DefaultAzureCredential;
import lombok.Setter;
import org.apache.http.HttpStatus;
@@ -44,7 +43,8 @@ public class TableStorageBootstrapConfig {
@Bean
@Lazy
public TableServiceClient getTableServiceClient(
- final @Named("TABLE_STORAGE_ENDPOINT") String storageAccountEndpoint) {
+ final @Named("TABLE_STORAGE_ENDPOINT") String storageAccountEndpoint,
+ final DefaultAzureCredential defaultAzureCredential) {
try {
Validators.checkNotNullAndNotEmpty(storageAccountEndpoint, "storageAccountEndpoint");
@@ -54,12 +54,10 @@ public TableServiceClient getTableServiceClient(
//cloudTableClient.getDefaultRequestOptions().setMaximumExecutionTimeInMs(maximumExecutionTimeMs);
com.azure.core.http.policy.FixedDelayOptions fixedDelayOptions = new FixedDelayOptions(retryMaxAttempts, Duration.ofMillis(retryDeltaBackoffMs));
RetryOptions retryOptions = new RetryOptions(fixedDelayOptions);
-
- TokenCredential managedIdentityCredential = new DefaultAzureCredentialBuilder().build();
TableServiceClient serviceClient = new TableServiceClientBuilder()
.endpoint(storageAccountEndpoint)
- .credential(managedIdentityCredential)
+ .credential(defaultAzureCredential)
.retryOptions(retryOptions)
.buildClient();
diff --git a/provider/partition-azure/src/main/resources/application.properties b/provider/partition-azure/src/main/resources/application.properties
index d7427514..57c09377 100644
--- a/provider/partition-azure/src/main/resources/application.properties
+++ b/provider/partition-azure/src/main/resources/application.properties
@@ -3,7 +3,6 @@ server.servlet.contextPath=/api/partition/v1
logging.level.org.springframework.web=${partition_spring_logging_level:INFO}
JAVA_OPTS=-Dserver.port=80
server.port=8080
-springfox.documentation.swagger.v2.path=/api-docs
spring.mvc.pathmatch.matching-strategy = ANT_PATH_MATCHER
# Let existing processes complete gracefully before shutting down the application.
diff --git a/provider/partition-azure/src/test/java/org/opengroup/osdu/partition/provider/azure/di/TableStorageBootstrapConfigTest.java b/provider/partition-azure/src/test/java/org/opengroup/osdu/partition/provider/azure/di/TableStorageBootstrapConfigTest.java
index 30b4df48..e7f88399 100644
--- a/provider/partition-azure/src/test/java/org/opengroup/osdu/partition/provider/azure/di/TableStorageBootstrapConfigTest.java
+++ b/provider/partition-azure/src/test/java/org/opengroup/osdu/partition/provider/azure/di/TableStorageBootstrapConfigTest.java
@@ -23,6 +23,7 @@
import org.mockito.junit.jupiter.MockitoExtension;
import com.azure.data.tables.TableServiceClient;
+import com.azure.identity.DefaultAzureCredential;
@ExtendWith(MockitoExtension.class)
class TableStorageBootstrapConfigTest {
@@ -33,14 +34,17 @@ class TableStorageBootstrapConfigTest {
@Mock
private TableServiceClient tableServiceClient;
+ @Mock
+ private DefaultAzureCredential defaultAzureCredential;
+
@Test
void testGetTableServiceClient() {
// Mock the required dependencies
String storageAccountEndpoint = "mock-storage-account-endpoint";
- when(tableStorageBootstrapConfig.getTableServiceClient(storageAccountEndpoint)).thenReturn(tableServiceClient);
+ when(tableStorageBootstrapConfig.getTableServiceClient(storageAccountEndpoint, defaultAzureCredential)).thenReturn(tableServiceClient);
// Call the method under test
- TableServiceClient result = tableStorageBootstrapConfig.getTableServiceClient(storageAccountEndpoint);
+ TableServiceClient result = tableStorageBootstrapConfig.getTableServiceClient(storageAccountEndpoint, defaultAzureCredential);
// Perform assertions
assertNotNull(result);
diff --git a/provider/partition-gc/src/main/resources/application.properties b/provider/partition-gc/src/main/resources/application.properties
index a41d70c2..9262ba48 100644
--- a/provider/partition-gc/src/main/resources/application.properties
+++ b/provider/partition-gc/src/main/resources/application.properties
@@ -18,7 +18,6 @@
#server config
server.servlet.contextPath=/api/partition/v1
server.port=8080
-springfox.documentation.swagger.v2.path=/api-docs
management.endpoint.health.show-details=always
management.health.diskspace.enabled=false
ACCEPT_HTTP=true
diff --git a/provider/partition-ibm/pom.xml b/provider/partition-ibm/pom.xml
index 1ed1215c..1c4486e5 100644
--- a/provider/partition-ibm/pom.xml
+++ b/provider/partition-ibm/pom.xml
@@ -187,7 +187,6 @@
net.minidev
json-smart
- 2.5.2
diff --git a/provider/partition-ibm/src/main/resources/application.properties b/provider/partition-ibm/src/main/resources/application.properties
index cd94f425..105be605 100644
--- a/provider/partition-ibm/src/main/resources/application.properties
+++ b/provider/partition-ibm/src/main/resources/application.properties
@@ -1,7 +1,6 @@
LOG_PREFIX=partition
server.servlet.contextPath=/api/partition/v1
server.port=8090
-springfox.documentation.swagger.v2.path=/api-docs
AUTHORIZE_API=TODO
#ACCEPT_HTTP=true
diff --git a/testing/.mvn/community-maven.settings.xml b/testing/.mvn/community-maven.settings.xml
deleted file mode 100644
index 6c83ff4b..00000000
--- a/testing/.mvn/community-maven.settings.xml
+++ /dev/null
@@ -1,83 +0,0 @@
-
-
-
-
- GitLab-Authenticate-With-Job-Token
-
- true
-
-
- community-maven-repo
- community-maven-via-job-token
- community-maven-via-job-token
-
- https://community.opengroup.org/api/v4/groups/17/-/packages/maven
- https://community.opengroup.org/api/v4/projects/221/packages/maven
-
- https://community.opengroup.org/api/v4/projects/221/packages/maven
-
-
-
-
-
-
- GitLab-Authenticate-With-Private-Token
-
-
- env.COMMUNITY_MAVEN_TOKEN
-
-
-
- community-maven-repo
- community-maven-via-private-token
- community-maven-via-private-token
-
- https://community.opengroup.org/api/v4/groups/17/-/packages/maven
- https://community.opengroup.org/api/v4/projects/221/packages/maven
-
- https://community.opengroup.org/api/v4/projects/221/packages/maven
-
-
-
-
-
-
-
- community-maven-via-job-token
-
-
-
- Job-Token
- ${env.CI_JOB_TOKEN}
-
-
-
-
-
-
- community-maven-via-private-token
-
-
-
- Private-Token
- ${env.COMMUNITY_MAVEN_TOKEN}
-
-
-
-
-
-
- azure-auth
-
- ${env.AZURE_TENANT_ID}
- ${env.AZURE_CLIENT_ID}
- ${env.AZURE_CLIENT_SECRET}
- AZURE
-
-
-
-
-
-
diff --git a/testing/partition-test-baremetal/pom.xml b/testing/partition-test-baremetal/pom.xml
index 16009681..1e269d38 100644
--- a/testing/partition-test-baremetal/pom.xml
+++ b/testing/partition-test-baremetal/pom.xml
@@ -32,9 +32,6 @@
jar
- 17
- 17
- 17
UTF-8
@@ -52,7 +49,6 @@
org.projectlombok
lombok
- 1.18.24
org.slf4j
diff --git a/testing/pom.xml b/testing/pom.xml
index 2a8ea0dc..2d1bd6fb 100644
--- a/testing/pom.xml
+++ b/testing/pom.xml
@@ -24,22 +24,27 @@
17
- 17
- 17
+ ${java.version}
UTF-8
-
-
- 1.18.38
+
+
+ 7.1.0
+ 1.18.42
-
+
+ org.opengroup.osdu
+ os-core-common
+ ${os-core-common.version}
+
org.projectlombok
lombok
${lombok.version}
provided
+ true
@@ -51,6 +56,60 @@
repo
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-compiler-plugin
+ 3.13.0
+
+
+
+ org.projectlombok
+ lombok
+ ${lombok.version}
+
+
+
+
+
+
+
+
+ org.apache.maven.plugins
+ maven-enforcer-plugin
+ 3.6.2
+
+
+ enforce-config-hygiene
+ validate
+
+ enforce
+
+
+
+
+ [3.6.3,)
+
+
+ [17,)
+
+
+
+
+ org.apache.maven.plugins:maven-compiler-plugin
+
+
+
+
+
+
+
+
+
+
partition-test-core
partition-test-azure
@@ -103,7 +162,7 @@
https://community.opengroup.org/api/v4/groups/17/-/packages/maven
https://community.opengroup.org/api/v4/projects/221/packages/maven
https://community.opengroup.org/api/v4/projects/221/packages/maven
- 3.0.0-M4
+ 3.5.4