Capturing arguments with mockito

EncryptedFileInfo info = cut.storeEncryptedFile(encryptionSecret, plainContents, fileName);

ArgumentCaptor<byte[]> argument = ArgumentCaptor.forClass(byte[].class);

verify(cut).createFileAndAdd(eq(fileName), argument.capture());
byte[] encryptedContent = argument.getAllValues().get(0);

Where intercepted method is:

void createFileAndAdd(String fileName, byte[] encryptedContents);

Get java.util.logging working on UnitTesting

If you need to active the java.util.logging on your test, you can achieve it just adding the vm option

where can be something like

handlers = java.util.logging.ConsoleHandler
your.package.level = FINE
java.util.logging.ConsoleHandler.level = FINE

You can find a more complete example on