Skip to content

Instantly share code, notes, and snippets.

View kevholditch's full-sized avatar
💭
Eat sleep code repeat

Kevin Holditch kevholditch

💭
Eat sleep code repeat
View GitHub Profile
func Test_ApisGetById(t *testing.T) {
apiRequest := &ApiRequest{
Name: "test-" + uuid.NewV4().String(),
Hosts: []string{"example.com"},
Uris: []string{"/example"},
Methods: []string{"GET", "POST"},
UpstreamUrl: "http://localhost:4140/testservice",
StripUri: true,
PreserveHost: true,
Retries: 3,
func TestMain(m *testing.M) {
testContext := containers.StartKong(GetEnvVarOrDefault("KONG_VERSION", defaultKongVersion))
err := os.Setenv(EnvKongAdminHostAddress, testContext.KongHostAddress)
if err != nil {
log.Fatalf("Could not set kong host address env variable: %v", err)
}
code := m.Run()
func TestMain(m *testing.M) {
// setup
code := m.Run()
// teardown
os.Exit(code)
aws sqs receive-message --queue-url http://localhost:9324/queue/queue1 --region elasticmq --endpoint-url http://localhost:9324 --no-verify-ssl --no-sign-request --attribute-names All --message-attribute-names All
services:
sns:
image: s12v/sns
ports:
- "9911:9911"
volumes:
- ./config/db.json:/etc/sns/db.json
depends_on:
- sqs
sqs:
include classpath("application.conf")
node-address {
host = sqs
}
queues {
queue1 {}
}
TRACE o.a.c.component.aws.sqs.SqsEndpoint - Queue available at 'http://localhost:9324/queue/queue1'.
services:
sns:
build: ../
ports:
- "9911:9911"
volumes:
- ./config:/etc/sns
depends_on:
- sqs
sqs:
<configuration>
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
</encoder>
</appender>
<logger name="org.apache.camel" level="INFO"/>
<root level="DEBUG">
sns_1 | com.amazonaws.http.AmazonHttpClient executeHelper
sns_1 | INFO: Unable to execute HTTP request: Connection refused (Connection refused)
sns_1 | java.net.ConnectException: Connection refused (Connection refused)