Skip to content

Commit

Permalink
Simple Config API documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
fugerit79 committed Apr 9, 2024
1 parent c8deb3a commit d785afe
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 3 deletions.
8 changes: 6 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,13 @@ Helper project for service components abstraction

This project is a wrapper for some service components abstraction modules :

## [emp-service-model](emp-service-model/README.md)
## [simple-config](simple-config/README.md)

Collections of model for services.
Simple configuration API for services.

## [simple-config-microprofile](simple-config-microprofile/README.md)

Simple configuration API implementation based on MicroProfile config API.

## [emp-exception-mapper](emp-exception-mapper/README.md)

Expand Down
9 changes: 9 additions & 0 deletions simple-config-microprofile/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Simple Config API implementation based on MicroProfile.

## Usage :

```java
ConfigParams config = new TestConfigParamsMicroprofile();
String value1 = config.getValue( "testconfig.param1" );
Optional<String> value2 = config.getOptionalValue( "testconfig.param2" );
```
9 changes: 9 additions & 0 deletions simple-config/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Simple Config API for services.

## Usage :

```java
ConfigParams config = new ConfigParamsDefault( configProperties );
String value1 = config.getValue( "testconfig.param1" );
Optional<String> value2 = config.getOptionalValue( "testconfig.param2" );
```
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package teat.org.fugerit.java.simple.config;

import org.fugerit.java.simple.config.ConfigParams;
import org.fugerit.java.simple.config.ConfigParamsDefault;
import org.junit.jupiter.api.Assertions;
import org.junit.jupiter.api.Test;
Expand All @@ -17,7 +18,7 @@ void testConfigParams() throws IOException {
try (InputStream is = new FileInputStream( "src/test/resources/testconfig.properties" ) ) {
Properties configProperties = new Properties();
configProperties.load( is );
ConfigParamsDefault config = new ConfigParamsDefault( configProperties );
ConfigParams config = new ConfigParamsDefault( configProperties );
String value1 = config.getValue( "testconfig.param1" );
Assertions.assertEquals( "value1", value1 );
Optional<String> value2 = config.getOptionalValue( "testconfig.param2" );
Expand Down

0 comments on commit d785afe

Please sign in to comment.