ConfigValueHelper { protected static void checkPositiveInteger(String configKey, int configValue) throws SofaRpcRuntimeException { if (configValue <= 0) { throw ExceptionUtils.buildRuntime(configKey, configValue + "", "must > 0"); } }    }
@Test public void checkPositiveInteger() { ConfigValueHelper.checkPositiveInteger("aaa", 1); try { ConfigValueHelper.checkPositiveInteger("aaa", 0); Assert.fail(); } catch (Exception e) { Assert.assertTrue(e.getMessage().contains("aaa")); } try { ConfigValueHelper.checkPositiveInteger("aaa", -1); Assert.fail(); } catch (Exception e) { Assert.assertTrue(e.getMessage().contains("aaa")); } }