Response testResponse =
repositoryPublishResource.writeFile( pathId, fileContents, overwriteFile, mockFormDataContentDisposition );
assertEquals( mockUnauthorizedResponse, testResponse );
// Test 2
PlatformImportException mockPlatformImportException = mock( PlatformImportException.class );
doReturn( errorStatus ).when( mockPlatformImportException ).getErrorStatus();
doThrow( mockPlatformImportException ).when( repositoryPublishResource.repositoryPublishService )
.writeFile( pathId, fileContents, overwriteFile );
testResponse =