-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
pz2
committed
Feb 19, 2024
1 parent
8b4645a
commit e8cb116
Showing
7 changed files
with
108 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
hofund-spring-boot-e2e/src/main/java/dev/logchange/hofund/TestController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package dev.logchange.hofund; | ||
|
||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.web.bind.annotation.GetMapping; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
@RestController | ||
@RequiredArgsConstructor | ||
public class TestController { | ||
|
||
// private final TestRepository testRepository; | ||
|
||
@GetMapping("/test") | ||
public String test() { | ||
return "test"; | ||
} | ||
|
||
// @GetMapping("/testEntity") | ||
// public Iterable<TestEntity> testEntity() { | ||
// return testRepository.findAll(); | ||
// } | ||
} |
16 changes: 16 additions & 0 deletions
16
hofund-spring-boot-e2e/src/main/java/dev/logchange/hofund/TestEntity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
//package dev.logchange.hofund; | ||
// | ||
//import jakarta.persistence.Entity; | ||
//import jakarta.persistence.Id; | ||
//import lombok.Getter; | ||
//import lombok.Setter; | ||
// | ||
//@Getter | ||
//@Setter | ||
//@Entity | ||
//public class TestEntity { | ||
// | ||
// @Id | ||
// private Long id; | ||
// | ||
//} |
8 changes: 8 additions & 0 deletions
8
hofund-spring-boot-e2e/src/main/java/dev/logchange/hofund/TestRepository.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
//package dev.logchange.hofund; | ||
// | ||
//import org.springframework.data.repository.CrudRepository; | ||
//import org.springframework.stereotype.Repository; | ||
// | ||
//@Repository | ||
//public interface TestRepository extends CrudRepository<TestEntity, Long> { | ||
//} |
9 changes: 9 additions & 0 deletions
9
hofund-spring-boot-e2e/src/main/resources/application.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,11 @@ | ||
server.port=8626 | ||
management.endpoints.web.exposure.include=prometheus | ||
|
||
#spring.jpa.hibernate.ddl-auto=none | ||
|
||
#spring.datasource.url=jdbc:oracle:thin:@localhost:1521:xe | ||
#spring.datasource.username=maindb | ||
#spring.datasource.password=password | ||
#spring.datasource.driver-class-name=oracle.jdbc.OracleDriver | ||
# | ||
#spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.OracleDialect |
42 changes: 42 additions & 0 deletions
42
...va/dev/logchange/hofund/connection/spring/datasources/oracle/OracleDataSourceE2ETest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
//package dev.logchange.hofund.connection.spring.datasources.oracle; | ||
// | ||
//import lombok.extern.slf4j.Slf4j; | ||
//import org.junit.jupiter.api.Assertions; | ||
//import org.junit.jupiter.api.Test; | ||
//import org.springframework.boot.test.autoconfigure.actuate.observability.AutoConfigureObservability; | ||
//import org.springframework.boot.test.context.SpringBootTest; | ||
//import org.springframework.boot.test.web.client.TestRestTemplate; | ||
//import org.springframework.boot.test.web.server.LocalServerPort; | ||
// | ||
//@Slf4j | ||
//@AutoConfigureObservability | ||
//@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.RANDOM_PORT, | ||
// properties = { | ||
// "spring.datasource.url=jdbc:oracle:thin:@localhost:1521:xe", | ||
// "spring.datasource.username=system", | ||
// "spring.datasource.password=password", | ||
// "spring.datasource.driver-class-name=oracle.jdbc.OracleDriver" | ||
// }) | ||
//public class OracleDataSourceE2ETest { | ||
// private final TestRestTemplate template = new TestRestTemplate(); | ||
// | ||
// @LocalServerPort | ||
// private int port; | ||
// | ||
// @Test | ||
// void shouldContainsHofundConnectionForOracleDatabase() { | ||
// //given: | ||
// String path = "http://localhost:" + port + "/actuator/prometheus"; | ||
// | ||
// String expected = "# HELP hofund_info Basic information about application\n" + | ||
// "# TYPE hofund_info gauge\n" + | ||
// "hofund_info{application_name=\"testapp\",application_version=\"1.2.3\",id=\"testapp\",} 1.0"; | ||
// | ||
// //when: | ||
// String response = template.getForObject(path, String.class); | ||
// | ||
// //then: | ||
// log.info("Expecting: \n{}\nResponse: \n{}", expected, response); | ||
// Assertions.assertTrue(response.contains(expected)); | ||
// } | ||
//} |