Skip Outfile and TMO sending when when either Branch ID or CI Set is not provided Change-Id: Ibcec55bbca9d84cf5aeaeecb7d3ababee53e2d25
diff --git a/org.eclipse.osee.ote.rest/src/org/eclipse/osee/ote/rest/OseeOutfileSender.java b/org.eclipse.osee.ote.rest/src/org/eclipse/osee/ote/rest/OseeOutfileSender.java index e9fc496..cff1fc6 100644 --- a/org.eclipse.osee.ote.rest/src/org/eclipse/osee/ote/rest/OseeOutfileSender.java +++ b/org.eclipse.osee.ote.rest/src/org/eclipse/osee/ote/rest/OseeOutfileSender.java
@@ -54,8 +54,8 @@ private static final String DEFAULT_BRANCH_ID = "no_osee_branch_provided"; private static final String DEFAULT_CI_SET_ID = "no_osee_ciSet_provided"; - private final String branchId = OtePropertiesCore.oseeBranchId.getValue("DEFAULT_BRANCH_ID"); - private final String ciSetId = OtePropertiesCore.oseeCiSetId.getValue("DEFAULT_CI_SET_ID"); + private final String branchId = OtePropertiesCore.oseeBranchId.getValue(DEFAULT_BRANCH_ID); + private final String ciSetId = OtePropertiesCore.oseeCiSetId.getValue(DEFAULT_CI_SET_ID); private TestEnvironmentInterface testEnv; private JaxRsApi jaxRsApi; @@ -106,6 +106,11 @@ * @param testClassName the name of the test class that corresponds to the test event. */ private void postOutfile(String testClassName) { + if (branchId.equals(DEFAULT_BRANCH_ID)) { + OseeLog.logf(getClass(), Level.WARNING, "No OSEE branch ID provided, outfile will not be uploaded to OSEE."); + return; + } + String jsonString = getOutfileJsonString(testClassName); if (jsonString.isEmpty()) { OseeLog.logf(getClass(), Level.WARNING, "No JSON outfile found for test class: " + testClassName); @@ -136,6 +141,16 @@ */ private void postTmoFile(String testClassName) { + if (branchId.equals(DEFAULT_BRANCH_ID)) { + OseeLog.logf(getClass(), Level.WARNING, "No OSEE Branch ID provided, TMO file will not be uploaded to OSEE."); + return; + } + + if (ciSetId.equals(DEFAULT_CI_SET_ID)) { + OseeLog.logf(getClass(), Level.WARNING, "No OSEE CI Set ID provided, TMO file will not be uploaded to OSEE."); + return; + } + InputStream tmoInputStream = getTmoFileInputStream(testClassName); if (tmoInputStream == null) { OseeLog.logf(getClass(), Level.WARNING,