Beispiel #1
0
 private void mock() throws ParseException, ExpiredException, IOException, ProtocolException {
   ClientData.setUserData("Massbon", "Samu");
   PowerMockito.mockStatic(ClientData.class);
   PowerMockito.when(ClientData.getCurrentCourse(Mockito.anyString()))
       .thenReturn(Optional.<Course>of(new Course()));
   PowerMockito.when(ClientData.getFormattedUserData()).thenReturn("Bossman:Samu");
 }
Beispiel #2
0
 /** Mocks CourseSubmitter and injects it into Paste command. */
 @Before
 public void setup() throws Exception {
   Mailbox.create();
   mock();
   ClientData.setUserData("Bossman", "Samu");
   ClientData.setProjectRootFinder(new ProjectRootFinderStub());
   TmcServiceScheduler.disablePolling();
   submitterMock = Mockito.mock(CourseSubmitter.class);
   when(submitterMock.submitPaste(Mockito.anyString())).thenReturn(pasteUrl);
   paste = new Paste(submitterMock);
 }