@Before public void setUp() throws Exception { MockitoAnnotations.initMocks(this); options = PipelineOptionsFactory.create(); options.as(GcsOptions.class).setGcsUtil(mockGcsUtil); options.as(GcpOptions.class).setProject("foo"); options.as(GcpOptions.class).setZone("us-north1-a"); when(mockCrmClient.projects()).thenReturn(mockProjects); when(mockProjects.get(any(String.class))).thenReturn(mockGet); fakeProject = new Project().setProjectNumber(1L); }
@Test public void testEmptyGcpTempLocation() throws Exception { GcpOptions options = PipelineOptionsFactory.as(GcpOptions.class); options.setGcpCredential(new TestCredential()); options.setProject(""); thrown.expect(IllegalArgumentException.class); thrown.expectMessage("--project is a required option"); options.getGcpTempLocation(); }