From 2f80436b90605d64bcf04100e17f18789bae2581 Mon Sep 17 00:00:00 2001 From: Gowrisankar J g <59323@hexaware.com> Date: Thu, 23 Sep 2021 14:31:39 +0530 Subject: [PATCH] minor changes in app props --- UB_UserServiceProxy/pom.xml | 14 ++++++++++---- .../urbanbazaar/controller/UserController.java | 1 + .../src/main/resources/application.properties | 2 +- .../UbUserServiceProxyApplicationTests.java | 3 +++ .../controller/MemberControllerTest.java | 2 +- 5 files changed, 16 insertions(+), 6 deletions(-) diff --git a/UB_UserServiceProxy/pom.xml b/UB_UserServiceProxy/pom.xml index 05708ba..29a846b 100644 --- a/UB_UserServiceProxy/pom.xml +++ b/UB_UserServiceProxy/pom.xml @@ -43,11 +43,17 @@ test - junit - junit - 4.12 + org.junit.vintage + junit-vintage-engine test - + + diff --git a/UB_UserServiceProxy/src/main/java/com/example/urbanbazaar/controller/UserController.java b/UB_UserServiceProxy/src/main/java/com/example/urbanbazaar/controller/UserController.java index 113225f..3f597a7 100644 --- a/UB_UserServiceProxy/src/main/java/com/example/urbanbazaar/controller/UserController.java +++ b/UB_UserServiceProxy/src/main/java/com/example/urbanbazaar/controller/UserController.java @@ -68,6 +68,7 @@ public class UserController { return new ResponseEntity("Password mismatch.", HttpStatus.BAD_REQUEST); return new ResponseEntity("Login success !!", HttpStatus.OK); } + @PutMapping("/update/") public void update(@RequestBody User user) { User oldu=repo.findById(user.getUserid()).get(); diff --git a/UB_UserServiceProxy/src/main/resources/application.properties b/UB_UserServiceProxy/src/main/resources/application.properties index 6b54763..347622f 100644 --- a/UB_UserServiceProxy/src/main/resources/application.properties +++ b/UB_UserServiceProxy/src/main/resources/application.properties @@ -1,6 +1,6 @@ server.port=8500 -spring.datasource.url=jdbc:mysql://10.3.117.21:3306/grocery_db?createDatabaseIfNotExist=true +spring.datasource.url=jdbc:mysql://localhost:3306/grocery_db?createDatabaseIfNotExist=true spring.datasource.username=testuser spring.datasource.password=Password123 diff --git a/UB_UserServiceProxy/src/test/java/com/example/urbanbazaar/UbUserServiceProxyApplicationTests.java b/UB_UserServiceProxy/src/test/java/com/example/urbanbazaar/UbUserServiceProxyApplicationTests.java index ff85878..7d1d323 100644 --- a/UB_UserServiceProxy/src/test/java/com/example/urbanbazaar/UbUserServiceProxyApplicationTests.java +++ b/UB_UserServiceProxy/src/test/java/com/example/urbanbazaar/UbUserServiceProxyApplicationTests.java @@ -1,8 +1,11 @@ package com.example.urbanbazaar; import org.junit.jupiter.api.Test; +import org.junit.runner.RunWith; import org.springframework.boot.test.context.SpringBootTest; +import org.springframework.test.context.junit4.SpringRunner; +@RunWith(SpringRunner.class) @SpringBootTest class UbUserServiceProxyApplicationTests { diff --git a/UB_UserServiceProxy/src/test/java/com/example/urbanbazaar/controller/MemberControllerTest.java b/UB_UserServiceProxy/src/test/java/com/example/urbanbazaar/controller/MemberControllerTest.java index 3adf033..120e338 100644 --- a/UB_UserServiceProxy/src/test/java/com/example/urbanbazaar/controller/MemberControllerTest.java +++ b/UB_UserServiceProxy/src/test/java/com/example/urbanbazaar/controller/MemberControllerTest.java @@ -41,7 +41,7 @@ public class MemberControllerTest { this.mockMvc.perform(MockMvcRequestBuilders.get("/users/showAllMembers") .accept(MediaType.APPLICATION_JSON)) .andDo(print()) - .andExpect(jsonPath("$", hasSize(4))) + .andExpect(jsonPath("$", hasSize(3))) .andReturn(); } }