Skip to content

Commit 3c318ff

Browse files
authored
Resolve VCSWP-20045 (Java SDK: Add hashCodeEquals tests to JavaSDK) (#46)
* Add hashCodeEquals tests to each class test file in the java sdk * Update version and update TranscribeUtterance feature tests for the hashCodeEquals tests * Add negative test case for hashCodeEquals tests * Update version after rebasing * Update version for java sdk * Add new changelog entry
1 parent c44b150 commit 3c318ff

File tree

142 files changed

+8429
-2795
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

142 files changed

+8429
-2795
lines changed

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,14 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
99

1010
None
1111

12+
<a name="5.5.3"></a>
13+
14+
## [5.5.3] - 2023-09-11
15+
16+
### Added
17+
18+
- HashCode equals test cases for all models in SDK
19+
1220
<a name="5.5.2"></a>
1321

1422
## [5.5.2] - 2023-09-06

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ Add this dependency to your project's POM:
4040
<dependency>
4141
<groupId>com.github.freeclimbapi</groupId>
4242
<artifactId>freeclimb-java-client</artifactId>
43-
<version>5.5.2</version>
43+
<version>5.5.3</version>
4444
<scope>compile</scope>
4545
</dependency>
4646
```
@@ -56,7 +56,7 @@ Add this dependency to your project's build file:
5656
}
5757
5858
dependencies {
59-
implementation "com.github.freeclimbapi:freeclimb-java-client:5.5.2"
59+
implementation "com.github.freeclimbapi:freeclimb-java-client:5.5.3"
6060
implementation("com.squareup.okhttp3:okhttp:4.9.3")
6161
implementation("com.squareup.okhttp3:logging-interceptor:4.9.3")
6262
}
@@ -72,7 +72,7 @@ mvn clean package
7272

7373
Then manually install the following JARs:
7474

75-
* `target/freeclimb-java-client-5.5.2.jar`
75+
* `target/freeclimb-java-client-5.5.3.jar`
7676
* `target/lib/*.jar`
7777

7878
## Getting Started

build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ apply plugin: 'java'
44
apply plugin: 'com.diffplug.spotless'
55

66
group = 'com.github.freeclimbapi'
7-
version = '5.5.2'
7+
version = '5.5.3'
88

99
buildscript {
1010
repositories {

build.sbt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ lazy val root = (project in file(".")).
22
settings(
33
organization := "com.github.freeclimbapi",
44
name := "freeclimb-java-client",
5-
version := "5.5.2",
5+
version := "5.5.3",
66
scalaVersion := "2.11.4",
77
scalacOptions ++= Seq("-feature"),
88
javacOptions in compile ++= Seq("-Xlint:deprecation"),

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<artifactId>freeclimb-java-client</artifactId>
66
<packaging>jar</packaging>
77
<name>freeclimb-java-client</name>
8-
<version>5.5.2</version>
8+
<version>5.5.3</version>
99
<url>https://github.com/freeclimbapi/java-sdk</url>
1010
<description>FreeClimb Java Client</description>
1111
<scm>

src/main/java/com/github/freeclimbapi/ApiClient.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ private void init() {
131131
json = new JSON();
132132

133133
// Set default User-Agent.
134-
setUserAgent("OpenAPI-Generator/5.5.2/java");
134+
setUserAgent("OpenAPI-Generator/5.5.3/java");
135135

136136
authentications = new HashMap<String, Authentication>();
137137
}

src/test/java/com/github/freeclimbapi/AccountRequestTest.java

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,36 @@ public void toStringEqualsTest() {
122122
Assert.assertEquals(toString1, toString2);
123123
}
124124

125+
/**
126+
* Test the method 'hashCodeEqualsTrue'
127+
*/
128+
129+
@Test
130+
public void hashCodeEqualsTrueTest() {
131+
AccountRequest test1 = new AccountRequest();
132+
test1.setAlias("TS");
133+
test1.setLabel("TS");
134+
AccountRequest test2 = new AccountRequest();
135+
test2.setAlias("TS");
136+
test2.setLabel("TS");
137+
Assert.assertEquals(test1.hashCode(), test2.hashCode());
138+
}
139+
140+
/**
141+
* Test the method 'hashCodeEqualsFalse'
142+
*/
143+
144+
@Test
145+
public void hashCodeEqualsFalseTest() {
146+
AccountRequest test1 = new AccountRequest();
147+
test1.setAlias("TS");
148+
test1.setLabel("TS");
149+
AccountRequest test2 = new AccountRequest();
150+
test2.setAlias("tS");
151+
test2.setLabel("tS");
152+
Assert.assertNotEquals(test1.hashCode(), test2.hashCode());
153+
}
154+
125155
/**
126156
* Test the method 'toStringType'
127157
*/

src/test/java/com/github/freeclimbapi/AccountResultAllOfTest.java

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,60 @@ public void toStringEqualsTest() {
221221
Assert.assertEquals(toString1, toString2);
222222
}
223223

224+
/**
225+
* Test the method 'hashCodeEqualsTrue'
226+
*/
227+
228+
@Test
229+
public void hashCodeEqualsTrueTest() {
230+
AccountResultAllOf test1 = new AccountResultAllOf();
231+
test1.setAccountId("TS");
232+
test1.setApiKey("TS");
233+
test1.setAlias("TS");
234+
test1.setLabel("TS");
235+
test1.setType(AccountType.TRIAL);
236+
test1.setStatus(AccountStatus.CLOSED);
237+
Object testObject = new Object();
238+
test1.setSubresourceUris(testObject);
239+
AccountResultAllOf test2 = new AccountResultAllOf();
240+
test2.setAccountId("TS");
241+
test2.setApiKey("TS");
242+
test2.setAlias("TS");
243+
test2.setLabel("TS");
244+
test2.setType(AccountType.TRIAL);
245+
test2.setStatus(AccountStatus.CLOSED);
246+
Object testObject2 = testObject;
247+
test2.setSubresourceUris(testObject2);
248+
Assert.assertEquals(test1.hashCode(), test2.hashCode());
249+
}
250+
251+
/**
252+
* Test the method 'hashCodeEqualsFalse'
253+
*/
254+
255+
@Test
256+
public void hashCodeEqualsFalseTest() {
257+
AccountResultAllOf test1 = new AccountResultAllOf();
258+
test1.setAccountId("TS");
259+
test1.setApiKey("TS");
260+
test1.setAlias("TS");
261+
test1.setLabel("TS");
262+
test1.setType(AccountType.TRIAL);
263+
test1.setStatus(AccountStatus.CLOSED);
264+
Object testObject = new Object();
265+
test1.setSubresourceUris(testObject);
266+
AccountResultAllOf test2 = new AccountResultAllOf();
267+
test2.setAccountId("tS");
268+
test2.setApiKey("tS");
269+
test2.setAlias("tS");
270+
test2.setLabel("tS");
271+
test2.setType(AccountType.TRIAL);
272+
test2.setStatus(AccountStatus.CLOSED);
273+
Object testObject2 = new Object();
274+
test2.setSubresourceUris(testObject2);
275+
Assert.assertNotEquals(test1.hashCode(), test2.hashCode());
276+
}
277+
224278
/**
225279
* Test the method 'toStringType'
226280
*/

src/test/java/com/github/freeclimbapi/AccountResultTest.java

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,76 @@ public void toStringEqualsTest() {
289289
Assert.assertEquals(toString1, toString2);
290290
}
291291

292+
/**
293+
* Test the method 'hashCodeEqualsTrue'
294+
*/
295+
296+
@Test
297+
public void hashCodeEqualsTrueTest() {
298+
AccountResult test1 = new AccountResult();
299+
test1.setUri("TS");
300+
test1.setDateCreated("TS");
301+
test1.setDateUpdated("TS");
302+
test1.setRevision(1);
303+
test1.setAccountId("TS");
304+
test1.setApiKey("TS");
305+
test1.setAlias("TS");
306+
test1.setLabel("TS");
307+
test1.setType(AccountType.TRIAL);
308+
test1.setStatus(AccountStatus.CLOSED);
309+
Object testObject = new Object();
310+
test1.setSubresourceUris(testObject);
311+
AccountResult test2 = new AccountResult();
312+
test2.setUri("TS");
313+
test2.setDateCreated("TS");
314+
test2.setDateUpdated("TS");
315+
test2.setRevision(1);
316+
test2.setAccountId("TS");
317+
test2.setApiKey("TS");
318+
test2.setAlias("TS");
319+
test2.setLabel("TS");
320+
test2.setType(AccountType.TRIAL);
321+
test2.setStatus(AccountStatus.CLOSED);
322+
Object testObject2 = testObject;
323+
test2.setSubresourceUris(testObject2);
324+
Assert.assertEquals(test1.hashCode(), test2.hashCode());
325+
}
326+
327+
/**
328+
* Test the method 'hashCodeEqualsFalse'
329+
*/
330+
331+
@Test
332+
public void hashCodeEqualsFalseTest() {
333+
AccountResult test1 = new AccountResult();
334+
test1.setUri("TS");
335+
test1.setDateCreated("TS");
336+
test1.setDateUpdated("TS");
337+
test1.setRevision(1);
338+
test1.setAccountId("TS");
339+
test1.setApiKey("TS");
340+
test1.setAlias("TS");
341+
test1.setLabel("TS");
342+
test1.setType(AccountType.TRIAL);
343+
test1.setStatus(AccountStatus.CLOSED);
344+
Object testObject = new Object();
345+
test1.setSubresourceUris(testObject);
346+
AccountResult test2 = new AccountResult();
347+
test2.setUri("tS");
348+
test2.setDateCreated("tS");
349+
test2.setDateUpdated("tS");
350+
test2.setRevision(0);
351+
test2.setAccountId("tS");
352+
test2.setApiKey("tS");
353+
test2.setAlias("tS");
354+
test2.setLabel("tS");
355+
test2.setType(AccountType.TRIAL);
356+
test2.setStatus(AccountStatus.CLOSED);
357+
Object testObject2 = new Object();
358+
test2.setSubresourceUris(testObject2);
359+
Assert.assertNotEquals(test1.hashCode(), test2.hashCode());
360+
}
361+
292362
/**
293363
* Test the method 'toStringType'
294364
*/

src/test/java/com/github/freeclimbapi/AccountStatusTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
* Model tests for AccountStatus
3737
*/
3838
public class AccountStatusTest {
39-
@Test
39+
@Test
4040
public void testCLOSEDShouldWork() {
4141

4242
AccountStatus test = AccountStatus.CLOSED;
@@ -58,7 +58,7 @@ public void testCLOSEDShouldDeserializeToString() {
5858
String calculatedValue = test.toString();
5959
Assert.assertEquals(expectedValue, calculatedValue);
6060
}
61-
@Test
61+
@Test
6262
public void testSUSPENDEDShouldWork() {
6363

6464
AccountStatus test = AccountStatus.SUSPENDED;
@@ -80,7 +80,7 @@ public void testSUSPENDEDShouldDeserializeToString() {
8080
String calculatedValue = test.toString();
8181
Assert.assertEquals(expectedValue, calculatedValue);
8282
}
83-
@Test
83+
@Test
8484
public void testACTIVEShouldWork() {
8585

8686
AccountStatus test = AccountStatus.ACTIVE;

0 commit comments

Comments
 (0)