mirror of
https://github.com/google/nomulus
synced 2026-02-09 06:20:29 +00:00
Enforce no logging in production environment
------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=199156367
This commit is contained in:
@@ -45,6 +45,20 @@ public class ProxyModuleTest {
|
||||
assertThat(proxyModule.log).isFalse();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_parseArgs_loggingInProduction() {
|
||||
String[] args = {"--env", "production", "--log"};
|
||||
IllegalArgumentException e =
|
||||
assertThrows(
|
||||
IllegalArgumentException.class,
|
||||
() -> {
|
||||
proxyModule.parse(args);
|
||||
});
|
||||
assertThat(e)
|
||||
.hasMessageThat()
|
||||
.isEqualTo("Logging cannot be enabled for production environment");
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testFailure_parseArgs_wrongArguments() {
|
||||
String[] args = {"--wrong_flag", "some_value"};
|
||||
|
||||
Reference in New Issue
Block a user