FossologySettings { public byte[] getFossologyPrivateKey() { return FOSSOLOGY_PRIVATE_KEY; }  int getFossologyConnectionTimeout(); long getFossologyExecutionTimeout(); String getFossologyHost(); int getFossologyPort(); String getFossologySshUsername(); byte[] getFossologyPrivateKey(); byte[] getFossologyPublicKey();  }
@Test public void testKeyIsAValidPrivateKey() throws Exception { final String msg = "Private key defined in property files" ; final byte[] fossologyPrivateKey = fossologySettings.getFossologyPrivateKey(); assertThat(msg + "is not readable", fossologyPrivateKey, notNullValue()); assertThat(msg + "is empty", fossologyPrivateKey.length, is(greaterThan(0))); try { final JSch jSch = new JSch(); jSch.addIdentity("test", fossologyPrivateKey, null, null); } catch (Exception e) { fail(msg + "is not a valid private key"); } }