Skip to content

Commit 7c0f952

Browse files
authored
Merge pull request #13 from oracle/topic_jjyoti_sync
Updating with latest code
2 parents af9d368 + b9bdf4a commit 7c0f952

File tree

19 files changed

+153
-280
lines changed

19 files changed

+153
-280
lines changed

README.md

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,22 @@ Spring Cloud for OCI, eases the integration with OCI services with the help of O
1313

1414
All Spring Cloud for OCI artifacts are made available through Maven Central. Developers can bootstrap their application with Spring Initializr and add the OCI Support dependency. With Spring Cloud for OCI, the developers only need to add some annotations and a small number of configurations to connect Spring Cloud applications to the OCI services.
1515

16+
## Spring Cloud OCI documentation
17+
18+
For a deep dive into the project, refer to the Spring Cloud OCI documentation:
19+
20+
| Version | Reference Docs | API Docs |
21+
|------------------------|---------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------|
22+
| Spring Cloud OCI 1.0.0 | [Reference Docs](https://oracle.github.io/spring-cloud-oci/1.0.0/reference/html/index.html) | [API Docs](https://oracle.github.io/spring-cloud-oci/1.0.0/javadocs/index.html) |
23+
24+
1625
## Compatibility with Spring Project Versions
1726

1827
This project has dependency and transitive dependencies on Spring Projects. The table below outlines the versions of Spring Cloud, Spring Boot and Spring Framework versions that are compatible with certain Spring Cloud OCI version.
1928

20-
| Spring Cloud OCI | Spring Cloud | Spring Boot | Spring Framework | OCI Java SDK |
21-
|-------------------|-----------------|---------------------|------------------|--------------|
22-
| 1.0.0 | <to-be-checked> | 2.7.x, 3.0.x, 3.1.x | 5.3.23 | 3.19.0 |
29+
| Spring Cloud OCI | Spring Cloud | Spring Boot | OCI Java SDK |
30+
|-------------------|-----------------|---------------------|--------------|
31+
| 1.0.0 | <to-be-checked> | 2.7.x, 3.0.x, 3.1.x | 3.19.0 |
2332

2433

2534
## Try out samples

pom.xml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ Licensed under the Universal Permissive License v 1.0 as shown at https://oss.or
3333
</modules>
3434
<properties>
3535
<!-- spring-cloud-dependencies.version>2022.0.1</spring-cloud-dependencies.version -->
36-
<spring-framework.version>5.3.23</spring-framework.version>
3736
<spring-boot-dependencies.version>2.7.4</spring-boot-dependencies.version>
3837
<oci-sdk.version>3.19.0</oci-sdk.version>
3938
<tomcat.version>8.0.33</tomcat.version>
@@ -140,13 +139,6 @@ Licensed under the Universal Permissive License v 1.0 as shown at https://oss.or
140139
<type>pom</type>
141140
<scope>import</scope>
142141
</dependency>
143-
<dependency>
144-
<groupId>org.springframework</groupId>
145-
<artifactId>spring-framework-bom</artifactId>
146-
<version>${spring-framework.version}</version>
147-
<type>pom</type>
148-
<scope>import</scope>
149-
</dependency>
150142
<dependency>
151143
<groupId>org.springframework.boot</groupId>
152144
<artifactId>spring-boot-dependencies</artifactId>

spring-cloud-oci-logging/src/main/java/com/oracle/cloud/spring/logging/LoggingSvc.java

Lines changed: 0 additions & 28 deletions
This file was deleted.

spring-cloud-oci-samples/spring-cloud-oci-common-sample/pom.xml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@ Licensed under the Universal Permissive License v 1.0 as shown at https://oss.or
2828
<java.version>17</java.version>
2929
</properties>
3030
<dependencies>
31+
<dependency>
32+
<groupId>org.springframework.boot</groupId>
33+
<artifactId>spring-boot-starter-test</artifactId>
34+
<scope>test</scope>
35+
</dependency>
3136
</dependencies>
3237

3338
<build>
@@ -36,6 +41,23 @@ Licensed under the Universal Permissive License v 1.0 as shown at https://oss.or
3641
<groupId>org.springframework.boot</groupId>
3742
<artifactId>spring-boot-maven-plugin</artifactId>
3843
</plugin>
44+
<plugin>
45+
<groupId>org.apache.maven.plugins</groupId>
46+
<artifactId>maven-jar-plugin</artifactId>
47+
<version>3.3.0</version>
48+
<executions>
49+
<execution>
50+
<id>Jar-Tests-Package</id>
51+
<phase>package</phase>
52+
<goals>
53+
<goal>test-jar</goal>
54+
</goals>
55+
<configuration>
56+
<classifier>tests</classifier>
57+
</configuration>
58+
</execution>
59+
</executions>
60+
</plugin>
3961
</plugins>
4062
</build>
4163
<dependencyManagement>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
/*
2+
** Copyright (c) 2023, Oracle and/or its affiliates.
3+
** Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/
4+
*/
5+
6+
package com.oracle.cloud.spring.sample.common.base;
7+
8+
9+
10+
import com.oracle.cloud.spring.sample.common.util.FileUtils;
11+
import org.junit.jupiter.api.AfterAll;
12+
import org.junit.jupiter.api.BeforeAll;
13+
14+
import java.io.File;
15+
16+
/**
17+
* Base class to be extended by Spring boot test classes
18+
*/
19+
20+
public class SpringCloudSampleApplicationTestBase {
21+
22+
public static final String PRIVATE_KEY_PATH = "privateKey";
23+
public static final String PRIVATE_KEY_CONTENT = "privateKeyContent";
24+
public static final String privateKeyFilePath = System.getProperty("user.home") + File.separator + "privatekey.pem";
25+
public static final String privateKeyContent = System.getProperty(PRIVATE_KEY_CONTENT) != null ? System.getProperty(PRIVATE_KEY_CONTENT) :
26+
System.getenv().get(PRIVATE_KEY_CONTENT);
27+
@BeforeAll
28+
static void beforeAll() throws Exception {
29+
System.setProperty(PRIVATE_KEY_PATH, privateKeyFilePath);
30+
FileUtils.createFile(privateKeyFilePath, privateKeyContent.replace("\\n", "\n"));
31+
}
32+
33+
@AfterAll
34+
static void AfterAll() {
35+
FileUtils.deleteFile(privateKeyFilePath);
36+
}
37+
}

spring-cloud-oci-samples/spring-cloud-oci-logging-sample/pom.xml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,13 @@ Licensed under the Universal Permissive License v 1.0 as shown at https://oss.or
4545
<artifactId>spring-cloud-oci-common-sample</artifactId>
4646
<version>${project.version}</version>
4747
</dependency>
48+
<dependency>
49+
<groupId>com.oracle.cloud.spring.sample.common</groupId>
50+
<artifactId>spring-cloud-oci-common-sample</artifactId>
51+
<version>${project.version}</version>
52+
<type>test-jar</type>
53+
<scope>test</scope>
54+
</dependency>
4855
<dependency>
4956
<groupId>org.springdoc</groupId>
5057
<artifactId>springdoc-openapi-ui</artifactId>
@@ -58,6 +65,7 @@ Licensed under the Universal Permissive License v 1.0 as shown at https://oss.or
5865
<groupId>org.springframework.boot</groupId>
5966
<artifactId>spring-boot-maven-plugin</artifactId>
6067
</plugin>
68+
6169
</plugins>
6270
</build>
6371
<dependencyManagement>

spring-cloud-oci-samples/spring-cloud-oci-logging-sample/src/main/java/com/oracle/cloud/spring/logging/springcloudociloggingsample/HelloController.java

Lines changed: 0 additions & 22 deletions
This file was deleted.

spring-cloud-oci-samples/spring-cloud-oci-logging-sample/src/main/java/com/oracle/cloud/spring/logging/springcloudociloggingsample/LoggingController.java

Lines changed: 0 additions & 30 deletions
This file was deleted.

spring-cloud-oci-samples/spring-cloud-oci-logging-sample/src/main/java/com/oracle/cloud/spring/logging/springcloudociloggingsample/SpringCloudOciLoggingSampleApplication.java

Lines changed: 0 additions & 18 deletions
This file was deleted.

spring-cloud-oci-samples/spring-cloud-oci-logging-sample/src/test/java/com/oracle/cloud/spring/sample/logging/springcloudociloggingsample/SpringCloudOciLoggingSampleApplicationTests.java

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,14 @@
88
import com.oracle.bmc.loggingingestion.responses.PutLogsResponse;
99

1010
import com.oracle.cloud.spring.logging.Logging;
11-
import com.oracle.cloud.spring.sample.common.util.FileUtils;
12-
import org.junit.jupiter.api.AfterAll;
13-
import org.junit.jupiter.api.BeforeAll;
11+
import com.oracle.cloud.spring.sample.common.base.SpringCloudSampleApplicationTestBase;
1412
import org.junit.jupiter.api.Test;
1513
import org.junit.jupiter.api.condition.EnabledIfSystemProperty;
1614
import org.springframework.beans.factory.annotation.Autowired;
1715
import org.springframework.boot.test.context.SpringBootTest;
1816
import org.springframework.test.context.TestPropertySource;
1917
import org.springframework.util.Assert;
2018

21-
import java.io.File;
2219

2320
/**
2421
* Environment variables needed to run this tests are :
@@ -28,31 +25,14 @@
2825
@SpringBootTest
2926
@EnabledIfSystemProperty(named = "it.logging", matches = "true")
3027
@TestPropertySource(locations="classpath:application-test.properties")
31-
class SpringCloudOciLoggingSampleApplicationTests {
32-
33-
public static final String PRIVATE_KEY_PATH = "privateKey";
34-
public static final String PRIVATE_KEY_CONTENT = "privateKeyContent";
35-
public static final String privateKeyFilePath = System.getProperty("user.home") + File.separator + "privatekey.pem";
36-
public static final String privateKeyContent = System.getProperty(PRIVATE_KEY_CONTENT) != null ? System.getProperty(PRIVATE_KEY_CONTENT) :
37-
System.getenv().get(PRIVATE_KEY_CONTENT);
38-
@BeforeAll
39-
static void beforeAll() throws Exception {
40-
System.setProperty(PRIVATE_KEY_PATH, privateKeyFilePath);
41-
FileUtils.createFile(privateKeyFilePath, privateKeyContent.replace("\\n", "\n"));
42-
}
43-
28+
class SpringCloudOciLoggingSampleApplicationTests extends SpringCloudSampleApplicationTestBase {
4429
@Autowired
4530
Logging logging;
4631

4732
@Test
4833
void testLoggingApis() {
49-
5034
PutLogsResponse response = logging.putLogs("error starting logging application");
5135
Assert.notNull(response.getOpcRequestId());
5236
}
5337

54-
@AfterAll
55-
static void AfterAll() {
56-
FileUtils.deleteFile(privateKeyFilePath);
57-
}
5838
}

0 commit comments

Comments
 (0)