@Test public void shouldGetSandboxEnv() throws Exception { when(System.getProperty("pagseguro.environment")).thenReturn("sandbox"); PagSeguroEnv expectedEnv = PagSeguroEnv.SANDBOX; PagSeguroEnv env = provider.getEnvironment(); assertEquals(expectedEnv, env); }
@Override public PagSeguroEnv getEnvironment() throws Exception { LOGGER.info("Lendo configuracoes de ambiente"); final PagSeguroEnv environment; if (System.getProperty("pagseguro.environment") != null) { environment = PagSeguroEnv.fromName(System.getProperty("pagseguro.environment")); } else { throw new IllegalArgumentException("Environment property not found"); } LOGGER.info("Configuracoes de ambiente lidas"); return environment; }
JVMEnvVariableEnvironmentProvider implements EnvironmentProvider { @Override public PagSeguroEnv getEnvironment() throws Exception { LOGGER.info("Lendo configuracoes de ambiente"); final PagSeguroEnv environment; if (System.getProperty("pagseguro.environment") != null) { environment = PagSeguroEnv.fromName(System.getProperty("pagseguro.environment")); } else { throw new IllegalArgumentException("Environment property not found"); } LOGGER.info("Configuracoes de ambiente lidas"); return environment; } }
JVMEnvVariableEnvironmentProvider implements EnvironmentProvider { @Override public PagSeguroEnv getEnvironment() throws Exception { LOGGER.info("Lendo configuracoes de ambiente"); final PagSeguroEnv environment; if (System.getProperty("pagseguro.environment") != null) { environment = PagSeguroEnv.fromName(System.getProperty("pagseguro.environment")); } else { throw new IllegalArgumentException("Environment property not found"); } LOGGER.info("Configuracoes de ambiente lidas"); return environment; } JVMEnvVariableEnvironmentProvider(); }
JVMEnvVariableEnvironmentProvider implements EnvironmentProvider { @Override public PagSeguroEnv getEnvironment() throws Exception { LOGGER.info("Lendo configuracoes de ambiente"); final PagSeguroEnv environment; if (System.getProperty("pagseguro.environment") != null) { environment = PagSeguroEnv.fromName(System.getProperty("pagseguro.environment")); } else { throw new IllegalArgumentException("Environment property not found"); } LOGGER.info("Configuracoes de ambiente lidas"); return environment; } JVMEnvVariableEnvironmentProvider(); @Override PagSeguroEnv getEnvironment(); }
JVMEnvVariableEnvironmentProvider implements EnvironmentProvider { @Override public PagSeguroEnv getEnvironment() throws Exception { LOGGER.info("Lendo configuracoes de ambiente"); final PagSeguroEnv environment; if (System.getProperty("pagseguro.environment") != null) { environment = PagSeguroEnv.fromName(System.getProperty("pagseguro.environment")); } else { throw new IllegalArgumentException("Environment property not found"); } LOGGER.info("Configuracoes de ambiente lidas"); return environment; } JVMEnvVariableEnvironmentProvider(); @Override PagSeguroEnv getEnvironment();  }