Skip to content

Commit 029b123

Browse files
authored
Update jar link and version (#31)
* update the agent jar link * update the agent jar link and version
1 parent d75df6f commit 029b123

1 file changed

Lines changed: 33 additions & 43 deletions

File tree

README.md

Lines changed: 33 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ A sample Employee-Manager app to test Keploy integration capabilities using [Spr
66

77
- [Java 8+](https://docs.spring.io/spring-boot/docs/current/reference/html/getting-started.html#getting-started.installing)
88

9-
## Quick Installation
9+
## Quick Installation
1010

11-
### **MacOS**
11+
### **MacOS**
1212

1313
```shell
1414
curl --silent --location "https://github.com/keploy/keploy/releases/latest/download/keploy_darwin_all.tar.gz" | tar xz -C /tmp
@@ -26,6 +26,7 @@ curl --silent --location "https://github.com/keploy/keploy/releases/latest/downl
2626

2727
sudo mv /tmp/keploy /usr/local/bin && keploy
2828
```
29+
2930
</details>
3031

3132
<details>
@@ -38,16 +39,15 @@ sudo mv /tmp/keploy /usr/local/bin && keploy
3839
```
3940

4041
The UI can be accessed at http://localhost:6789
42+
4143
</details>
4244

4345
### **Windows**
4446

4547
<details>
4648
<summary>Windows</summary>
4749

48-
4950
- Download the [Keploy Windows AMD64](https://github.com/keploy/keploy/releases/latest/download/keploy_windows_amd64.tar.gz), and extract the files from the zip folder.
50-
5151
- Run the `keploy.exe` file.
5252

5353
</details>
@@ -56,7 +56,6 @@ The UI can be accessed at http://localhost:6789
5656
<summary>Windows ARM</summary>
5757

5858
- Download the [Keploy Windows ARM64](https://github.com/keploy/keploy/releases/latest/download/keploy_windows_arm64.tar.gz), and extract the files from the zip folder.
59-
6059
- Run the `keploy.exe` file.
6160

6261
</details>
@@ -68,11 +67,11 @@ central.
6867

6968
Add *keploy-sdk* as a dependency to your *pom.xml*:
7069

71-
<dependency>
72-
<groupId>io.keploy</groupId>
73-
<artifactId>keploy-sdk</artifactId>
74-
<version>N.N.N</version> (eg: 1.2.6)
75-
</dependency>
70+
`<dependency>`
71+
`<groupId>`io.keploy `</groupId>`
72+
`<artifactId>`keploy-sdk `</artifactId>`
73+
`<version>`N.N.N `</version>` (eg: 1.2.8)
74+
`</dependency>`
7675

7776
or to *build.gradle*:
7877

@@ -82,26 +81,26 @@ or to *build.gradle*:
8281

8382
- **For Spring based application**
8483

85-
Add `@Import(KeployMiddleware.class)` below `@SpringBootApplication` in your main class.
86-
84+
Add `@Import(KeployMiddleware.class)` below `@SpringBootApplication` in your main class.
8785
- **Run along with agent to mock external calls of your API 🤩🔥**
8886

89-
- Download the latest - Download the latest agent jar
90-
from [here](https://search.maven.org/artifact/io.keploy/keploy-sdk/1.2.6/jar) (eg: 1.2.6)
87+
- Download the latest - Download the latest agent jar
88+
from [here](https://search.maven.org/remotecontent?filepath=io/keploy/agent/1.2.8/agent-1.2.8.jar) (eg: 1.2.8)
9189

92-
- Prefix `-javaagent:` with absolute classpath of agent jar (eg: `-javaagent:<your full path to agent jar>/agent-1.2.6.jar`) is possible through 3 ways:-
90+
*Note: you can find all agent jars from [here](https://search.maven.org/artifact/io.keploy/agent/1.2.7/jar).*
91+
- Prefix `-javaagent:` with absolute classpath of agent jar (eg: `-javaagent:<your full path to agent jar>/agent-1.2.8.jar`) is possible through 3 ways:-
9392

94-
1. **Using Intellij :** Go to Edit Configuration-> add VM options -> paste _java agent_ edited above.
93+
1. **Using Intellij :** Go to Edit Configuration-> add VM options -> paste _java agent_ edited above.
94+
2. **Using Command Line :**
9595

96-
2. **Using Command Line :**
97-
```
98-
export JAVA_OPTS="$JAVA_OPTS -javaagent:<your full path to agent jar>/agent-1.2.6.jar"
99-
```
96+
```
97+
export JAVA_OPTS="$JAVA_OPTS -javaagent:<your full path to agent jar>/agent-1.2.8.jar"
98+
```
99+
3. **Running via Tomcat Server :**
100100
101-
3. **Running via Tomcat Server :**
102-
```
103-
export CATALINA_OPTS="$CATALINA_OPTS -javaagent:<your full path to agent jar>/agent-1.2.6.jar"
104-
```
101+
```
102+
export CATALINA_OPTS="$CATALINA_OPTS -javaagent:<your full path to agent jar>/agent-1.2.8.jar"
103+
```
105104
106105
## Setup Employee-Manager App
107106
@@ -110,15 +109,18 @@ git clone https://github.com/keploy/samples-java
110109
```
111110

112111
### Start PostgreSQL instance
112+
113113
```bash
114114
docker-compose up -d
115115
```
116116

117117
### Maven clean install
118+
118119
```shell
119120
mvn clean install
120121
```
121-
### Set KEPLOY_MODE to record
122+
123+
### Set KEPLOY_MODE to record
122124

123125
```
124126
To record testcases use `KEPLOY_MODE` env variable and set the same to `record` mode.
@@ -130,7 +132,6 @@ To record testcases use `KEPLOY_MODE` env variable and set the same to `record`
130132
mvn spring-boot:run
131133
```
132134

133-
134135
## Generate testcases
135136

136137
To generate testcases we just need to **make some API calls.** You can use [Postman](https://www.postman.com/), [Hoppscotch](https://hoppscotch.io/), or simply `curl`
@@ -168,11 +169,10 @@ curl --location --request GET 'http://localhost:8080/api/employees/1'
168169

169170
or by querying through the browser `http://localhost:8080/api/employees/1`
170171

171-
Now both these API calls were captured as **editable** testcases and written to `test/e2e/keploy-tests` folder. The keploy directory would also have `mocks` folder.
172+
Now both these API calls were captured as **editable** testcases and written to `test/e2e/keploy-tests` folder. The keploy directory would also have `mocks` folder.
172173

173174
![testcases](https://i.imgur.com/rhNndcF.png)
174175

175-
176176
Now, let's see the magic! 🪄💫
177177

178178
## Test mode
@@ -205,12 +205,10 @@ If not present, you can add ``SampleJavaApplication_Test.java`` in the test modu
205205
```
206206

207207
1. To automatically download and run the captured test-cases. Let's run the test-file.
208-
209208
2. To get test coverage, in addition to above follow below instructions.
210-
211209
3. Add maven-surefire-plugin to your *pom.xml*.
212210

213-
```xml
211+
```xml
214212
<plugin>
215213
<groupId>org.apache.maven.plugins</groupId>
216214
<artifactId>maven-surefire-plugin</artifactId>
@@ -224,7 +222,8 @@ If not present, you can add ``SampleJavaApplication_Test.java`` in the test modu
224222
</systemPropertyVariables>
225223
</configuration>
226224
</plugin>
227-
```
225+
```
226+
228227
4. Add Jacoco plugin to your *pom.xml*.
229228

230229
```xml
@@ -268,20 +267,12 @@ If not present, you can add ``SampleJavaApplication_Test.java`` in the test modu
268267

269268
It will create .html files as test-reports which can be found in your target folder !!
270269

271-
272270
**_We got 75.3% without writing any testcases. 🎉_**
273271

274-
275-
276272
Go to the Keploy Console TestRuns Page to get deeper insights on what testcases ran, what failed.
277273

278-
279-
280274
![testruns](https://i.imgur.com/tg6OT0n.png "Summary")
281275

282-
283-
284-
285276
### **Testing using **KEPLOY_MODE** Env Variable**
286277

287278
To test using `KEPLOY_MODE` env variable, set the same to `test` mode.
@@ -297,6 +288,7 @@ mvn test
297288
```
298289

299290
Keploy will run all the captures test-cases, compare and show the results on the console.
291+
300292
```shell
301293
10b3ddd5-42fa-48e7-b98a-b47257272e39 total tests: 3
302294
2022-08-26 14:13:08.993 INFO 11560 --- [ Thread-4] io.keploy.service.GrpcService : testing 1 of 3 testcase id: [ae4a6c91-712a-4566-bf0d-97d708f94b2d]
@@ -317,6 +309,7 @@ Hibernate: select employee0_.id as id1_0_, employee0_.email as email2_0_, employ
317309
2022-08-26 14:13:19.410 INFO 11560 --- [ionShutdownHook] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown initiated...
318310
2022-08-26 14:13:19.414 INFO 11560 --- [ionShutdownHook] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown completed.
319311
```
312+
320313
> **Note** : With this method coverage will not be calculated.
321314
322315
## Let's add a Bug in the App
@@ -329,7 +322,6 @@ return ResponseEntity.ok().header("MyNewHeader","abc").body(employee);
329322
330323
Let's run the test-file to see if Keploy catches the regression introduced.
331324
332-
333325
```shell
334326
mvn test
335327
```
@@ -347,8 +339,6 @@ To deep dive the problem go to [test runs](http://localhost:6789/testruns)
347339
348340
![testruns](https://i.imgur.com/qwP8r4d.png "Recent testruns")
349341
350-
351342
**In case of any query, refer to video below,**
352343
353344
[![java-sample](https://user-images.githubusercontent.com/74777863/217864311-94a3dc0c-90bc-4551-aca2-87e82e3d24cb.png)](https://youtu.be/Ssm4TnTkbLs)
354-

0 commit comments

Comments
 (0)