Skip to content

Commit 860dd40

Browse files
release test
1 parent dc5e95b commit 860dd40

File tree

6 files changed

+91
-147
lines changed

6 files changed

+91
-147
lines changed

.github/workflows/coverage.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
id: jacoco
2323
uses: madrapps/jacoco-report@v1.3
2424
with:
25-
paths: ${{ github.workspace }}/target/site/surefire-report.html
25+
paths: ${{ github.workspace }}/target/site/jacoco/index.html
2626
token: ${{ secrets.GITHUB_TOKEN }}
2727
min-coverage-overall: 40
2828
min-coverage-changed-files: 60

jitpack.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
jdk:
2+
- openjdk17
3+
before_install:
4+
- sdk install java 17.0.3-tem
5+
- sdk use java 17.0.3-tem
6+
- sdk install maven
7+
- mvn -v
8+
install:
9+
- mvn install -Dmaven.javadoc.skip=true -DskipTests

pom.xml

Lines changed: 1 addition & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -183,102 +183,17 @@
183183
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
184184
</snapshotRepository>
185185
</distributionManagement>
186-
<build>
187-
<plugins>
188-
<plugin>
189-
<groupId>org.sonatype.plugins</groupId>
190-
<artifactId>nexus-staging-maven-plugin</artifactId>
191-
<version>1.6.13</version>
192-
<extensions>true</extensions>
193-
<configuration>
194-
<serverId>ossrh</serverId>
195-
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
196-
<autoReleaseAfterClose>true</autoReleaseAfterClose>
197-
</configuration>
198-
</plugin>
199-
<plugin>
200-
<groupId>org.apache.maven.plugins</groupId>
201-
<artifactId>maven-gpg-plugin</artifactId>
202-
<version>3.1.0</version>
203-
<executions>
204-
<execution>
205-
<id>sign-artifacts</id>
206-
<phase>verify</phase>
207-
<goals>
208-
<goal>sign</goal>
209-
</goals>
210-
<configuration>
211-
<gpgArguments>
212-
<arg>--pinentry-mode</arg>
213-
<arg>loopback</arg>
214-
</gpgArguments>
215-
</configuration>
216-
</execution>
217-
</executions>
218-
</plugin>
219-
</plugins>
220-
</build>
221186
</profile>
222187
<profile>
223188
<id>githubDeploy</id>
224189
<distributionManagement>
225190
<repository>
226191
<id>github</id>
227-
<name>GitHub cicirello Apache Maven Packages</name>
192+
<name>GitHub Apache Maven Packages</name>
228193
<url>https://maven.pkg.github.com/contentstack/contentstack-management-java</url>
229194
</repository>
230195
</distributionManagement>
231196
</profile>
232-
<profile>
233-
<id>coverage</id>
234-
<build>
235-
<plugins>
236-
<plugin>
237-
<groupId>org.jacoco</groupId>
238-
<artifactId>jacoco-maven-plugin</artifactId>
239-
<version>0.8.10</version>
240-
<executions>
241-
<execution>
242-
<goals>
243-
<goal>prepare-agent</goal>
244-
</goals>
245-
</execution>
246-
<execution>
247-
<id>generate-code-coverage-report</id>
248-
<phase>test</phase>
249-
<goals>
250-
<goal>report</goal>
251-
</goals>
252-
</execution>
253-
</executions>
254-
</plugin>
255-
</plugins>
256-
</build>
257-
</profile>
258-
<profile>
259-
<id>refactor</id>
260-
<build>
261-
<plugins>
262-
<plugin>
263-
<groupId>org.hjug.refactorfirst.plugin</groupId>
264-
<artifactId>refactor-first-maven-plugin</artifactId>
265-
<version>0.3.0</version>
266-
<configuration>
267-
<showDetails>true</showDetails>
268-
</configuration>
269-
<executions>
270-
<execution>
271-
<id>refactor-first</id>
272-
<phase>test</phase>
273-
<goals>
274-
<goal>report</goal>
275-
</goals>
276-
</execution>
277-
</executions>
278-
</plugin>
279-
</plugins>
280-
</build>
281-
</profile>
282197
</profiles>
283198

