@Test
@PrepareForTest(FileWriter.class)
public void testExecute() throws Exception {

  // Given
  final byte[] content = randomUUID().toString().getBytes();
  final OutputStream out = mock(OutputStream.class);
  mockStatic(Files.class);
  when(Files.newOutputStream(any())).thenReturn(out);
  final ProjectFile projectFile = new ProjectFile();
  projectFile.setTarget(randomUUID().toString());
  final Project project = new Project(randomUUID().toString(), projectFile);
  final WriteProjectTarget writeProjectTarget = new WriteProjectTarget();
  writeProjectTarget.setProject(project);
  writeProjectTarget.setContents(() -> new ByteArrayInputStream(content));
  // When
  writeProjectTarget.execute();
  // Then
  verify(out).write(any(), anyInt(), anyInt());
}