Skip to content

Commit f12e206

Browse files
committed
test: added unit tests
1 parent 8d3f457 commit f12e206

2 files changed

Lines changed: 35 additions & 14 deletions

File tree

pom.xml

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -57,16 +57,11 @@
5757
<version>3.0.0</version>
5858
</dependency>
5959

60+
<!-- Imported directly in Main/K8sScript; declared explicitly (also pulled in via retrofit) -->
6061
<dependency>
61-
<groupId>com.google.guava</groupId>
62-
<artifactId>guava</artifactId>
63-
<version>33.6.0-jre</version>
64-
</dependency>
65-
66-
<dependency>
67-
<artifactId>commons-lang3</artifactId>
68-
<groupId>org.apache.commons</groupId>
69-
<version>3.20.0</version>
62+
<groupId>com.squareup.okhttp3</groupId>
63+
<artifactId>okhttp</artifactId>
64+
<version>4.12.0</version>
7065
</dependency>
7166

7267
<dependency>
@@ -75,6 +70,13 @@
7570
<version>2.15.1</version>
7671
<scope>compile</scope>
7772
</dependency>
73+
74+
<!-- Required at runtime by commons-configuration2 (declared optional upstream) -->
75+
<dependency>
76+
<groupId>commons-beanutils</groupId>
77+
<artifactId>commons-beanutils</artifactId>
78+
<version>1.11.0</version>
79+
</dependency>
7880

7981
<dependency>
8082
<artifactId>junit-jupiter</artifactId>
@@ -88,10 +90,5 @@
8890
<artifactId>client-java</artifactId>
8991
<version>27.0.0</version>
9092
</dependency>
91-
<dependency>
92-
<groupId>com.google.code.gson</groupId>
93-
<artifactId>gson</artifactId>
94-
<version>2.14.0</version>
95-
</dependency>
9693
</dependencies>
9794
</project>
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
package in.rsh.scripts;
2+
3+
import static org.junit.jupiter.api.Assertions.assertNotNull;
4+
import static org.junit.jupiter.api.Assertions.assertSame;
5+
6+
import com.google.inject.Injector;
7+
import org.junit.jupiter.api.Test;
8+
9+
class MainTest {
10+
11+
@Test
12+
void injectorIsCreated() {
13+
Injector injector = Main.getInjector();
14+
assertNotNull(injector, "Guice injector should be created");
15+
}
16+
17+
@Test
18+
void injectorIsSingleton() {
19+
assertSame(
20+
Main.getInjector(),
21+
Main.getInjector(),
22+
"getInjector() should return the same cached instance");
23+
}
24+
}

0 commit comments

Comments
 (0)