Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
61b38dc
changes to yaml as per new spec file
prachi-okta Sep 2, 2025
674fa56
skip validation set to false
prachi-okta Sep 2, 2025
6f56a94
fixing validation errors
prachi-okta Sep 3, 2025
0ecad93
increasing test coverage
prachi-okta Sep 10, 2025
f51be9d
testcases for coverage improvement
prachi-okta Sep 11, 2025
8d5b71d
writing testcases for api classes
prachi-okta Sep 22, 2025
cc620ca
tests
prachi-okta Sep 22, 2025
d00f3f1
Adding tests
prachi-okta Sep 22, 2025
929bb39
Adding tests
prachi-okta Sep 22, 2025
102f1b1
adding test files
prachi-okta Sep 22, 2025
2b51c0e
adding test files for all api files
prachi-okta Sep 23, 2025
69be913
save point
prachi-okta Oct 7, 2025
59e2b3c
updated tests
prachi-okta Oct 28, 2025
ad0a379
resolving cyclic dependency
prachi-okta Oct 29, 2025
9661982
fixing dependency issue, updating ITs
prachi-okta Oct 29, 2025
656a5b2
adding new tests and commenting out tests which throw internal server…
prachi-okta Oct 30, 2025
72dabdd
restore config
prachi-okta Oct 30, 2025
4cd78dc
updating major version
prachi-okta Oct 30, 2025
28c85af
fixing version and adding the header
prachi-okta Oct 30, 2025
8b8be8d
removing unused import
prachi-okta Oct 30, 2025
43cb943
fixing quickstart
prachi-okta Oct 30, 2025
764dfb1
fixing user integration test
prachi-okta Oct 30, 2025
f1d87b8
fixing user integration test
prachi-okta Oct 30, 2025
83743d6
fixing tests
prachi-okta Nov 7, 2025
eb14bde
Adding more integration tests
prachi-okta Nov 7, 2025
d27d4bb
cleaning junk files
prachi-okta Nov 7, 2025
169e19c
cleaning junk files
prachi-okta Nov 7, 2025
2809483
removing unused import
prachi-okta Nov 7, 2025
c137ff4
fixing ReadmeSnippets.java
prachi-okta Nov 7, 2025
2fce05e
adding more integration tests
prachi-okta Nov 10, 2025
257a6d5
adding more tests
prachi-okta Nov 11, 2025
303da44
adding more tests
prachi-okta Nov 11, 2025
2d9b4a4
fixing AppIT
prachi-okta Nov 11, 2025
4217896
fix dependency version
prachi-okta Nov 11, 2025
d237a31
adding clean up for parallelism
prachi-okta Nov 11, 2025
9516067
allocating more memory for reversing labs, reducing parallelism from …
prachi-okta Nov 11, 2025
818acf9
removing parallelism
prachi-okta Nov 12, 2025
307c2f9
fixing tests for parallelism
prachi-okta Nov 12, 2025
92e4197
Increase API coverage by adding Map parameter variant tests across 8 …
prachi-okta Nov 15, 2025
b6565ff
adding retry logic
prachi-okta Nov 15, 2025
9bb7399
adding retry logic
prachi-okta Nov 15, 2025
60a801d
increasing retry delay
prachi-okta Nov 15, 2025
e389993
clean up tests
prachi-okta Nov 15, 2025
4d87861
clean up tests
prachi-okta Nov 15, 2025
ed83524
pom.xml changes for coverage report
prachi-okta Nov 16, 2025
85a0f8e
Add retry logic for policy creation in testReplacePolicy
prachi-okta Nov 16, 2025
39e6d85
Resolving merge conflicts
prachi-okta Dec 2, 2025
030eed2
Fixing release version and resolving dependencies
prachi-okta Dec 4, 2025
b02aab9
Bumping up major version
prachi-okta Dec 4, 2025
6bf189e
changes to spec file and test cases
prachi-okta Dec 5, 2025
40ae5da
adding spec file updates, refactoring tests, and adding config files …
prachi-okta Dec 5, 2025
9cca6bf
Fix integration test failures for polymorphic type handling
prachi-okta Dec 5, 2025
f13153c
adding deserializer logic, improving tests
prachi-okta Dec 5, 2025
9bf02a2
fixing tests
prachi-okta Dec 5, 2025
5bb7e45
reverting spec
prachi-okta Dec 5, 2025
d00ec3c
fixing PMD violation flags
prachi-okta Dec 5, 2025
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
1 change: 0 additions & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ jobs:
# Run the wrapper, do not change anything here
- run:
name: Run Reversing Labs Wrapper Scanner
no_output_timeout: 45m
command: |
echo "Scanning " ${CIRCLE_WORKING_DIRECTORY/#\~/$HOME}/api
rl-wrapper \
Expand Down
2 changes: 2 additions & 0 deletions .mvn/jvm.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
-Xmx2g
-DmaxYamlCodePoints=10000000
1 change: 1 addition & 0 deletions .mvn/maven.config
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
-Dsnakeyaml.codepoint.limit=10000000
467 changes: 467 additions & 0 deletions MIGRATION-v25.0.0.md

Large diffs are not rendered by default.

73 changes: 70 additions & 3 deletions api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
<parent>
<groupId>com.okta.sdk</groupId>
<artifactId>okta-sdk-root</artifactId>
<version>24.0.2-SNAPSHOT</version>
<version>25.0.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

<artifactId>okta-sdk-api</artifactId>
Expand All @@ -36,12 +37,13 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<swagger-annotations.version>1.6.8</swagger-annotations.version>
<openapi-generator.version>7.11.0</openapi-generator.version>
<openapi-generator.version>7.15.0</openapi-generator.version>
<jackson-databind-nullable.version>0.2.6</jackson-databind-nullable.version>
<jakarta-annotation.version>2.1.1</jakarta-annotation.version>
<jsr305.version>3.0.2</jsr305.version>
<junit.version>4.13.2</junit.version>
<com.github.jknack.handlebars.version>4.4.0</com.github.jknack.handlebars.version>
<junit-version>5.10.2</junit-version>
</properties>

<dependencies>
Expand Down Expand Up @@ -129,10 +131,42 @@
<artifactId>handlebars-jackson2</artifactId>
<version>4.3.1</version>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.13.1</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<version>${junit-version}</version>
<scope>test</scope>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-clean-plugin</artifactId>
<version>3.2.0</version>
<configuration>
<filesets>
<fileset>
<directory>${project.build.directory}/generated-sources/openapi</directory>
<followSymlinks>false</followSymlinks>
</fileset>
</filesets>
<failOnError>false</failOnError>
<retryOnError>true</retryOnError>
</configuration>
</plugin>

<plugin>
<groupId>net.revelc.code.formatter</groupId>
<artifactId>formatter-maven-plugin</artifactId>
Expand Down Expand Up @@ -170,6 +204,12 @@
</exclusion>
</exclusions>
</dependency>
<!-- Override SnakeYAML to use 1.x which has configurable codepoint limit -->
<dependency>
<groupId>org.yaml</groupId>
<artifactId>snakeyaml</artifactId>
<version>1.33</version>
</dependency>
</dependencies>
<executions>
<execution>
Expand Down Expand Up @@ -238,14 +278,41 @@
</tags>
</configuration>
</plugin>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<executions>
<execution>
<id>prepare-agent</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>report</id>
<phase>test</phase>
<goals>
<goal>report</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>9</source>
<target>9</target>
</configuration>
</plugin>
</plugins>
</build>

<profiles>
<profile>
<id>ci</id>
<build>
<plugins>
<plugins>
<plugin>
<groupId>com.github.siom79.japicmp</groupId>
<artifactId>japicmp-maven-plugin</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@

import com.okta.commons.lang.Classes;
import com.okta.sdk.resource.model.OAuthEndpointAuthenticationMethod;
import com.okta.sdk.resource.model.OAuthGrantType;
import com.okta.sdk.resource.model.OAuthResponseType;
import com.okta.sdk.resource.model.OpenIdConnectApplicationConsentMethod;
import com.okta.sdk.resource.model.OpenIdConnectApplicationType;
Expand All @@ -36,9 +35,9 @@ static OIDCApplicationBuilder instance() {

OIDCApplicationBuilder setConsentMethod(OpenIdConnectApplicationConsentMethod consentMethod);

OIDCApplicationBuilder setGrantTypes(List<OAuthGrantType> grantTypes);
OIDCApplicationBuilder setGrantTypes(List<com.okta.sdk.resource.model.GrantType> grantTypes);

OIDCApplicationBuilder addGrantTypes(OAuthGrantType grantType);
OIDCApplicationBuilder addGrantTypes(com.okta.sdk.resource.model.GrantType grantType);

OIDCApplicationBuilder setLogoUri(String logoUri);

Expand Down Expand Up @@ -68,7 +67,7 @@ static OIDCApplicationBuilder instance() {

OIDCApplicationBuilder setTokenEndpointAuthMethod(OAuthEndpointAuthenticationMethod tokenEndpointAuthMethod);

OIDCApplicationBuilder setJwks(List<com.okta.sdk.resource.model.SchemasJsonWebKey> jsonWebKeyList);
OIDCApplicationBuilder setJwks(List<com.okta.sdk.resource.model.ListJwk200ResponseInner> schemasJsonWebKeys);

OIDCApplicationBuilder setImplicitAssignment(Boolean isImplicitAssignment);

Expand Down
7 changes: 7 additions & 0 deletions api/src/main/resources/custom_templates/ApiClient.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -796,6 +796,13 @@ protected List<ServerConfiguration> servers = new ArrayList<ServerConfiguration>
if (contentTypes.length == 0 || contentTypes[0].equals("*/*")) {
return "application/json";
}
// Prioritize multipart/form-data for file uploads
for (String contentType : contentTypes) {
if (contentType.contains("multipart/form-data")) {
return contentType;
}
}
// Then check for JSON
for (String contentType : contentTypes) {
if (isJsonMime(contentType)) {
return contentType;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
/*
* Copyright 2017-Present Okta, Inc.
*
* Licensed 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.
*/
package com.okta.sdk.helper;

import com.okta.sdk.resource.client.ApiException;
import com.okta.sdk.resource.model.Error;
import org.testng.annotations.Test;

import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
import static org.testng.Assert.*;

public class ApiExceptionHelperTest {

@Test
public void testGetErrorWithNullResponseBody() {
ApiException apiException = mock(ApiException.class);
when(apiException.getResponseBody()).thenReturn(null);

Error error = ApiExceptionHelper.getError(apiException);

assertNull(error, "Error should be null when response body is null");
}


@Test
public void testGetErrorWithInvalidJsonResponseBody() {
ApiException apiException = mock(ApiException.class);
String invalidJson = "This is not valid JSON";
when(apiException.getResponseBody()).thenReturn(invalidJson);

Error error = ApiExceptionHelper.getError(apiException);

assertNull(error, "Error should be null for invalid JSON");
}



@Test
public void testGetErrorWithEmptyJsonObject() {
ApiException apiException = mock(ApiException.class);
String emptyJson = "{}";
when(apiException.getResponseBody()).thenReturn(emptyJson);

Error error = ApiExceptionHelper.getError(apiException);

assertNotNull(error, "Error should not be null for empty JSON object");
assertNull(error.getErrorCode());
assertNull(error.getErrorSummary());
}
}
64 changes: 64 additions & 0 deletions api/src/test/java/com/okta/sdk/helper/HelperConstantsTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
/*
* Copyright 2017-Present Okta, Inc.
*
* Licensed 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.
*/
package com.okta.sdk.helper;

import org.testng.annotations.Test;

import java.util.StringJoiner;

import static org.testng.Assert.*;

public class HelperConstantsTest {

@Test
public void testQueryStringJoiner() {
// Test the behavior of the QUERY_STRING_JOINER
StringJoiner joiner = HelperConstants.QUERY_STRING_JOINER;

// Add some test values and verify the joined result
StringJoiner testJoiner = new StringJoiner("&");
testJoiner.add("param1=value1");
testJoiner.add("param2=value2");

// Create a new joiner with the same delimiter to compare behavior
StringJoiner constantJoiner = HelperConstants.QUERY_STRING_JOINER;
constantJoiner.add("param1=value1");
constantJoiner.add("param2=value2");

assertEquals(constantJoiner.toString(), testJoiner.toString());
assertEquals(constantJoiner.toString(), "param1=value1&param2=value2");
}

@Test
public void testAuthNames() {
// Verify the AUTH_NAMES array content
String[] authNames = HelperConstants.AUTH_NAMES;

assertEquals(authNames.length, 2, "AUTH_NAMES should contain exactly 2 elements");
assertEquals(authNames[0], "apiToken", "First auth name should be 'apiToken'");
assertEquals(authNames[1], "oauth2", "Second auth name should be 'oauth2'");
}

@Test
public void testMediaType() {
// Verify the MEDIA_TYPE array content
String[] mediaType = HelperConstants.MEDIA_TYPE;

assertEquals(mediaType.length, 1, "MEDIA_TYPE should contain exactly 1 element");
assertEquals(mediaType[0], "application/json",
"Media type value should match MediaType.APPLICATION_JSON_VALUE");
}
}
Loading