### Question:
DatasourceResource { static String prepareDataSourceInfo( String dataSourceInfo ) { StringBuilder sb = new StringBuilder(); Map<String, String> parameters = DataSourceInfoUtil.parseDataSourceInfo( dataSourceInfo ); parameters.forEach( ( key, value ) -> { String unescapedValue = StringEscapeUtils.unescapeXml( value ); String valueWithEscapedQuotes = DataSourceInfoUtil.escapeQuotes( unescapedValue ); sb.append( key ); sb.append( "=\"" ); sb.append( valueWithEscapedQuotes ); sb.append( "\"" ); sb.append( ";" ); } ); return sb.toString(); }  @GET @Path( "/{catalogId : .+}/getAnalysisDatasourceInfo" ) @Produces( WILDCARD ) @Facet( name = "Unsupported" ) Response getAnalysisDatasourceInfo( @PathParam( "catalogId" ) String catalogId ); JaxbList<String> getAnalysisDatasourceIds(); JaxbList<String> getMetadataDatasourceIds(); @Facet( name = "Unsupported" ) Response doGetMetadataFilesAsDownload( @PathParam( "metadataId" ) String metadataId ); @Facet( name = "Unsupported" ) Response doGetAnalysisFilesAsDownload( @PathParam( "analysisId" ) String analysisId ); @Facet( name = "Unsupported" ) Response doRemoveAnalysis( @PathParam( "analysisId" ) String analysisId ); @Facet( name = "Unsupported" ) Response doRemoveDSW( @PathParam( "dswId" ) String dswId );  }### Answer:
@Test public void testPrepareDataSourceInfo_OnlyQuotesEscaped() { StringBuilder dataSourceInfo = new StringBuilder(); dataSourceInfo.append( "DataSource=" ) .append( "\"DS &quot;Test&apos;s&quot; &amp; &lt;Fun&gt;\";" ) .append( "DynamicSchemaProcessor=" ) .append( "\"DSP&apos;s &amp; &quot;Other&quot; &lt;stuff&gt;\";" ); StringBuilder expectedResult = new StringBuilder(); expectedResult.append( "DataSource=" ) .append( "\"DS &quot;Test's&quot; & <Fun>\";" ) .append( "DynamicSchemaProcessor=" ) .append( "\"DSP's & &quot;Other&quot; <stuff>\";" ); String result = DatasourceResource.prepareDataSourceInfo( dataSourceInfo.toString() ); assertEquals( result, expectedResult.toString() ); }