Skip to content

Commit

Permalink
Add debug for Microsoft crap as usual
Browse files Browse the repository at this point in the history
  • Loading branch information
uhurusurfa committed Nov 7, 2023
1 parent 2494662 commit 5ebc9c1
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ public void setUp() throws Exception {
writer.write(entry.getKey() + "=" + entry.getValue() + "\n");
}
writer.close();
System.out.println("\n**************\nWROTE SYSTEM MAPPING FILE: " + systemContentTypesMappingFile.getAbsolutePath());
// Set up the partnership override mappings
partnershipContentTypesMappingFile = new File(tmpDir, "override_content_type_map.properties");
partnershipMappedContentTypes.put(xmlFileExtension, "application/xml-custom");
Expand All @@ -64,6 +65,7 @@ public void setUp() throws Exception {
writer2.write(entry.getKey() + "=" + entry.getValue() + "\n");
}
writer2.close();
System.out.println("\n**************\nWROTE PARTNERSHIP MAPPING FILE: " + partnershipContentTypesMappingFile.getAbsolutePath());
super.setup();
this.poller = session.getPartnershipPoller(msg.getPartnership().getName());
}
Expand Down Expand Up @@ -119,7 +121,12 @@ public void c_shouldGetPartnershipMappedContentTypeWhenNoSystemMapping() throws
public void d_shouldGetSystemMappedContentType() throws Exception {
// Append the mapping file property to custom load properties
BufferedWriter propsWriter = new BufferedWriter(new FileWriter(super.openAS2PropertiesFile, true));
propsWriter.write("\n" + Partnership.PA_CONTENT_TYPE_MAPPING_FILE + "=" + systemContentTypesMappingFile.getAbsolutePath());
String prefix = "";
if (super.openAS2PropertiesFile.exists() && super.openAS2PropertiesFile.length() > 0) {
// Need to write to a new line
prefix = "\n";
}
propsWriter.write(prefix + Partnership.PA_CONTENT_TYPE_MAPPING_FILE + "=" + systemContentTypesMappingFile.getAbsolutePath());
propsWriter.close();
// Now reload the session to get new properties file that then loads system mapping
super.refresh();
Expand Down

0 comments on commit 5ebc9c1

Please sign in to comment.