284199

src/main/java/com/contentstack/cms/Parametron.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
package com.contentstack.cms;
22

33
import org.jetbrains.annotations.NotNull;
4-
54
import java.util.HashMap;
6-
import java.util.Map;
75

86
/**
97
* The interface Parametron.
@@ -13,6 +11,7 @@ public interface Parametron {
1311
/**
1412
* The function adds a parameter to a collection using a key-value pair.
1513
*
14+
* @param <T> the type of the parameter
1615
* @param key A string representing the key of the parameter. It cannot be
1716
* null and must be
1817
* provided as a non-null value.
@@ -26,6 +25,7 @@ public interface Parametron {
2625
/**
2726
* The function adds a header with a key-value pair to a request.
2827
*
28+
* @param <T> the type of the parameter
2929
* @param key The key parameter is a string that represents the name or
3030
* identifier of the header.
3131
* It is used to specify the type of information being sent in the
@@ -41,6 +41,7 @@ public interface Parametron {
4141
* input and returns a
4242
* generic type T.
4343
*
44+
* @param <T> the type of the parameter
4445
* @param params The "params" parameter is a HashMap that maps String keys to
4546
* Object values. It is
4647
* annotated with @NotNull, indicating that it cannot be null.
@@ -51,6 +52,7 @@ public interface Parametron {
5152
/**
5253
* The function adds headers to a HashMap.
5354
*
55+
* @param <T> the type of the parameter
5456
* @param headers A HashMap containing key-value pairs of headers, where the key
5557
* is a String
5658
* representing the header name and the value is a String

src/main/java/com/contentstack/cms/core/CMAResponseConvertor.java

Lines changed: 4 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ public CMAResponseConvertor(Response<ResponseBody> response) {
3838
* The function returns the response body as a string if it is not null,
3939
* otherwise it returns null.
4040
*
41+
* @throws IOException if an I/O error occurs
4142
* @return The method is returning a String.
4243
*/
4344
public String asString() throws IOException {
@@ -48,6 +49,7 @@ public String asString() throws IOException {
4849
* The function converts the response body to a JSON string using the Gson
4950
* library.
5051
*
52+
* @throws IOException if an I/O error occurs
5153
* @return The method is returning a JSON string representation of the response
5254
* body.
5355
*/
@@ -75,9 +77,11 @@ public String asJson(String string) {
7577
* specified class using the Gson
7678
* library.
7779
*
80+
* @param <T> the type of the parameter
7881
* @param tClass The `tClass` parameter is a `Class` object that represents the
7982
* type of the model class
8083
* that you want to convert the response body to.
84+
* @throws IOException if an I/O error occurs
8185
* @return The method is returning an object of type T, which is determined by
8286
* the input parameter
8387
* tClass.
@@ -106,23 +110,6 @@ public <T> T toModel(Class<T> tClass, String response) {
106110
return new Gson().fromJson(response, tClass);
107111
}
108112

109-
/**
110-
* The function converts a response body into a model object using Gson library
111-
* in Java.
112-
*
113-
* @param tClass The `tClass` parameter is a `Class` object that represents
114-
* the type of the model you
115-
* want to convert the response body to. It is used to specify
116-
* the type of the object that will be
117-
* created from the JSON response.
118-
* @param response The "response" parameter is of type "Response<ResponseBody>".
119-
* It represents the
120-
* response received from an HTTP request.
121-
* @return The method is returning an object of type T, which is the model class
122-
* specified by the
123-
* tClass parameter.
124-
*/
125-
126113
public <T> T toModel(Class<T> tClass, Response<ResponseBody> response) throws IOException {
127114
Objects.requireNonNull(tClass, MODEL_NULL_CHECK);
128115
Objects.requireNonNull(response, RESPONSE_NULL);

0 commit comments

Comments
 (0)