I hereby claim:
- I am iainporter on github.
- I am iainporter (https://keybase.io/iainporter) on keybase.
- I have a public key ASBCfqAgkL0wIg_8Ie67iP7HipExA_IaNYtANpD4jeAuhwo
To claim this, I am signing this object:
import org.junit.Test; | |
import org.junit.runner.RunWith; | |
import org.springframework.beans.factory.annotation.Autowired; | |
import org.springframework.beans.factory.annotation.Qualifier; | |
import org.springframework.context.annotation.Bean; | |
import org.springframework.context.annotation.Configuration; | |
import org.springframework.integration.annotation.Transformer; | |
import org.springframework.integration.channel.QueueChannel; | |
import org.springframework.integration.config.EnableIntegration; |
import org.junit.Test; | |
import org.junit.runner.RunWith; | |
import org.springframework.beans.factory.annotation.Autowired; | |
import org.springframework.beans.factory.annotation.Qualifier; | |
import org.springframework.context.annotation.Bean; | |
import org.springframework.context.annotation.Configuration; | |
import org.springframework.integration.annotation.Transformer; | |
import org.springframework.integration.channel.QueueChannel; | |
import org.springframework.integration.config.EnableIntegration; |
I hereby claim:
To claim this, I am signing this object:
<?xml version="1.0" encoding="UTF-8"?> | |
<project xmlns="http://maven.apache.org/POM/4.0.0" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | |
<modelVersion>4.0.0</modelVersion> | |
<parent> | |
<groupId>com.porterhead</groupId> | |
<artifactId>sms-service-parent</artifactId> |
@Path("/v1/sms") | |
@Produces(MediaType.APPLICATION_JSON) | |
@Consumes(MediaType.APPLICATION_JSON) | |
class SmsResource { | |
@Inject | |
@field: Default | |
lateinit var smsService: SmsService | |
@POST |
@ApplicationScoped | |
class DefaultSmsService: SmsService { | |
companion object { | |
val DEFAULT_SORT: Sort = Sort.by("updatedAt").descending() | |
} | |
@Inject | |
lateinit var messageRepository: MessageRepository |
version: '3' | |
services: | |
postgres-db: | |
image: postgres:11 | |
environment: | |
- POSTGRES_USER=postgres | |
- POSTGRES_PASSWORD=postgres | |
- POSTGRES_DB=sms | |
sms-service: | |
image: porterhead/sms-service |
abstract class TestEnvironment { | |
@Before | |
fun setup() { | |
val port = env.getServicePort("sms-service_1", 8080) | |
RestAssured.baseURI = "http://localhost:$port" | |
} | |
companion object { |
class SendMessageTest : TestEnvironment() { | |
@Test | |
fun `a valid request to send a SMS Message`() { | |
//send a message | |
val request = """{"text":"Foo Bar", "fromNumber":"+1234567890", "toNumber":"+1234567899"}""" | |
val response = RestFunctions.sendSmsMessage(request) | |
val location = response.header("Location") | |
//check the message can be retrieved | |
val messageResponse = RestFunctions.getMessage(location) |
CREATE TABLE outboxevent | |
( | |
id uuid PRIMARY KEY, | |
aggregatetype VARCHAR(75), | |
aggregateid VARCHAR(50) NOT NULL, | |
type VARCHAR(50) NOT NULL, | |
timestamp TIMESTAMP NOT NULL, | |
payload varchar(4096) NOT NULL | |
); |