/******************************************************************************* * Copyright (c) 2015 GoPivotal, Inc. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at * http://www.eclipse.org/legal/epl-v10.html * * Contributors: * GoPivotal, Inc. - initial API and implementation *******************************************************************************/ package org.springframework.ide.eclipse.boot.dash.test.mocks; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; import org.eclipse.core.resources.IProject; public class Mocks { public static IProject mockProject(String name, boolean exists) { IProject project = mock(IProject.class); when(project.getName()).thenReturn(name); when(project.exists()).thenReturn(exists); return project; } }