ChaincodeEndorsementPolicy { public void fromFile(File policyFile) throws IOException { InputStream is = new FileInputStream(policyFile); policyBytes = IOUtils.toByteArray(is); } ChaincodeEndorsementPolicy(); void fromFile(File policyFile); void fromYamlFile(File yamlPolicyFile); void fromStream(InputStream inputStream); void fromBytes(byte[] policyAsBytes); byte[] getChaincodeEndorsementPolicyAsBytes();  }
@Test(expected = IOException.class) public void testPolicyCtorFile() throws IOException { ChaincodeEndorsementPolicy policy = new ChaincodeEndorsementPolicy(); policy.fromFile(new File("/does/not/exists")); }