Signatures { public Signature createAppSignature(String prepayId) { String pack = "Sign=WXPay"; long timestamp = System.currentTimeMillis() / 1000; String nonce = RandomStringGenerator.getRandomStringByLength(16); String appId = paySetting.getAppId(); String mchId = paySetting.getMchId(); String key = paySetting.getKey(); String sortString = String.format("appId=%s&nonceStr=%s&package=%s&partnerid=%s&&prepayid=%s&timeStamp=%s", appId, nonce, pack, mchId, prepayId, timestamp); return createSignature(pack, timestamp, nonce, appId, key, sortString); }  void setPaySetting(PaySetting paySetting); static Signatures defaultSignatures(); static Signatures with(PaySetting paySetting); Signature createAppSignature(String prepayId); Signature createJsSignature(String prepayId);  }
@Test public void testCreateAppSignature(){ Signature signature = Signatures.defaultSignatures().createAppSignature("1234567890"); Assert.assertNotNull(signature); }