Skip to content

Commit

Permalink
Provided docker compose file for integration test services
Browse files Browse the repository at this point in the history
  • Loading branch information
ok2c committed Oct 22, 2024
1 parent 85d453e commit 6ad998e
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 2 deletions.
32 changes: 32 additions & 0 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Copyright 2022, OK2 Consulting Ltd
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

version: '3.5'

services:
test-httpbin:
container_name: "test-httpbin"
image: "kennethreitz/httpbin:latest"
networks:
static-network:
ipv4_address: 172.20.0.2

networks:
static-network:
ipam:
config:
- subnet: 172.20.0.0/16
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,15 @@ import org.junit.Before
import org.junit.Test
import org.junit.runner.RunWith

/**
* Make sure the integration test services are running
* by executing Docker Compose from <project_root>/docker/docker-compose.yml
*/
@RunWith(AndroidJUnit4::class)
class HttpAsyncClientIntegrationTest {

// HttpBin.org running in a docker container
val httpbin = HttpHost("172.19.0.2", 80)
val httpbin = HttpHost("172.20.0.2", 80)

val client: CloseableHttpAsyncClient = HttpAsyncClientBuilder.create()
.build();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,15 @@ import org.junit.After
import org.junit.Test
import org.junit.runner.RunWith

/**
* Make sure the integration test services are running
* by executing Docker Compose from <project_root>/docker/docker-compose.yml
*/
@RunWith(AndroidJUnit4::class)
class HttpClientIntegrationTest {

// HttpBin.org running in a docker container
val httpbin = HttpHost("172.19.0.2", 80)
val httpbin = HttpHost("172.20.0.2", 80)

val client: CloseableHttpClient = HttpClientBuilder.create()
.build();
Expand Down

0 comments on commit 6ad998e

Please sign in to comment.