-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: init intergratio test for hello controller
- Loading branch information
Showing
12 changed files
with
135 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
*.java | ||
test_data/**/build/** | ||
!test_data/**/*.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 @@ | ||
#[cfg(test)] | ||
mod tests { | ||
use std::path::PathBuf; | ||
use crate::code_gen_exec; | ||
|
||
#[test] | ||
fn test_java_package_to_path() { | ||
let d: PathBuf = PathBuf::from(env!("CARGO_MANIFEST_DIR")); | ||
let base_path = d.clone(); | ||
|
||
let mut input_path = d.clone(); | ||
input_path.push(format!("test_data/spring/spring.fkl")); | ||
|
||
code_gen_exec::code_gen_exec(Some(&input_path), Some(&"HelloGot".to_string()), &base_path); | ||
} | ||
} |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
plugins { | ||
id 'org.springframework.boot' version '3.0.0-SNAPSHOT' | ||
id 'io.spring.dependency-management' version '1.0.14.RELEASE' | ||
id 'java' | ||
} | ||
|
||
group = 'com.feakin' | ||
version = '0.0.1-SNAPSHOT' | ||
sourceCompatibility = '17' | ||
|
||
repositories { | ||
mavenCentral() | ||
maven { url 'https://repo.spring.io/milestone' } | ||
maven { url 'https://repo.spring.io/snapshot' } | ||
} | ||
|
||
dependencies { | ||
implementation 'org.springframework.boot:spring-boot-starter' | ||
testImplementation 'org.springframework.boot:spring-boot-starter-test' | ||
} | ||
|
||
tasks.named('test') { | ||
useJUnitPlatform() | ||
} |
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 @@ | ||
pluginManagement { | ||
repositories { | ||
maven { url 'https://repo.spring.io/milestone' } | ||
maven { url 'https://repo.spring.io/snapshot' } | ||
gradlePluginPortal() | ||
} | ||
} | ||
rootProject.name = 'demo' |
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,28 @@ | ||
impl HelloGot { | ||
endpoint { | ||
GET "/hello"; | ||
response: String; | ||
} | ||
} | ||
|
||
layered DDD { | ||
dependency { | ||
"interface" -> "application" | ||
"interface" -> "domain" | ||
"domain" -> "application" | ||
"application" -> "infrastructure" | ||
"interface" -> "infrastructure" | ||
} | ||
layer interface { | ||
package: "com.feakin.demo.interface"; | ||
} | ||
layer domain { | ||
package: "com.feakin.demo.domain"; | ||
} | ||
layer application { | ||
package: "com.feakin.demo.application"; | ||
} | ||
layer infrastructure { | ||
package: "com.feakin.demo.infrastructure"; | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
fkl_cli/test_data/spring/src/main/java/com/feakin/demo/DemoApplication.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,13 @@ | ||
package com.feakin.demo; | ||
|
||
import org.springframework.boot.SpringApplication; | ||
import org.springframework.boot.autoconfigure.SpringBootApplication; | ||
|
||
@SpringBootApplication | ||
public class DemoApplication { | ||
|
||
public static void main(String[] args) { | ||
SpringApplication.run(DemoApplication.class, args); | ||
} | ||
|
||
} |
14 changes: 14 additions & 0 deletions
14
fkl_cli/test_data/spring/src/main/java/com/feakin/demo/interface/HelloController.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,14 @@ | ||
package com.feakin.demo.interface; | ||
|
||
import org.springframework.web.bind.annotation.GetMapping; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
@RestController | ||
public class HelloController { | ||
|
||
@GetMapping("/") | ||
public String index() { | ||
return "Greetings from Spring Boot!"; | ||
} | ||
|
||
} |
1 change: 1 addition & 0 deletions
1
fkl_cli/test_data/spring/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 |
---|---|---|
@@ -0,0 +1 @@ | ||
|
13 changes: 13 additions & 0 deletions
13
fkl_cli/test_data/spring/src/test/java/com/feakin/demo/DemoApplicationTests.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,13 @@ | ||
package com.feakin.demo; | ||
|
||
import org.junit.jupiter.api.Test; | ||
import org.springframework.boot.test.context.SpringBootTest; | ||
|
||
@SpringBootTest | ||
class DemoApplicationTests { | ||
|
||
@Test | ||
void contextLoads() { | ||
} | ||
|
||
} |