Skip to content
Merged
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
127 changes: 78 additions & 49 deletions .github/workflows/default.yml

Large diffs are not rendered by default.

19 changes: 19 additions & 0 deletions .mvn/wrapper/maven-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
wrapperVersion=3.3.2
distributionType=only-script
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.8.7/apache-maven-3.8.7-bin.zip
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# kotlin-atlassian-client
![Maven Central](https://img.shields.io/maven-central/v/com.linked-planet.client/kotlin-jira-client-api)
[![kotlin-atlassian-client - default](https://github.com/linked-planet/kotlin-atlassian-client/actions/workflows/default.yml/badge.svg)](https://github.com/linked-planet/kotlin-atlassian-client/actions/workflows/default.yml)
![Kotlin 1.8.0](https://img.shields.io/badge/Kotlin-1.8.0-blue)
![Jira 9.4.2](https://img.shields.io/badge/Jira-9.4.2-blue)
![Confluence 7.19.5](https://img.shields.io/badge/Confluence-7.19.5-lightblue)
![Kotlin 2.1.20](https://img.shields.io/badge/Kotlin-2.1.20-blue)
![Jira 9.12.10](https://img.shields.io/badge/Jira-9.12.10-blue)
![Confluence 9.2.3](https://img.shields.io/badge/Confluence-9.2.3-lightblue)
> *kotlin-atlassian-client* merges the libraries of the repositories *kotlin-http-client*, *kotlin-jira-client* and *kotlin-insight-client* originally implemented by @betacore.

## Docs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,42 @@ import com.google.gson.stream.JsonReader
import com.google.gson.stream.JsonWriter
import com.linkedplanet.kotlininsightclient.api.model.InsightAttribute
import com.linkedplanet.kotlininsightclient.api.model.ObjectTypeSchemaAttribute
import java.time.LocalDate
import java.time.LocalTime
import java.time.ZonedDateTime


class GsonUtil {
companion object {
fun gsonBuilder(): GsonBuilder = GsonBuilder()
.registerTypeAdapter(LocalDate::class.java, localDateAdapter)
.registerTypeAdapter(LocalTime::class.java, localTimeAdapter)
.registerTypeAdapter(ZonedDateTime::class.java, zonedDateTimeAdapter)
.registerTypeAdapterFactory(SealedTypeAdapterFactory.of(InsightAttribute::class))
.registerTypeAdapterFactory(SealedTypeAdapterFactory.of(ObjectTypeSchemaAttribute::class,
typeFieldName = "type",
jsonNameForType = { it.simpleName!!.removeSuffix("Schema") to it }
))

private val localDateAdapter = object : TypeAdapter<LocalDate>() {
override fun write(out: JsonWriter, value: LocalDate?) {
out.value(value.toString())
}

override fun read(`in`: JsonReader): LocalDate {
return LocalDate.parse(`in`.nextString())
}
}

private val localTimeAdapter = object : TypeAdapter<LocalTime>() {
override fun write(out: JsonWriter, value: LocalTime?) {
out.value(value.toString())
}

override fun read(`in`: JsonReader): LocalTime {
return LocalTime.parse(`in`.nextString())
}
}

private val zonedDateTimeAdapter = object : TypeAdapter<ZonedDateTime>() {
override fun write(out: JsonWriter, value: ZonedDateTime?) {
Expand Down
8 changes: 8 additions & 0 deletions kotlin-insight-client/kotlin-insight-client-sdk/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,14 @@
<artifactId>insight</artifactId>
<scope>provided</scope>
<exclusions>
<exclusion>
<groupId>org.codehaus.groovy.modules.http-builder</groupId>
<artifactId>http-builder</artifactId>
</exclusion>
<exclusion>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
</exclusion>
<exclusion>
<groupId>org.ehcache</groupId>
<artifactId>ehcache</artifactId>
Expand Down
9 changes: 9 additions & 0 deletions kotlin-insight-client/kotlin-insight-client-test-sdk/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,14 @@
<artifactId>insight</artifactId>
<scope>provided</scope>
<exclusions>
<exclusion>
<groupId>org.codehaus.groovy.modules.http-builder</groupId>
<artifactId>http-builder</artifactId>
</exclusion>
<exclusion>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
</exclusion>
<exclusion>
<groupId>org.ehcache</groupId>
<artifactId>ehcache</artifactId>
Expand Down Expand Up @@ -199,6 +207,7 @@
<enableQuickReload>true</enableQuickReload>
<startupTimeout>1800000</startupTimeout>
<jvmArgs>-Xms2g -Xmx4g -XX:+UseG1GC</jvmArgs>
<server>localhost</server>
<contextPath>/</contextPath>
<productLicense>${jira.service.management.license}</productLicense>
<httpPort>${jira.http.port}</httpPort>
Expand Down
22 changes: 22 additions & 0 deletions kotlin-insight-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,28 @@
<groupId>com.atlassian.jira.plugins</groupId>
<artifactId>insight</artifactId>
<version>${insight.version}</version>
<exclusions>
<exclusion>
<groupId>org.codehaus.groovy.modules.http-builder</groupId>
<artifactId>http-builder</artifactId>
</exclusion>
<exclusion>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
</exclusion>
<exclusion>
<groupId>org.ehcache</groupId>
<artifactId>ehcache</artifactId>
</exclusion>
<exclusion>
<groupId>com.atlassian.translations</groupId>
<artifactId>*</artifactId>
</exclusion>
<exclusion>
<groupId>com.atlassian.jira.plugins</groupId>
<artifactId>insight-core-widget-report</artifactId>
</exclusion>
</exclusions>
</dependency>

<!-- Kotlin -->
Expand Down
2 changes: 1 addition & 1 deletion kotlin-jira-client/kotlin-jira-client-api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.10.1</version>
<version>2.2.2-atlassian-1</version>
</dependency>
<dependency>
<groupId>com.linked-planet.client</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -249,13 +249,13 @@ class HttpJiraIssueOperator(private val context: HttpJiraClientContext) : JiraIs
}

private fun extractEmbeddedMappings(issuePage: HttpJiraIssuePage): Map<String, String> {
val names = issuePage.names.asJsonObject
val names = issuePage.names?.asJsonObject
return names
.entrySet()
.map { it.key }
.associateBy {
?.entrySet()
?.map { it.key }
?.associateBy {
names.get(it).asString
}
}?: emptyMap()
}

private fun extractEmbeddedMappings(jsonObject: JsonObject): Map<String, String> {
Expand Down Expand Up @@ -310,12 +310,12 @@ class HttpJiraIssueOperator(private val context: HttpJiraClientContext) : JiraIs
private val maxResults: Number,
private val startAt: Number,
private val total: Number,
private val issues: List<JsonElement>,
val names: JsonElement
private val issues: Array<JsonElement>,
val names: JsonElement? = null
) : HttpPage<JsonElement> {
override fun getMaxResults() = maxResults
override fun getStartAt() = startAt
override fun getTotal() = total
override fun getValues(): List<JsonElement> = issues
override fun getValues(): List<JsonElement> = issues.asList()
}
}
8 changes: 8 additions & 0 deletions kotlin-jira-client/kotlin-jira-client-sdk/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,14 @@
<artifactId>insight</artifactId>
<scope>provided</scope>
<exclusions>
<exclusion>
<groupId>org.codehaus.groovy.modules.http-builder</groupId>
<artifactId>http-builder</artifactId>
</exclusion>
<exclusion>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
</exclusion>
<exclusion>
<groupId>org.ehcache</groupId>
<artifactId>ehcache</artifactId>
Expand Down
6 changes: 6 additions & 0 deletions kotlin-jira-client/kotlin-jira-client-test-applink/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,12 @@
<version>2.2.2-atlassian-1</version>
</dependency>

<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-stdlib</artifactId>
<version>${kotlin.version}</version>
</dependency>

<!-- WIRED TEST RUNNER DEPENDENCIES -->
<dependency>
<groupId>com.atlassian.plugins</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,5 +76,4 @@ class JiraApplinkClientTest constructor(
fun initTest() {
loginAsUser("admin")
}

}
1 change: 1 addition & 0 deletions kotlin-jira-client/kotlin-jira-client-test-base/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@
<contextPath>/</contextPath>
<installPlugin>false</installPlugin>
<jvmArgs>-Xms2g -Xmx4g -XX:+UseG1GC</jvmArgs>
<server>localhost</server>
<httpPort>${jira.http.port}</httpPort>
<applications>
<application>
Expand Down
10 changes: 10 additions & 0 deletions kotlin-jira-client/kotlin-jira-client-test-sdk/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,14 @@
<artifactId>insight</artifactId>
<scope>provided</scope>
<exclusions>
<exclusion>
<groupId>org.codehaus.groovy.modules.http-builder</groupId>
<artifactId>http-builder</artifactId>
</exclusion>
<exclusion>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
</exclusion>
<exclusion>
<groupId>org.ehcache</groupId>
<artifactId>ehcache</artifactId>
Expand Down Expand Up @@ -191,6 +199,7 @@
<plugin>
<groupId>com.atlassian.maven.plugins</groupId>
<artifactId>jira-maven-plugin</artifactId>
<version>${amps.version}</version>
<extensions>true</extensions>
<configuration>
<productVersion>${jira.version}</productVersion>
Expand All @@ -201,6 +210,7 @@
<enableQuickReload>true</enableQuickReload>
<startupTimeout>1800000</startupTimeout>
<jvmArgs>-Xms2g -Xmx4g -XX:+UseG1GC</jvmArgs>
<server>localhost</server>
<contextPath>/</contextPath>
<productLicense>${jira.service.management.license}</productLicense>
<httpPort>${jira.http.port}</httpPort>
Expand Down
22 changes: 22 additions & 0 deletions kotlin-jira-client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,28 @@
<groupId>com.atlassian.jira.plugins</groupId>
<artifactId>insight</artifactId>
<version>${insight.version}</version>
<exclusions>
<exclusion>
<groupId>org.codehaus.groovy.modules.http-builder</groupId>
<artifactId>http-builder</artifactId>
</exclusion>
<exclusion>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
</exclusion>
<exclusion>
<groupId>org.ehcache</groupId>
<artifactId>ehcache</artifactId>
</exclusion>
<exclusion>
<groupId>com.atlassian.translations</groupId>
<artifactId>*</artifactId>
</exclusion>
<exclusion>
<groupId>com.atlassian.jira.plugins</groupId>
<artifactId>insight-core-widget-report</artifactId>
</exclusion>
</exclusions>
</dependency>

<!-- Kotlin -->
Expand Down
Loading