Skip to content

Commit

Permalink
docs: add documentation
Browse files Browse the repository at this point in the history
Co-authored-by: Eduwer Camacaro <[email protected]>
  • Loading branch information
sauljabin and eduwercamacaro committed Dec 13, 2024
1 parent bf8658d commit f66325c
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 11 deletions.
12 changes: 10 additions & 2 deletions test-utils-container/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
### LH Test
# LH Test Utils Container

Test framework for LittleHorse applications
LittleHorse [Testcontainers](https://testcontainers.com/) implementation.

For documentation on how to use this library, please go to [the LittleHorse website](https://littlehorse.dev).

## Local Development

```bash
./gradlew test-utils-container:publishToMavenLocal -Pversion=<my-version>
```
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,17 @@
import org.testcontainers.kafka.KafkaContainer;
import org.testcontainers.utility.DockerImageName;

/**
* Example of using:
* <blockquote><pre>
* {@code @Container}
* public LittleHorseCluster littleHorseCluster = LittleHorseCluster.newBuilder()
* .withInstances(2)
* .withKafkaImage("apache/kafka-native:latest")
* .withLittlehorseImage("ghcr.io/littlehorse-enterprises/littlehorse/lh-server:master")
* .build();
* </pre></blockquote>
*/
public class LittleHorseCluster extends GenericContainer<LittleHorseCluster> {

public static final String LHC_API_HOST = "LHC_API_HOST";
Expand Down Expand Up @@ -76,8 +87,9 @@ public static LittleHorseClusterBuilder newBuilder() {

/**
* Return a properties object
* Use: new LHConfig(littlehorseContainer.getProperties())
*
* <p>
* Use: {@code new LHConfig(littleHorseCluster.getClientProperties())}
* </p>
* @return Properties with the container configurations
*/
public Properties getClientProperties() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import org.testcontainers.containers.wait.strategy.Wait;
import org.testcontainers.utility.DockerImageName;

public class LittleHorseContainer extends GenericContainer<LittleHorseContainer> {
class LittleHorseContainer extends GenericContainer<LittleHorseContainer> {

private static final String LHS_INTERNAL_ADVERTISED_HOST = "LHS_INTERNAL_ADVERTISED_HOST";
private static final String LHS_INSTANCE_ID = "LHS_INSTANCE_ID";
Expand All @@ -30,7 +30,7 @@ public class LittleHorseContainer extends GenericContainer<LittleHorseContainer>
*
* @param littlehorseImage Example: "ghcr.io/littlehorse-enterprises/littlehorse/lh-server:latest"
*/
public LittleHorseContainer(final String littlehorseImage) {
LittleHorseContainer(final String littlehorseImage) {
this(DockerImageName.parse(littlehorseImage));
}

Expand All @@ -39,7 +39,7 @@ public LittleHorseContainer(final String littlehorseImage) {
*
* @param littlehorseImage Example: DockerImageName.parse("ghcr.io/littlehorse-enterprises/littlehorse/lh-server:latest")
*/
public LittleHorseContainer(final DockerImageName littlehorseImage) {
LittleHorseContainer(final DockerImageName littlehorseImage) {
super(littlehorseImage);
littlehorseImage.assertCompatibleWith(DEFAULT_IMAGE_NAME);
this.withExposedPorts(DEFAULT_INTERNAL_PORT)
Expand Down Expand Up @@ -135,8 +135,9 @@ public int getApiPort() {

/**
* Return a properties object.
* Use: new LHConfig(littlehorseContainer.getProperties())
*
* <p>
* Use: {@code new LHConfig(littlehorseContainer.getClientProperties())}
* </p>
* @return Properties with the container configurations
*/
public Properties getClientProperties() {
Expand Down
12 changes: 10 additions & 2 deletions test-utils/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
### LH Test
# LH Test Utils

Test framework for LittleHorse applications
Test framework for LittleHorse applications.

For documentation on how to use this library, please go to [the LittleHorse website](https://littlehorse.dev).

## Local Development

```bash
./gradlew test-utils:publishToMavenLocal -Pversion=<my-version>
```

0 comments on commit f66325c

Please sign in to comment.