1
+ /*
2
+ * Copyright 2025 Conductor Authors.
3
+ * <p>
4
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
5
+ * the License. You may obtain a copy of the License at
6
+ * <p>
7
+ * http://www.apache.org/licenses/LICENSE-2.0
8
+ * <p>
9
+ * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
10
+ * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
11
+ * specific language governing permissions and limitations under the License.
12
+ */
13
+ package io .orkes .conductor .client .model ;
14
+
15
+ import org .junit .jupiter .api .Test ;
16
+
17
+ import static org .junit .jupiter .api .Assertions .*;
18
+
19
+ class TestConductorApplicationPojoMethods {
20
+
21
+ @ Test
22
+ void testConstructor () {
23
+ ConductorApplication application = new ConductorApplication ();
24
+ assertNotNull (application );
25
+ assertNull (application .getId ());
26
+ assertNull (application .getName ());
27
+ assertNull (application .getCreatedBy ());
28
+ }
29
+
30
+ @ Test
31
+ void testGetSetId () {
32
+ ConductorApplication application = new ConductorApplication ();
33
+ String id = "app123" ;
34
+ application .setId (id );
35
+ assertEquals (id , application .getId ());
36
+ }
37
+
38
+ @ Test
39
+ void testGetSetName () {
40
+ ConductorApplication application = new ConductorApplication ();
41
+ String name = "testApp" ;
42
+ application .setName (name );
43
+ assertEquals (name , application .getName ());
44
+ }
45
+
46
+ @ Test
47
+ void testGetSetCreatedBy () {
48
+ ConductorApplication application = new ConductorApplication ();
49
+ String createdBy = "user1" ;
50
+ application .setCreatedBy (createdBy );
51
+ assertEquals (createdBy , application .getCreatedBy ());
52
+ }
53
+
54
+ @ Test
55
+ void testFluentId () {
56
+ String id = "app123" ;
57
+ ConductorApplication application = new ConductorApplication ().id (id );
58
+ assertEquals (id , application .getId ());
59
+ }
60
+
61
+ @ Test
62
+ void testFluentName () {
63
+ String name = "testApp" ;
64
+ ConductorApplication application = new ConductorApplication ().name (name );
65
+ assertEquals (name , application .getName ());
66
+ }
67
+
68
+ @ Test
69
+ void testFluentCreatedBy () {
70
+ String createdBy = "user1" ;
71
+ ConductorApplication application = new ConductorApplication ().createdBy (createdBy );
72
+ assertEquals (createdBy , application .getCreatedBy ());
73
+ }
74
+
75
+ @ Test
76
+ void testChainedFluent () {
77
+ String id = "app123" ;
78
+ String name = "testApp" ;
79
+ String createdBy = "user1" ;
80
+
81
+ ConductorApplication application = new ConductorApplication ()
82
+ .id (id )
83
+ .name (name )
84
+ .createdBy (createdBy );
85
+
86
+ assertEquals (id , application .getId ());
87
+ assertEquals (name , application .getName ());
88
+ assertEquals (createdBy , application .getCreatedBy ());
89
+ }
90
+
91
+ @ Test
92
+ void testEquals () {
93
+ ConductorApplication app1 = new ConductorApplication ()
94
+ .id ("app123" )
95
+ .name ("testApp" )
96
+ .createdBy ("user1" );
97
+
98
+ ConductorApplication app2 = new ConductorApplication ()
99
+ .id ("app123" )
100
+ .name ("testApp" )
101
+ .createdBy ("user1" );
102
+
103
+ ConductorApplication app3 = new ConductorApplication ()
104
+ .id ("app456" )
105
+ .name ("testApp" )
106
+ .createdBy ("user1" );
107
+
108
+ assertEquals (app1 , app2 );
109
+ assertNotEquals (app1 , app3 );
110
+ assertNotEquals (app1 , null );
111
+ assertNotEquals (app1 , new Object ());
112
+ }
113
+
114
+ @ Test
115
+ void testHashCode () {
116
+ ConductorApplication app1 = new ConductorApplication ()
117
+ .id ("app123" )
118
+ .name ("testApp" )
119
+ .createdBy ("user1" );
120
+
121
+ ConductorApplication app2 = new ConductorApplication ()
122
+ .id ("app123" )
123
+ .name ("testApp" )
124
+ .createdBy ("user1" );
125
+
126
+ assertEquals (app1 .hashCode (), app2 .hashCode ());
127
+ }
128
+
129
+ @ Test
130
+ void testToString () {
131
+ ConductorApplication application = new ConductorApplication ()
132
+ .id ("app123" )
133
+ .name ("testApp" )
134
+ .createdBy ("user1" );
135
+
136
+ String toString = application .toString ();
137
+
138
+ assertTrue (toString .contains ("app123" ));
139
+ assertTrue (toString .contains ("testApp" ));
140
+ assertTrue (toString .contains ("user1" ));
141
+ }
142
+ }
0 commit comments