Skip to content

Commit

Permalink
doc updates and added test coverage
Browse files Browse the repository at this point in the history
Signed-off-by: Pradeep <[email protected]>
  • Loading branch information
pradeepbbl committed Sep 11, 2024
1 parent ced0899 commit 375c205
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions providers/flagd/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ Given below are the supported configurations:
| maxEventStreamRetries | FLAGD_MAX_EVENT_STREAM_RETRIES | int | 5 | rpc |
| retryBackoffMs | FLAGD_RETRY_BACKOFF_MS | int | 1000 | rpc |
| offlineFlagSourcePath | FLAGD_OFFLINE_FLAG_SOURCE_PATH | String | null | in-process |
| authority | FLAGD_AUTHORITY_OVERRIDE | String | null | rpc & in-process |

> [!NOTE]
> Some configurations are only applicable for RPC resolver.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ void TestDefaults() {
assertNull(builder.getOfflineFlagSourcePath());
assertEquals(Resolver.RPC, builder.getResolverType());
assertEquals(0, builder.getKeepAlive());
assertNull(builder.getAuthority());
}

@Test
Expand All @@ -55,6 +56,7 @@ void TestBuilderOptions() {
.customConnector(connector)
.resolverType(Resolver.IN_PROCESS)
.keepAlive(1000)
.authority("test.service")
.build();

assertEquals("https://hosted-flagd", flagdOptions.getHost());
Expand All @@ -70,6 +72,7 @@ void TestBuilderOptions() {
assertEquals(connector, flagdOptions.getCustomConnector());
assertEquals(Resolver.IN_PROCESS, flagdOptions.getResolverType());
assertEquals(1000, flagdOptions.getKeepAlive());
assertEquals("test.service", flagdOptions.getAuthority());
}


Expand Down Expand Up @@ -187,4 +190,13 @@ void testRpcProviderFromEnv_portConfigured_usesConfiguredPort() {
assertThat(flagdOptions.getPort()).isEqualTo(1534);

}


@Test
@SetEnvironmentVariable(key = AUTHORITY_OVERRIDE, value = "test.service")
void testAuthorityOverrideFromEnv() {
FlagdOptions flagdOptions = FlagdOptions.builder().build();

assertThat(flagdOptions.getAuthority()).isEqualTo("test.service");
}
}

0 comments on commit 375c205

Please sign in to comment.