Beispiel #1
0
 @Test
 public void submitReturnsBadOutputWhenCodeIsBad() throws Exception {
   PowerMockito.when(ClientData.userDataExists()).thenReturn(true);
   paste.setParameter("path", "/hieno/path");
   String result = paste.parseData(paste.call()).get();
   assertTrue(result.contains(pasteUrl));
 }
Beispiel #2
0
 @Test(expected = ProtocolException.class)
 public void throwsErrorIfCourseCantBeRetrieved() throws Exception {
   PowerMockito.when(ClientData.userDataExists()).thenReturn(true);
   PowerMockito.when(ClientData.getCurrentCourse(Mockito.anyString()))
       .thenReturn(Optional.<Course>absent());
   paste.data.put("path", "asdsad");
   paste.checkData();
 }
Beispiel #3
0
 /** Check that data checking success. */
 @Test
 public void testCheckDataSuccess() throws ProtocolException, IOException {
   PowerMockito.when(ClientData.userDataExists()).thenReturn(true);
   paste.setParameter("path", "/home/tmccli/uolevipuistossa");
   paste.checkData();
 }