-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
17 changed files
with
1,087 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# | ||
# https://help.github.com/articles/dealing-with-line-endings/ | ||
# | ||
# Linux start script should use lf | ||
/gradlew text eol=lf | ||
|
||
# These are Windows script files and should use crlf | ||
*.bat text eol=crlf | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# | ||
# Copyright 2023 Aiven Oy | ||
# | ||
# Licensed 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. | ||
# | ||
|
||
# The workflow to check main after push. | ||
name: Main checks after push and during pull requests | ||
on: | ||
push: | ||
branches: [ 'main' ] | ||
pull_request: | ||
branches: [ 'main' ] | ||
jobs: | ||
build: | ||
strategy: | ||
matrix: | ||
java-version: [ 11, 17 ] | ||
name: Build on ${{ matrix.runs-on }} with jdk ${{ matrix.java-version }} | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
- name: Set up JDK ${{ matrix.java-version }} | ||
uses: actions/setup-java@v3 | ||
with: | ||
java-version: ${{ matrix.java-version }} | ||
distribution: temurin | ||
|
||
- name: Build with Gradle | ||
run: ./gradlew build |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
.gradle | ||
|
||
build | ||
|
||
/.idea |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,50 @@ | ||
{{PROJECT_NAME}} | ||
testcontainers-fake-gcs-server | ||
====================== | ||
This is a template repository for creating open source repositories at Aiven. | ||
Testcontainers wrapper for [https://github.com/fsouza/fake-gcs-server](). | ||
|
||
Overview | ||
======== | ||
Usage | ||
===== | ||
|
||
Features | ||
============ | ||
1. Add the dependency: | ||
|
||
Setup | ||
============ | ||
```xml | ||
<dependency> | ||
<groupId>io.aiven</groupId> | ||
<artifactId>testcontainers.fakegcsserver</artifactId> | ||
<version>0.1.0</version> | ||
</dependency> | ||
``` | ||
|
||
2. Use in tests with JUnit 5 and Testcontainers: | ||
|
||
```java | ||
@Testcontainers | ||
class MyTest { | ||
@Container | ||
private static final FakeGcsServerContainer FAKE_GCS_SERVER_CONTAINER = | ||
new FakeGcsServerContainer(); | ||
|
||
@Test | ||
void test() { | ||
final Storage storage = StorageOptions.newBuilder() | ||
.setCredentials(NoCredentials.getInstance()) | ||
.setHost(FAKE_GCS_SERVER_CONTAINER.url()) | ||
.setProjectId("test-project") | ||
.build() | ||
.getService(); | ||
|
||
storage.create(BucketInfo.of("test-bucket")); | ||
} | ||
} | ||
``` | ||
|
||
License | ||
============ | ||
{{PROJECT_NAME}} is licensed under the Apache license, version 2.0. Full license text is available in the [LICENSE](LICENSE) file. | ||
`testcontainers-fake-gcs-server` is licensed under the Apache license, version 2.0. Full license text is available in the [LICENSE](LICENSE) file. | ||
|
||
Please note that the project explicitly does not require a CLA (Contributor License Agreement) from its contributors. | ||
|
||
Contact | ||
============ | ||
Bug reports and patches are very welcome, please post them as GitHub issues and pull requests at https://github.com/aiven/{{PROJECT_NAME}} . | ||
Bug reports and patches are very welcome, please post them as GitHub issues and pull requests at [https://github.com/Aiven-Open/testcontainers-fake-gcs-server](). | ||
To report any possible vulnerabilities or other serious issues please see our [security](SECURITY.md) policy. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
/* | ||
* Copyright 2023 Aiven Oy | ||
* | ||
* Licensed 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. | ||
*/ | ||
|
||
plugins { | ||
// https://docs.gradle.org/current/userguide/java_library_plugin.html | ||
id 'java-library' | ||
|
||
// https://docs.gradle.org/current/userguide/checkstyle_plugin.html | ||
id 'checkstyle' | ||
|
||
// https://docs.gradle.org/current/userguide/distribution_plugin.html | ||
id 'distribution' | ||
} | ||
|
||
group = 'io.aiven' | ||
|
||
repositories { | ||
mavenCentral() | ||
} | ||
|
||
java { | ||
sourceCompatibility = JavaVersion.VERSION_11 | ||
targetCompatibility = JavaVersion.VERSION_11 | ||
|
||
withJavadocJar() | ||
withSourcesJar() | ||
} | ||
|
||
tasks.named('test') { | ||
useJUnitPlatform() | ||
} | ||
|
||
dependencies { | ||
implementation libs.testcontainers | ||
|
||
testImplementation libs.junit.jupiter.api | ||
testImplementation libs.junit.jupiter.params | ||
testRuntimeOnly libs.junit.jupiter.engine | ||
|
||
testImplementation libs.testcontainers.junit.jupiter | ||
|
||
testImplementation libs.gcs | ||
testRuntimeOnly libs.slf4j.log4j12 | ||
} | ||
|
||
distributions { | ||
main { | ||
contents { | ||
from jar | ||
from sourcesJar | ||
} | ||
} | ||
} |
Oops, something went wrong.