Skip to content

Commit d6b9e2a

Browse files
roseckyjmini
authored andcommitted
Initial version on GitHub
1 parent ae78313 commit d6b9e2a

File tree

13 files changed

+621
-0
lines changed

13 files changed

+621
-0
lines changed

.github/workflows/ci.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: CI
2+
on: [push, pull_request]
3+
4+
jobs:
5+
build:
6+
runs-on: ubuntu-latest
7+
steps:
8+
- uses: actions/checkout@v2
9+
- name: Set up JDK
10+
uses: actions/setup-java@v3
11+
with:
12+
java-version: |
13+
21
14+
distribution: 'temurin'
15+
- name: print Java version
16+
run: java -version
17+
- name: Build
18+
run: ./gradlew clean build
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: "Validate Gradle Wrapper"
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
jobs:
8+
validation:
9+
name: "Gradle wrapper validation"
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v4
13+
- uses: gradle/actions/wrapper-validation@v4

.gitignore

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
.gradle
2+
build/
3+
!gradle/wrapper/gradle-wrapper.jar
4+
!**/src/main/**/build/
5+
!**/src/test/**/build/
6+
7+
### IntelliJ IDEA ###
8+
.idea/
9+
*.iws
10+
*.iml
11+
*.ipr
12+
out/
13+
!**/src/main/**/out/
14+
!**/src/test/**/out/
15+
16+
### Eclipse ###
17+
.apt_generated
18+
.classpath
19+
.factorypath
20+
.project
21+
.settings
22+
.springBeans
23+
.sts4-cache
24+
bin/
25+
!**/src/main/**/bin/
26+
!**/src/test/**/bin/
27+
28+
### NetBeans ###
29+
/nbproject/private/
30+
/nbbuild/
31+
/dist/
32+
/nbdist/
33+
/.nb-gradle/
34+
35+
### VS Code ###
36+
.vscode/
37+
38+
### Mac OS ###
39+
.DS_Store
40+
41+
# Local secret configs
42+
.env
43+
.env.*
44+
*.secret.*
45+
application-secrets.yaml
46+
application-local.yaml
47+
application-dev.yaml

Readme.adoc

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
= Test middleware
2+
3+
This is a demo middleware designed to demonstrate the capabilities of the https://github.com/unblu/unblu-middleware-lib[unblu middleware library].
4+
5+
It:
6+
7+
- Automatically creates a bot registration
8+
- Automatically creates a webhook registration
9+
- Correctly handles all webhooks and pings (lib handles that)
10+
- Correctly handles all bot outbound requests and pings (lib handles that)
11+
- Accepts all visitor onboarding offers
12+
- Greets a visitor when the dialog is open
13+
- Echos all visitor messages
14+
- Logs all messages, not just in a bot dialog (the webhook handler is set up to do so)

build.gradle

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
plugins {
2+
id 'java'
3+
id 'application'
4+
id 'org.springframework.boot' version '3.4.4'
5+
id 'io.spring.dependency-management' version '1.1.6'
6+
id 'com.google.cloud.tools.jib' version '3.4.4'
7+
}
8+
9+
mainClassName = 'com.unblu.middleware.test.App'
10+
group 'com.unblu'
11+
version '1.0.0-SNAPSHOT'
12+
13+
wrapper {
14+
gradleVersion = '8.13'
15+
}
16+
17+
java {
18+
toolchain {
19+
languageVersion = JavaLanguageVersion.of(21)
20+
}
21+
}
22+
23+
repositories {
24+
mavenCentral()
25+
}
26+
27+
wrapper {
28+
distributionType = Wrapper.DistributionType.ALL
29+
gradleVersion = '8.13'
30+
}
31+
32+
dependencies {
33+
implementation 'org.springframework.boot:spring-boot-starter-actuator'
34+
implementation 'org.springframework.boot:spring-boot-starter-webflux'
35+
implementation 'org.springframework:spring-messaging'
36+
implementation 'io.micrometer:context-propagation'
37+
implementation 'org.projectlombok:lombok:1.18.34'
38+
implementation 'com.google.guava:guava:32.1.2-jre'
39+
implementation 'com.unblu.middleware:unblu-middleware-lib:1.5.1'
40+
41+
annotationProcessor "org.springframework.boot:spring-boot-configuration-processor"
42+
43+
implementation 'net.logstash.logback:logstash-logback-encoder:7.4'
44+
45+
implementation 'com.unblu.openapi:jersey3-client-v4:8.18.0'
46+
47+
compileOnly 'org.projectlombok:lombok:1.18.34'
48+
annotationProcessor 'org.projectlombok:lombok:1.18.34'
49+
50+
// various
51+
implementation 'commons-codec:commons-codec'
52+
implementation 'io.projectreactor.addons:reactor-extra'
53+
54+
// (unit) testing
55+
testImplementation 'org.springframework.boot:spring-boot-starter-test'
56+
testImplementation 'io.projectreactor:reactor-test'
57+
58+
testImplementation 'org.junit.jupiter:junit-jupiter-api'
59+
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine'
60+
testAnnotationProcessor "org.projectlombok:lombok:1.18.34"
61+
}
62+
63+
test {
64+
// use this to see the output of tests (e.g. Spring dependency problems)
65+
// testLogging.showStandardStreams = true
66+
}
67+
68+
tasks.named('test') {
69+
useJUnitPlatform()
70+
}
71+
72+
tasks.named('bootRun') {
73+
if (project.hasProperty('spring.profiles.active')) {
74+
systemProperties = ['spring.profiles.active': project.getProperty('spring.profiles.active')]
75+
} else {
76+
systemProperties = ['spring.profiles.active': 'dev'] // Set default to 'dev'
77+
}
78+
}
79+
80+

gradle/wrapper/gradle-wrapper.jar

42.7 KB
Binary file not shown.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
distributionBase=GRADLE_USER_HOME
2+
distributionPath=wrapper/dists
3+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-all.zip
4+
networkTimeout=10000
5+
validateDistributionUrl=true
6+
zipStoreBase=GRADLE_USER_HOME
7+
zipStorePath=wrapper/dists

0 commit comments

Comments
 (0)