You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* refactored readme for java sample app
Signed-off-by: SanskritiHarmukh <sanskritiharmukh1908@gmail.com>
* edited the link for test modes
Signed-off-by: SanskritiHarmukh <sanskritiharmukh1908@gmail.com>
* removed unnecessary image
Signed-off-by: SanskritiHarmukh <sanskritiharmukh1908@gmail.com>
* Revert "removed unnecessary image"
This reverts commit 7102606.
Signed-off-by: SanskritiHarmukh <sanskritiharmukh1908@gmail.com>
* Revert "edited the link for test modes"
This reverts commit 2da56bd.
Signed-off-by: SanskritiHarmukh <sanskritiharmukh1908@gmail.com>
* refactored from java-sdk
Signed-off-by: SanskritiHarmukh <sanskritiharmukh1908@gmail.com>
* Fixed the image for video
Signed-off-by: SanskritiHarmukh <sanskritiharmukh1908@gmail.com>
---------
Signed-off-by: SanskritiHarmukh <sanskritiharmukh1908@gmail.com>
curl --silent --location "https://github.com/keploy/keploy/releases/latest/download/keploy_darwin_all.tar.gz"| tar xz -C /tmp
15
15
16
16
sudo mv /tmp/keploy /usr/local/bin && keploy
17
17
```
18
-
### Start keploy server (Linux)
18
+
19
+
### **Linux**
20
+
21
+
<details>
22
+
<summary>Linux</summary>
19
23
20
24
```shell
21
25
curl --silent --location "https://github.com/keploy/keploy/releases/latest/download/keploy_linux_amd64.tar.gz"| tar xz -C /tmp
22
26
27
+
sudo mv /tmp/keploy /usr/local/bin && keploy
28
+
```
29
+
</details>
30
+
31
+
<details>
32
+
<summary>Linux ARM</summary>
33
+
34
+
```shell
35
+
curl --silent --location "https://github.com/keploy/keploy/releases/latest/download/keploy_linux_arm64.tar.gz"| tar xz -C /tmp
23
36
24
37
sudo mv /tmp/keploy /usr/local/bin && keploy
25
38
```
26
39
40
+
The UI can be accessed at http://localhost:6789
41
+
</details>
42
+
43
+
### **Windows**
44
+
45
+
<details>
46
+
<summary>Windows</summary>
47
+
48
+
49
+
- 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
+
51
+
- Run the `keploy.exe` file.
52
+
53
+
</details>
54
+
55
+
<details>
56
+
<summary>Windows ARM</summary>
57
+
58
+
- 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
+
60
+
- Run the `keploy.exe` file.
61
+
62
+
</details>
63
+
64
+
## Build configuration
65
+
66
+
[Find the latest release](https://search.maven.org/artifact/io.keploy/keploy-sdk) of the Keploy Java SDK at maven
67
+
central.
68
+
69
+
Add *keploy-sdk* as a dependency to your *pom.xml*:
Add `@Import(KeployMiddleware.class)` below `@SpringBootApplication` in your main class.
86
+
87
+
-**Run along with agent to mock external calls of your API 🤩🔥**
88
+
89
+
- Download the latest - Download the latest agent jar
90
+
from [here](https://search.maven.org/artifact/io.keploy/keploy-sdk/1.2.5/jar) (eg: 1.2.5)
91
+
92
+
- Prefix `-javaagent:` with absolute classpath of agent jar (eg: `-javaagent:<your full path to agent jar>/agent-1.2.5.jar`) is possible through 3 ways:-
93
+
94
+
1.**Using Intellij :** Go to Edit Configuration-> add VM options -> paste _java agent_ edited above.
95
+
96
+
2.**Using Command Line :**
97
+
```
98
+
export JAVA_OPTS="$JAVA_OPTS -javaagent:<your full path to agent jar>/agent-1.2.5.jar"
99
+
```
100
+
101
+
3. **Running via Tomcat Server :**
102
+
```
103
+
export CATALINA_OPTS="$CATALINA_OPTS -javaagent:<your full path to agent jar>/agent-1.2.5.jar"
104
+
```
105
+
106
+
## Setup Employee-Manager App
29
107
30
108
```bash
31
109
git clone https://github.com/keploy/samples-java
@@ -40,6 +118,12 @@ docker-compose up -d
40
118
```shell
41
119
mvn clean install
42
120
```
121
+
### Set KEPLOY_MODE to record
122
+
123
+
```
124
+
To record testcases use `KEPLOY_MODE` env variable and set the same to `record` mode.
125
+
```
126
+
43
127
### Run the application
44
128
45
129
```shell
@@ -64,7 +148,7 @@ curl --location --request POST 'http://localhost:8080/api/employees' \
64
148
}'
65
149
```
66
150
67
-
this will return the resonse or an entry. The timestamp would automatically be ignored during testing because it'll always be different.
151
+
this will return the resonse or an entry. The timestamp would automatically be ignored during testing because it'll always be different.
68
152
69
153
```
70
154
{
@@ -80,128 +164,125 @@ this will return the resonse or an entry . The timestamp would automatically be
80
164
81
165
```bash
82
166
curl --location --request GET 'http://localhost:8080/api/employees/1'
83
-
84
167
```
85
168
86
169
or by querying through the browser `http://localhost:8080/api/employees/1`
87
170
88
-
Now both these API calls were captured as a testcase and should be visible on the [Keploy console](http://localhost:8081/testlist).
89
-
If you're using Keploy cloud, open [this](https://app.keploy.io/testlist).
90
-
91
-
You should be seeing an app named `myApp` with the test cases we just captured.
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.
92
172
93
173

94
174
175
+
95
176
Now, let's see the magic! 🪄💫
96
177
97
178
## Test mode
98
179
99
180
There are 2 ways to test the application with Keploy.
100
181
101
-
1.[Unit Test File](https://docs.keploy.io/docs/java/run-your-first-app-tutorial#testing-using-unit-test-file)
0 commit comments