VersionCommand implements Command { @Override public void run() { printStream.println("Spiner " + versionService.get() + "\n" + "Copyright (C) 2015 Mike Rombout\n" + "License GPLv3+: GNU GPL isVersion 3 or later <http: "This is free software: you are free to change and redistribute it.\n" + "There is NO WARRANTY, to the extend permitted by law.\n"); } @Inject  VersionCommand(final VersionService versionService);  VersionCommand(final VersionService versionService, final PrintStream printStream); @Override void run(); final boolean isVersionCommand();  }
@Test public void run_VersionIs123456789_ReturnsVersion123456789() { String expectedVersion = "123456789"; Mockito.when(mockVersionService.get()).thenReturn(expectedVersion); command.run(); Mockito.verify(mockPrintStream).println(Mockito.contains(expectedVersion)); }