Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ plugins {
}

group = 'com.github.figaf'
version = '3.16'
version = '3.17-IRT-5512-SNAPSHOT'
ext {
enableSnapshotsForDependencyResolutionAndPublishing = project.findProperty('enableSnapshots') ?: 'false'
snapshotsRepoUrl = project.findProperty('snapshotsRepoUrl') ?: ''
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,8 @@ public String deployFunctionLibraries(
String resolvedUrl = appendRuntimeProfileIfPresent(
baseUrl,
requestContext.getRuntimeLocationId(),
requestContext
requestContext,
"FunctionLibraries"
);

return executeMethod(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@ public String deployImportedArchives(
String resolvedUrl = appendRuntimeProfileIfPresent(
baseUrl,
requestContext.getRuntimeLocationId(),
requestContext
requestContext,
"ImportedArchives"
);
return executeMethod(
requestContext,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import com.figaf.integration.cpi.entity.designtime_artifacts.CreateScriptCollectionRequest;
import com.figaf.integration.cpi.entity.designtime_artifacts.UpdateScriptCollectionRequest;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;

import java.util.List;
import java.util.Objects;
Expand Down Expand Up @@ -107,11 +106,9 @@ public String deployScriptCollection(
String resolvedUrl = appendRuntimeProfileIfPresent(
baseUrl,
requestContext.getRuntimeLocationId(),
requestContext
requestContext,
"ScriptCollection"
);
if (StringUtils.isNotBlank(requestContext.getRuntimeLocationId())) {
resolvedUrl = resolvedUrl + "&artifactType=ScriptCollection";
}
return executeMethod(
requestContext,
resolvedUrl,
Expand Down
23 changes: 23 additions & 0 deletions src/main/java/com/figaf/integration/cpi/utils/CpiApiUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -100,4 +100,27 @@ public static String appendRuntimeProfileIfPresent(
+ "runtimeProfile="
+ finalizedRuntimeProfile;
}

public static String appendRuntimeProfileIfPresent(
String baseUrl,
String runtimeProfile,
RequestContext requestContext,
String artifactType
) {
String resolvedUrl = appendRuntimeProfileIfPresent(
baseUrl,
runtimeProfile,
requestContext
);

if (StringUtils.isBlank(artifactType)) {
return resolvedUrl;
}

String queryDelimiter = resolvedUrl.contains("?") ? "&" : "?";
return resolvedUrl
+ queryDelimiter
+ "artifactType="
+ artifactType;
}
}