Skip to content
This repository has been archived by the owner on Sep 28, 2021. It is now read-only.

Commit

Permalink
Add tests for ApolloConfig
Browse files Browse the repository at this point in the history
  • Loading branch information
dflemstr committed Jan 19, 2016
1 parent 94566ed commit c360cf4
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ public boolean enableOutgoingRequestLogging() {
return optionalBoolean(apolloNode, "logOutgoingRequests").orElse(true);
}


public boolean enableMetaApi() {
return optionalBoolean(apolloNode, "metaApi").orElse(true);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,24 @@ public void testEnableIncomingRequestLoggingDefault() throws Exception {
assertThat(sut.enableIncomingRequestLogging(), is(true));
}

@Test
public void testEnableOutgoingRequestLogging() throws Exception {
final Config config = ConfigFactory.parseMap(ImmutableMap.of(
"apollo.logOutgoingRequests", false
));
final ApolloConfig sut = new ApolloConfig(config);

assertThat(sut.enableOutgoingRequestLogging(), is(false));
}

@Test
public void testEnableOutgoingRequestLoggingDefault() throws Exception {
final Config config = ConfigFactory.parseMap(ImmutableMap.of());
final ApolloConfig sut = new ApolloConfig(config);

assertThat(sut.enableOutgoingRequestLogging(), is(true));
}

@Test
public void testEnableMetaApi() throws Exception {
final Config config = ConfigFactory.parseMap(ImmutableMap.of(
Expand Down

0 comments on commit c360cf4

Please sign in to comment.