This repository has been archived by the owner on Feb 3, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'release/v1.2.3' into public-main
- Loading branch information
Showing
38 changed files
with
586 additions
and
455 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<component name="ProjectRunConfigurationManager"> | ||
<configuration default="false" name="Run integration tests" type="GradleRunConfiguration" factoryName="Gradle"> | ||
<ExternalSystemSettings> | ||
<option name="executionName" /> | ||
<option name="externalProjectPath" value="$PROJECT_DIR$" /> | ||
<option name="externalSystemIdString" value="GRADLE" /> | ||
<option name="scriptParameters" value="" /> | ||
<option name="taskDescriptions"> | ||
<list /> | ||
</option> | ||
<option name="taskNames"> | ||
<list> | ||
<option value="intTest" /> | ||
</list> | ||
</option> | ||
<option name="vmOptions" /> | ||
</ExternalSystemSettings> | ||
<ExternalSystemDebugServerProcess>true</ExternalSystemDebugServerProcess> | ||
<ExternalSystemReattachDebugProcess>true</ExternalSystemReattachDebugProcess> | ||
<DebugAllEnabled>false</DebugAllEnabled> | ||
<method v="2" /> | ||
</configuration> | ||
</component> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<component name="ProjectRunConfigurationManager"> | ||
<configuration default="false" name="Run unit tests" type="GradleRunConfiguration" factoryName="Gradle"> | ||
<ExternalSystemSettings> | ||
<option name="executionName" /> | ||
<option name="externalProjectPath" value="$PROJECT_DIR$" /> | ||
<option name="externalSystemIdString" value="GRADLE" /> | ||
<option name="scriptParameters" value="-x signArchives" /> | ||
<option name="taskDescriptions"> | ||
<list /> | ||
</option> | ||
<option name="taskNames"> | ||
<list> | ||
<option value="test" /> | ||
</list> | ||
</option> | ||
<option name="vmOptions" /> | ||
</ExternalSystemSettings> | ||
<ExternalSystemDebugServerProcess>true</ExternalSystemDebugServerProcess> | ||
<ExternalSystemReattachDebugProcess>true</ExternalSystemReattachDebugProcess> | ||
<DebugAllEnabled>false</DebugAllEnabled> | ||
<method v="2" /> | ||
</configuration> | ||
</component> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
distributionBase=GRADLE_USER_HOME | ||
distributionPath=wrapper/dists | ||
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.2-bin.zip | ||
zipStoreBase=GRADLE_USER_HOME | ||
zipStorePath=wrapper/dists |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<module type="JAVA_MODULE" version="4"> | ||
<component name="NewModuleRootManager" inherit-compiler-output="true"> | ||
<exclude-output /> | ||
<content url="file://$MODULE_DIR$"> | ||
<sourceFolder url="file://$MODULE_DIR$/kotlin" isTestSource="true" /> | ||
</content> | ||
<orderEntry type="inheritedJdk" /> | ||
<orderEntry type="sourceFolder" forTests="true" /> | ||
<orderEntry type="library" scope="TEST" name="Gradle: org.jetbrains.kotlin:kotlin-stdlib:1.6.21" level="project" /> | ||
</component> | ||
</module> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
// Copyright © 2020 IBA Group, a.s. All rights reserved. Use of this source code is governed by Eclipse Public License – v 2.0 that can be found at: https://www.eclipse.org/legal/epl-2.0/ | ||
|
||
package common | ||
|
||
import eu.ibagroup.r2z.CancelJobRequest | ||
import eu.ibagroup.r2z.CancelJobRequestBody | ||
import eu.ibagroup.r2z.JESApi | ||
import org.junit.jupiter.api.Assertions | ||
import org.junit.jupiter.api.Test | ||
import retrofit2.Call | ||
import retrofit2.Retrofit | ||
import retrofit2.converter.gson.GsonConverterFactory | ||
|
||
class CancelJobTest : BaseTest() { | ||
val JOB_ID = "JOB06200" | ||
val JOB_NAME = "NOTHINGJ" | ||
|
||
val JOB_CORRELATOR = "J0001561S0W1....D940967F.......:" | ||
|
||
// 0 - request was successful | ||
val SUCCESSFUL_REQUEST_RESULT = "0" | ||
|
||
@Test | ||
fun cancelJobTest() { | ||
val retrofit = Retrofit.Builder() | ||
.baseUrl(BASE_URL) | ||
.addConverterFactory(GsonConverterFactory.create()) | ||
.client(getUnsafeOkHttpClient()) | ||
.build() | ||
|
||
val request = retrofit.create(JESApi::class.java) | ||
val call: Call<CancelJobRequest> = request | ||
.cancelJobRequest( | ||
BASIC_AUTH_TOKEN, | ||
JOB_NAME, | ||
JOB_ID, | ||
CancelJobRequestBody() | ||
) | ||
enqueueCancelJobCallAndCheckResult(call) | ||
} | ||
|
||
fun enqueueCancelJobCallAndCheckResult(call: Call<CancelJobRequest>) { | ||
val response = call.execute() | ||
|
||
if (response.isSuccessful) | ||
{ | ||
val jobStatus: CancelJobRequest = response.body() as CancelJobRequest | ||
println(jobStatus.status) | ||
Assertions.assertEquals(SUCCESSFUL_REQUEST_RESULT, jobStatus.status) | ||
Assertions.assertNotNull(jobStatus.owner) | ||
Assertions.assertEquals(jobStatus.owner?.lowercase(), "hlh") | ||
} else | ||
{ | ||
println(response.errorBody()) | ||
Assertions.assertTrue(false) | ||
} | ||
} | ||
} |
3 changes: 2 additions & 1 deletion
3
...est/kotlin/eu/ibagroup/r2z/DataAPITest.kt → src/intTest/kotlin/common/DataAPITest.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
// Copyright © 2020 IBA Group, a.s. All rights reserved. Use of this source code is governed by Eclipse Public License – v 2.0 that can be found at: https://www.eclipse.org/legal/epl-2.0/ | ||
package common | ||
|
||
import eu.ibagroup.r2z.* | ||
import org.junit.jupiter.api.Assertions | ||
import org.junit.jupiter.api.Test | ||
import retrofit2.Call | ||
import retrofit2.Retrofit | ||
import retrofit2.converter.gson.GsonConverterFactory | ||
import java.util.* | ||
|
||
class HoldJobFor10sThenReleaseTest : BaseTest() { | ||
val JOB_ID = "JOB06152" | ||
val JOB_NAME = "NOTHINGJ" | ||
|
||
val JOB_CORRELATOR = "J0001561S0W1....D940967F.......:" | ||
|
||
// 0 - request was successful | ||
val SUCCESSFUL_REQUEST_RESULT = 0 | ||
|
||
@Test | ||
fun holdFor10sThenReleaseJobTest() { | ||
val retrofit = Retrofit.Builder() | ||
.baseUrl(BASE_URL) | ||
.addConverterFactory(GsonConverterFactory.create()) | ||
.client(getUnsafeOkHttpClient()) | ||
.build() | ||
|
||
val request = retrofit.create(JESApi::class.java) | ||
val firstCall: Call<HoldJobRequest> = request | ||
.holdJobRequest( | ||
BASIC_AUTH_TOKEN, | ||
JOB_NAME, | ||
JOB_ID, | ||
HoldJobRequestBody() | ||
) | ||
|
||
enqueueHoldCallAndCheckResult(firstCall) | ||
|
||
Thread.sleep(10000) | ||
|
||
val secondCall: Call<ReleaseJobRequest> = request | ||
.releaseJobRequest( | ||
BASIC_AUTH_TOKEN, | ||
JOB_NAME, | ||
JOB_ID, | ||
ReleaseJobRequestBody() | ||
) | ||
|
||
enqueueReleaseCallAndCheckResult(secondCall) | ||
} | ||
|
||
fun enqueueHoldCallAndCheckResult(call: Call<HoldJobRequest>) { | ||
val response = call.execute() | ||
if (response.isSuccessful) { | ||
val jobStatus: HoldJobRequest = response.body() as HoldJobRequest | ||
println(jobStatus.status) | ||
Assertions.assertEquals(SUCCESSFUL_REQUEST_RESULT, jobStatus.status) | ||
Assertions.assertNotNull(jobStatus.owner) | ||
Assertions.assertEquals(jobStatus.owner?.lowercase(Locale.getDefault()), "hlh") | ||
} else { | ||
println(response.errorBody()) | ||
Assertions.assertTrue(false) | ||
} | ||
} | ||
|
||
fun enqueueReleaseCallAndCheckResult(call: Call<ReleaseJobRequest>) { | ||
val response = call.execute() | ||
if (response.isSuccessful) { | ||
val jobStatus: ReleaseJobRequest = response.body() as ReleaseJobRequest | ||
println(jobStatus.status) | ||
Assertions.assertEquals(SUCCESSFUL_REQUEST_RESULT, jobStatus.status) | ||
Assertions.assertNotNull(jobStatus.owner) | ||
Assertions.assertEquals(jobStatus.owner?.lowercase(Locale.getDefault()), "hlh") | ||
} else { | ||
println(response.errorBody()) | ||
Assertions.assertTrue(false) | ||
} | ||
} | ||
} |
Oops, something went wrong.