Skip to content

Commit e1e5032

Browse files
authored
Merge pull request #33 from brettchaldecott/fix/code-coverage-2
fix: Added aggregation project and fixed pom files
2 parents 0fa14ae + 36ec2c8 commit e1e5032

File tree

7 files changed

+177
-61
lines changed

7 files changed

+177
-61
lines changed

.github/workflows/maven.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,6 @@ jobs:
3535
- name: Upload coverage to Codecov
3636
uses: codecov/codecov-action@v4
3737
with:
38-
files: '**/target/site/jacoco/jacoco.xml'
38+
files: 'kinde-report-aggregate/target/site/jacoco-aggregate/jacoco.xml'
3939
env:
4040
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

kinde-core/pom.xml

Lines changed: 6 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -98,60 +98,13 @@
9898
</dependencies>
9999
<build>
100100
<plugins>
101-
<plugin>
102-
<groupId>org.apache.maven.plugins</groupId>
103-
<artifactId>maven-surefire-plugin</artifactId>
104-
<version>3.2.5</version>
105-
<configuration>
106-
<parallel>none</parallel>
107-
</configuration>
108-
</plugin>
109101
<plugin>
110-
<groupId>org.jacoco</groupId>
111-
<artifactId>jacoco-maven-plugin</artifactId>
112-
<version>0.8.12</version> <!-- Replace with the latest version -->
113-
<executions>
114-
<execution>
115-
<goals>
116-
<goal>prepare-agent</goal>
117-
</goals>
118-
</execution>
119-
<execution>
120-
<id>report</id>
121-
<phase>prepare-package</phase>
122-
<goals>
123-
<goal>report</goal>
124-
</goals>
125-
</execution>
126-
<execution>
127-
<id>post-unit-test</id>
128-
<phase>test</phase>
129-
<goals>
130-
<goal>report</goal>
131-
</goals>
132-
<configuration>
133-
<outputDirectory>${project.build.directory}/jacoco</outputDirectory>
134-
<dataFile>${project.build.directory}/jacoco/jacoco.exec</dataFile>
135-
<reportFormats>
136-
<format>HTML</format>
137-
<format>XML</format>
138-
</reportFormats>
139-
<append>true</append>
140-
<skip>false</skip>
141-
<includes>
142-
<include>com/kinde/**</include>
143-
</includes>
144-
<excludes>
145-
<exclude>com/google/inject/**/*.class</exclude>
146-
<exclude>javax/inject/**/*.class</exclude>
147-
<exclude>org/springframework/**/*.class</exclude>
148-
<exclude>**/generated/**</exclude>
149-
<exclude>**/thirdparty/**</exclude>
150-
<!-- Add more excludes if necessary -->
151-
</excludes>
152-
</configuration>
153-
</execution>
154-
</executions>
102+
<groupId>org.apache.maven.plugins</groupId>
103+
<artifactId>maven-surefire-plugin</artifactId>
104+
<version>3.2.5</version>
105+
<configuration>
106+
<parallel>none</parallel>
107+
</configuration>
155108
</plugin>
156109
<plugin>
157110
<groupId>org.sonatype.plugins</groupId>

kinde-management/pom.xml

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,10 +162,31 @@
162162
</execution>
163163
</executions>
164164
</plugin>
165+
<plugin>
166+
<groupId>org.apache.maven.plugins</groupId>
167+
<artifactId>maven-antrun-plugin</artifactId>
168+
<version>3.0.0</version>
169+
<executions>
170+
<execution>
171+
<phase>generate-sources</phase>
172+
<configuration>
173+
<target>
174+
<echo>Fixing syntax error in generated OpenAPI code</echo>
175+
<replace file="target/generated-sources/openapi/src/gen/java/main/org/openapitools/client/model/UpdateApplicationsPropertyRequestValue.java"
176+
token="(token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE));"
177+
value="(token == JsonToken.VALUE_FALSE || token == JsonToken.VALUE_TRUE);"/>
178+
</target>
179+
</configuration>
180+
<goals>
181+
<goal>run</goal>
182+
</goals>
183+
</execution>
184+
</executions>
185+
</plugin>
165186
<plugin>
166187
<groupId>org.jacoco</groupId>
167188
<artifactId>jacoco-maven-plugin</artifactId>
168-
<version>0.8.10</version> <!-- Replace with the latest version -->
189+
<version>0.8.12</version> <!-- Replace with the latest version -->
169190
<executions>
170191
<execution>
171192
<goals>
@@ -203,6 +224,7 @@
203224
<exclude>org/springframework/**/*.class</exclude>
204225
<exclude>**/generated/**</exclude>
205226
<exclude>**/thirdparty/**</exclude>
227+
<exclude>**/openapitools/**</exclude>
206228
<!-- Add more excludes if necessary -->
207229
</excludes>
208230
</configuration>

kinde-management/src/main/java/com/kinde/admin/KindeAdminSessionImpl.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,12 @@
33
import com.kinde.KindeAdminSession;
44
import com.kinde.KindeClient;
55
import com.kinde.token.AccessToken;
6-
import com.kinde.token.KindeToken;
76
import com.kinde.token.KindeTokens;
87
import org.openapitools.client.ApiClient;
98
import org.openapitools.client.auth.Authentication;
109
import org.openapitools.client.auth.HttpBearerAuth;
11-
import org.openapitools.client.auth.OAuth;
1210

1311
import java.util.HashMap;
14-
import java.util.List;
1512
import java.util.Map;
1613

1714
public class KindeAdminSessionImpl implements KindeAdminSession {
@@ -35,11 +32,8 @@ public ApiClient initClient() {
3532
HttpBearerAuth httpBearerAuth = new HttpBearerAuth("bearer");
3633
httpBearerAuth.setBearerToken(accessToken.token());
3734
Map<String, Authentication> authMap = new HashMap<>();
38-
authMap.put("ManagementAPI",new OAuth(
39-
kindeClient.kindeConfig().domain(),kindeClient.oidcMetaData().getOpMetadata().getTokenEndpointURI().toString()));
4035
ApiClient apiClient = new ApiClient(authMap);
4136
apiClient.setBasePath(kindeClient.kindeConfig().domain());
42-
apiClient.setAccessToken(accessToken.token());
4337
return apiClient;
4438
}
4539
}

kinde-report-aggregate/pom.xml

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
Copyright (c) 2009, 2024 Mountainminds GmbH & Co. KG and Contributors
4+
This program and the accompanying materials are made available under
5+
the terms of the Eclipse Public License 2.0 which is available at
6+
http://www.eclipse.org/legal/epl-2.0
7+
8+
SPDX-License-Identifier: EPL-2.0
9+
10+
Contributors:
11+
Marc R. Hoffmann, Jan Wloka - initial API and implementation
12+
-->
13+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
14+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
15+
<modelVersion>4.0.0</modelVersion>
16+
17+
<parent>
18+
<groupId>com.kinde</groupId>
19+
<artifactId>kinde-parent-pom</artifactId>
20+
<version>2.0.0</version>
21+
</parent>
22+
23+
<properties>
24+
<kinde-version>2.0.0</kinde-version>
25+
</properties>
26+
27+
<artifactId>report</artifactId>
28+
<name>Aggregate Report</name>
29+
<version>2.0.0</version>
30+
31+
<dependencies>
32+
<dependency>
33+
<groupId>com.kinde</groupId>
34+
<artifactId>kinde-core</artifactId>
35+
</dependency>
36+
<dependency>
37+
<groupId>com.kinde</groupId>
38+
<artifactId>kinde-j2ee</artifactId>
39+
</dependency>
40+
<dependency>
41+
<groupId>com.kinde</groupId>
42+
<artifactId>kinde-management</artifactId>
43+
</dependency>
44+
<dependency>
45+
<groupId>com.kinde.spring</groupId>
46+
<artifactId>kinde-springboot-core</artifactId>
47+
</dependency>
48+
49+
<dependency>
50+
<groupId>junit</groupId>
51+
<artifactId>junit</artifactId>
52+
<version>4.13.2</version>
53+
<scope>test</scope>
54+
</dependency>
55+
<!-- https://mvnrepository.com/artifact/org.junit.jupiter/junit-jupiter-api -->
56+
<dependency>
57+
<groupId>org.junit.jupiter</groupId>
58+
<artifactId>junit-jupiter-api</artifactId>
59+
<version>5.11.0</version>
60+
</dependency>
61+
62+
</dependencies>
63+
64+
<build>
65+
<plugins>
66+
<plugin>
67+
<groupId>org.jacoco</groupId>
68+
<artifactId>jacoco-maven-plugin</artifactId>
69+
<version>0.8.12</version>
70+
<executions>
71+
<execution>
72+
<id>report-aggregate</id>
73+
<phase>verify</phase>
74+
<goals>
75+
<goal>report-aggregate</goal>
76+
</goals>
77+
</execution>
78+
</executions>
79+
</plugin>
80+
</plugins>
81+
</build>
82+
83+
</project>
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
package com.kinde;
2+
3+
import org.junit.Test;
4+
5+
public class ReportTest {
6+
7+
@Test
8+
public void test() {
9+
}
10+
11+
}

pom.xml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,21 @@
154154
<artifactId>kinde-core</artifactId>
155155
<version>2.0.0</version>
156156
</dependency>
157+
<dependency>
158+
<groupId>com.kinde</groupId>
159+
<artifactId>kinde-management</artifactId>
160+
<version>2.0.0</version>
161+
</dependency>
162+
<dependency>
163+
<groupId>com.kinde</groupId>
164+
<artifactId>kinde-j2ee</artifactId>
165+
<version>2.0.0</version>
166+
</dependency>
167+
<dependency>
168+
<groupId>com.kinde.spring</groupId>
169+
<artifactId>kinde-springboot-core</artifactId>
170+
<version>2.0.0</version>
171+
</dependency>
157172
</dependencies>
158173
</dependencyManagement>
159174

@@ -168,6 +183,7 @@
168183
<module>playground/kinde-springboot-starter-example</module>
169184
<module>playground/springboot-pkce-client-example</module>
170185
<module>playground/springboot-thymeleaf-full-example</module>
186+
<module>kinde-report-aggregate</module>
171187
</modules>
172188

173189
<distributionManagement>
@@ -207,6 +223,13 @@
207223
<configuration>
208224
<source>17</source>
209225
<target>17</target>
226+
<annotationProcessorPaths>
227+
<path>
228+
<groupId>org.projectlombok</groupId>
229+
<artifactId>lombok</artifactId>
230+
<version>1.18.34</version> <!-- Use the version you need -->
231+
</path>
232+
</annotationProcessorPaths>
210233
</configuration>
211234
</plugin>
212235

@@ -267,7 +290,37 @@
267290
</execution>
268291
</executions>
269292
</plugin>
293+
294+
<plugin>
295+
<groupId>org.jacoco</groupId>
296+
<artifactId>jacoco-maven-plugin</artifactId>
297+
<version>0.8.12</version>
298+
<executions>
299+
<execution>
300+
<id>prepare-agent</id>
301+
<goals>
302+
<goal>prepare-agent</goal>
303+
</goals>
304+
</execution>
305+
</executions>
306+
<configuration>
307+
<includes>
308+
<include>com/kinde/**</include>
309+
</includes>
310+
<excludes>
311+
<exclude>com/google/inject/**/*.class</exclude>
312+
<exclude>javax/inject/**/*.class</exclude>
313+
<exclude>org/springframework/**/*.class</exclude>
314+
<exclude>**/generated/**</exclude>
315+
<exclude>**/thirdparty/**</exclude>
316+
<exclude>**/openapitools/**</exclude>
317+
<!-- Add more excludes if necessary -->
318+
</excludes>
319+
</configuration>
320+
</plugin>
270321
</plugins>
322+
323+
271324
</build>
272325

273326
</project>

0 commit comments

Comments
 (0)