FactModelGuvnorUploader { static void put(Sardine sardine, String putUrl, byte[] data) { try { sardine.put(putUrl, data); } catch (SardineException e) { LOGGER.error("ERROR: File couldn't be put."); LOGGER.error(e.getMessage(), e); } }  static void main(String[] args);  }
@Test public void testPut() throws SardineException { Sardine sardineMock = mock(Sardine.class); String putUrlMock = "putUrlMock"; byte[] dataMock = { 116, 101, 115, 116 }; doNothing().when(sardineMock).put(putUrlMock, dataMock); FactModelGuvnorUploader.put(sardineMock, putUrlMock, dataMock); }
@Test public void testPut_Throws_SardineException() throws SardineException { Sardine sardineMock = mock(Sardine.class); String putUrlMock = "putUrlMock"; byte[] dataMock = { 116, 101, 115, 116 }; doThrow(SardineException.class).when(sardineMock).put(putUrlMock, dataMock); FactModelGuvnorUploader.put(sardineMock, putUrlMock, dataMock); }