@VisibleForTesting
    int execute(String[] args) {
        return commander.execute(args);
    }
@Test
    public void testCreateToken() {
        PrintStream oldStream = System.out;
        try {
            ByteArrayOutputStream baoStream = new ByteArrayOutputStream();
            System.setOut(new PrintStream(baoStream));

            new TokensCliUtils().execute(new String[]{"create-secret-key", "--base64"});
            String secretKey = baoStream.toString();

            baoStream.reset();

            String[] command = {"create", "--secret-key",
                    "data:;base64," + secretKey,
                    "--subject", "test",
                    "--headers", "kid=test",
                    "--headers", "my-k=my-v"
            };

            new TokensCliUtils().execute(command);
            String token = baoStream.toString();

            Jwt<?, ?> jwt = Jwts.parserBuilder()
                    .setSigningKey(Decoders.BASE64.decode(secretKey))
                    .build()
                    .parseClaimsJws(token);

            JwsHeader header = (JwsHeader) jwt.getHeader();
            String keyId = header.getKeyId();
            assertEquals(keyId, "test");
            assertEquals(header.get("my-k"), "my-v");

        } catch (Exception e) {
            throw new RuntimeException(e);
        } finally {
            System.setOut(oldStream);
        }
    }