Error :Expecting value to be false but was true

INFO: nodeIdFile :/tmp/junit9580931651746848476/not-readable/node-id–rw-------
[ERROR] Tests run: 22, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.294 s <<< FAILURE! – in org.graylog2.ConfigurationTest
[ERROR] org.graylog2.ConfigurationTest.testNodeIdFilePermissions – Time elapsed: 0.069 s <<< FAILURE!
org.opentest4j.AssertionFailedError:

Expecting value to be false but was true
at org.graylog2.ConfigurationTest.testNodeIdFilePermissions(ConfigurationTest.java:150)
at java.base/java.lang.reflect.Method.invoke(Method.java:569)

In the above errors : The test case validating the below folder contains read write permission —> /tmp/junit9580931651746848476/not-readable/node-id. but the folder does not exist. while i try to create the folder manually its difficult to predict the value of “junit9580931651746848476”, the value changes dynamically for every build.

Then finally the failures are :

[ERROR] ConfigurationTest.testNodeIdFilePermissions:150
Expecting value to be false but was true
[ERROR] HttpConfigurationTest.tlsValidationFailsIfCertificateIsUnreadable Expected test to throw (an instance of com.github.joschi.jadconfig.ValidationException and exception with message a string containing "Unreadable or missing HTTP X.509 certificate: ")
[ERROR] HttpConfigurationTest.tlsValidationFailsIfPrivateKeyIsUnreadable Expected test to throw (an instance of com.github.joschi.jadconfig.ValidationException and exception with message a string containing "Unreadable or missing HTTP private key: ").

Kindly provide me a solutions for above failures.

Can you elaborate on what you are trying to do here? Since you are running the unit tests, I assume you can also step through in a debugger to pinpoint your problem.
The test uses TemporaryFolder.class to generate the folder and files. You do not need to create anything manually.

FYI,

final File directoryNotReadable = temporaryFolder.newFolder(“not-readable”);
logger.info("directoryNotReadable path exist: " + directoryNotReadable.exists());—>true
final File parentNotReadable = new File(directoryNotReadable, “node-id”);
logger.info("parentNotReadable File exists: " + parentNotReadable.exists()); -->false
assertThat(validateWithPermissions(parentNotReadable, “rw-------”)).isFalse();—>true but expected value false

private static boolean validateWithPermissions(File nodeIdFile, String permissions) throws IOException {
logger.info(“nodeIdFile :”+nodeIdFile+“–”+permissions);
try {
final Configuration.NodeIdFileValidator validator = new Configuration.NodeIdFileValidator();
if (nodeIdFile.exists()) {
Files.setPosixFilePermissions(nodeIdFile.toPath(), PosixFilePermissions.fromString(permissions));
}
validator.validate(“node-id”, nodeIdFile.toString());
} catch (ValidationException ve) {
logger.info(“ve :”+ve.getMessage());
ve.printStackTrace();
return false;
}
return true;
}

the parentNotReadable file not created on run time. so while the execution of validateWithPermissions function ,it verify the file exist or not. In our case the parentNotReadable not exists. So it return true but expected value is false.

And then another error is HttpConfigurationTest.tlsValidationFailsIfCertificateIsUnreadable Expected test to throw (an instance of com.github.joschi.jadconfig.ValidationException and exception with message a string containing "Unreadable or missing HTTP X.509 certificate: ").

give solution to both the errors

Since both of these tests are creating files, it looks like the account running the tests is missing some permissions.

Sorry, I cannot debug your local setup.