Skip to content

Commit 14fd096

Browse files
Updated docker-compose version to support memory and cpu limit
1 parent eb8542c commit 14fd096

File tree

4 files changed

+15
-12
lines changed

4 files changed

+15
-12
lines changed

docker-compose.yml

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
1-
version: '3'
1+
version: '2.2'
22
services:
33
bankofspring:
44
build:
55
context: ./
66
dockerfile: Dockerfile
77
ports:
88
- '8080:8080'
9-
image: bankofspring
9+
image: bankofspring
10+
mem_limit: "256m"
11+
cpu_count: 1
12+
cpu_percent: 50

src/test/java/com/bankofspring/BankOfSpringApplicationTests.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55
import org.junit.runner.RunWith;
66
import org.junit.runners.Suite;
77

8-
@RunWith(Suite.class)
8+
/*@RunWith(Suite.class)
99
@Suite.SuiteClasses({
1010
CustomerControllerTest.class,
1111
AccountControllerTest.class
12-
})
12+
})*/
1313
public class BankOfSpringApplicationTests {
1414

1515
}

src/test/java/com/bankofspring/BankOfSpringApplicationUnitTests.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66
import org.junit.runners.Suite;
77

88

9-
@RunWith(Suite.class)
9+
/*@RunWith(Suite.class)
1010
@Suite.SuiteClasses({
1111
CustomerControllerMockMvcStandaloneTest.class
12-
})
12+
})*/
1313
/**
1414
* Created by Arpit Khandelwal.
1515
*/

src/test/java/com/bankofspring/integrationtest/controller/AccountControllerTest.java

+6-6
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ public void ut4_CreateAccount() throws Exception {
153153
* @throws Exception
154154
*/
155155
@Test
156-
public void ut4_CreateAccount_InvalidCustomer() throws Exception {
156+
public void ut5_CreateAccount_InvalidCustomer() throws Exception {
157157
mockMvc
158158
.perform(MockMvcRequestBuilders.post("/v1/account/create")
159159
.contentType(MediaType.APPLICATION_JSON)
@@ -173,7 +173,7 @@ public void ut4_CreateAccount_InvalidCustomer() throws Exception {
173173
* @throws Exception
174174
*/
175175
@Test
176-
public void ut5_DepositMoney() throws Exception {
176+
public void ut6_DepositMoney() throws Exception {
177177
mockMvc
178178
.perform(MockMvcRequestBuilders.post("/v1/account/deposit")
179179
.contentType(MediaType.APPLICATION_JSON)
@@ -193,7 +193,7 @@ public void ut5_DepositMoney() throws Exception {
193193
* @throws Exception
194194
*/
195195
@Test
196-
public void ut6_WithdrawMoney() throws Exception {
196+
public void ut7_WithdrawMoney() throws Exception {
197197
mockMvc
198198
.perform(MockMvcRequestBuilders.post("/v1/account/withdraw")
199199
.contentType(MediaType.APPLICATION_JSON)
@@ -213,7 +213,7 @@ public void ut6_WithdrawMoney() throws Exception {
213213
* @throws Exception
214214
*/
215215
@Test
216-
public void ut7_WithdrawMoney_InsufficientFunds() throws Exception {
216+
public void ut8_WithdrawMoney_InsufficientFunds() throws Exception {
217217
mockMvc
218218
.perform(MockMvcRequestBuilders.post("/v1/account/withdraw")
219219
.contentType(MediaType.APPLICATION_JSON)
@@ -234,7 +234,7 @@ public void ut7_WithdrawMoney_InsufficientFunds() throws Exception {
234234
* @throws Exception
235235
*/
236236
@Test
237-
public void ut8_TransferMoney() throws Exception {
237+
public void ut9_TransferMoney() throws Exception {
238238
mockMvc
239239
.perform(MockMvcRequestBuilders.post("/v1/account/transfer")
240240
.contentType(MediaType.APPLICATION_JSON)
@@ -257,7 +257,7 @@ public void ut8_TransferMoney() throws Exception {
257257
* @throws Exception
258258
*/
259259
@Test
260-
public void ut9_TransferMoney_InvalidRecipient() throws Exception {
260+
public void ut10_TransferMoney_InvalidRecipient() throws Exception {
261261
mockMvc
262262
.perform(MockMvcRequestBuilders.post("/v1/account/transfer")
263263
.contentType(MediaType.APPLICATION_JSON)

0 commit comments

Comments
 (0)