Program: 186109
Project: 186109
Buggy source:
@Test public void mongodb_should_start_mongodb_instance_in_Windows() throws Throwable {
  MongoDbLowLevelOps mongoDbChecker=mock(MongoDbLowLevelOps.class);
  when(mongoDbChecker.assertThatConnectionIsPossible(anyString(),anyInt(),anyInt())).thenReturn(true);
  when(operatingSystemResolver.currentOperatingSystem()).thenReturn(OperatingSystem.WINDOWS_7);
  CommandLineExecutor commandLineExecutor=mock(CommandLineExecutor.class);
  Process mockProcess=mock(Process.class);
  when(mockProcess.exitValue()).thenReturn(0);
  when(commandLineExecutor.startProcessInDirectoryAndArguments(anyString(),anyList())).thenReturn(mockProcess);
  when(commandLineExecutor.getConsoleOutput(mockProcess)).thenReturn(Collections.<String>emptyList());
  File targetPath=temporaryFolder.newFolder();
  ManagedMongoDb managedMongoDb=newManagedMongoDbRule().targetPath(targetPath.toString()).mongodPath(MONGODB_LOCATION).appendCommandLineArguments("String_Node_Str","String_Node_Str").build();
  managedMongoDb.managedMongoDbLifecycleManager.setCommandLineExecutor(commandLineExecutor);
  managedMongoDb.managedMongoDbLifecycleManager.setOperatingSystemResolver(operatingSystemResolver);
  managedMongoDb.managedMongoDbLifecycleManager.setMongoDbLowLevelOps(mongoDbChecker);
  managedMongoDb.before();
  List<String> expectedCommand=new ArrayList<String>();
  expectedCommand.add(MONGODB_LOCATION + File.separatorChar + ManagedMongoDbLifecycleManager.MONGODB_BINARY_DIRECTORY+ File.separatorChar+ ManagedMongoDbLifecycleManager.MONGODB_EXECUTABLE_W);
  expectedCommand.add(ManagedMongoDbLifecycleManager.DBPATH_ARGUMENT_NAME);
  expectedCommand.add(ManagedMongoDbLifecycleManager.DEFAULT_MONGO_DBPATH);
  expectedCommand.add(ManagedMongoDbLifecycleManager.PORT_ARGUMENT_NAME);
  expectedCommand.add(DBPort.PORT + "String_Node_Str");
  expectedCommand.add(ManagedMongoDbLifecycleManager.LOGPATH_ARGUMENT_NAME);
  expectedCommand.add(ManagedMongoDbLifecycleManager.DEFAULT_MONGO_LOGPATH);
  expectedCommand.add("String_Node_Str");
  expectedCommand.add("String_Node_Str");
  managedMongoDb.after();
  verify(commandLineExecutor).startProcessInDirectoryAndArguments(targetPath.toString(),expectedCommand);
}

Fixed version (ground truth):
@Test public void mongodb_should_start_mongodb_instance_in_Windows() throws Throwable {
  MongoDbLowLevelOps mongoDbChecker=mock(MongoDbLowLevelOps.class);
  when(mongoDbChecker.assertThatConnectionIsPossible(anyString(),anyInt())).thenReturn(true);
  when(operatingSystemResolver.currentOperatingSystem()).thenReturn(OperatingSystem.WINDOWS_7);
  CommandLineExecutor commandLineExecutor=mock(CommandLineExecutor.class);
  Process mockProcess=mock(Process.class);
  when(mockProcess.exitValue()).thenReturn(0);
  when(commandLineExecutor.startProcessInDirectoryAndArguments(anyString(),anyList())).thenReturn(mockProcess);
  when(commandLineExecutor.getConsoleOutput(mockProcess)).thenReturn(Collections.<String>emptyList());
  File targetPath=temporaryFolder.newFolder();
  ManagedMongoDb managedMongoDb=newManagedMongoDbRule().targetPath(targetPath.toString()).mongodPath(MONGODB_LOCATION).appendCommandLineArguments("String_Node_Str","String_Node_Str").build();
  managedMongoDb.managedMongoDbLifecycleManager.setCommandLineExecutor(commandLineExecutor);
  managedMongoDb.managedMongoDbLifecycleManager.setOperatingSystemResolver(operatingSystemResolver);
  managedMongoDb.managedMongoDbLifecycleManager.setMongoDbLowLevelOps(mongoDbChecker);
  managedMongoDb.before();
  List<String> expectedCommand=new ArrayList<String>();
  expectedCommand.add(MONGODB_LOCATION + File.separatorChar + ManagedMongoDbLifecycleManager.MONGODB_BINARY_DIRECTORY+ File.separatorChar+ ManagedMongoDbLifecycleManager.MONGODB_EXECUTABLE_W);
  expectedCommand.add(ManagedMongoDbLifecycleManager.DBPATH_ARGUMENT_NAME);
  expectedCommand.add(ManagedMongoDbLifecycleManager.DEFAULT_MONGO_DBPATH);
  expectedCommand.add(ManagedMongoDbLifecycleManager.PORT_ARGUMENT_NAME);
  expectedCommand.add(DBPort.PORT + "String_Node_Str");
  expectedCommand.add(ManagedMongoDbLifecycleManager.LOGPATH_ARGUMENT_NAME);
  expectedCommand.add(ManagedMongoDbLifecycleManager.DEFAULT_MONGO_LOGPATH);
  expectedCommand.add(ManagedMongoDbLifecycleManager.NONE_JOURNALING_ENABLED);
  expectedCommand.add("String_Node_Str");
  expectedCommand.add("String_Node_Str");
  managedMongoDb.after();
  verify(commandLineExecutor).startProcessInDirectoryAndArguments(targetPath.toString(),expectedCommand);
}