use javax
continuous-integration/drone/push Build is passing Details

This commit is contained in:
Torma Kristóf 2020-05-21 23:28:57 +02:00
parent 7594fa6753
commit 922d22c07d
Signed by: tormakris
GPG Key ID: DC83C4F2C41B1047
4 changed files with 23 additions and 3 deletions

3
.gitignore vendored
View File

@ -5,4 +5,5 @@
*.iml
*.ipr
*.iws
*.log
*.log
*.wav

View File

@ -47,6 +47,7 @@ dependencies {
compile 'com.rabbitmq:amqp-client:2.7.1'
compile 'com.zaxxer:HikariCP:2.7.8'
compile 'com.viartemev:the-white-rabbit:0.0.5'
compile 'com.sun.activation:javax.activation:1.2.0'
implementation "org.koin:koin-ktor:$koin_version"
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
implementation "io.ktor:ktor-server-netty:$ktor_version"
@ -58,7 +59,6 @@ dependencies {
implementation "io.ktor:ktor-client-core-jvm:$ktor_version"
implementation "io.ktor:ktor-client-apache:$ktor_version"
implementation "io.ktor:ktor-auth:$ktor_version"
implementation 'jakarta.activation:jakarta.activation-api:1.2.2'
testImplementation "io.ktor:ktor-server-tests:$ktor_version"
}

View File

@ -29,7 +29,7 @@ services:
MQ_PASSWORD: rabbitmq
depends_on:
- rabbitmq
- output-service-postgres
- input-service-postgres
rabbitmq:
image: "rabbitmq:3-management"

19
test.py Normal file
View File

@ -0,0 +1,19 @@
#!/usr/bin/env python3
import requests
import os.path
import json
from datetime import datetime
URL = "http://127.0.0.1:8080/sample"
FILE = 'CommonStarling_102761_45.wav'
files = {
"file": (os.path.basename(FILE), open(FILE,'rb').read(), 'audio/wave', {'Content-length' : os.path.getsize(FILE)}),
"description" : (None, json.dumps({'date' : datetime.now().isoformat(), 'device_id' : '123'}), "application/json")
}
r = requests.post(URL,files=files)
print("Content: ", r.content)
print("Headers:", r.headers)
r.raise_for_status()