Browse Source

minor changes in app props

master
Gowrisankar J g 4 years ago
parent
commit
2f80436b90
5 changed files with 16 additions and 6 deletions
  1. 14
      UB_UserServiceProxy/pom.xml
  2. 1
      UB_UserServiceProxy/src/main/java/com/example/urbanbazaar/controller/UserController.java
  3. 2
      UB_UserServiceProxy/src/main/resources/application.properties
  4. 3
      UB_UserServiceProxy/src/test/java/com/example/urbanbazaar/UbUserServiceProxyApplicationTests.java
  5. 2
      UB_UserServiceProxy/src/test/java/com/example/urbanbazaar/controller/MemberControllerTest.java

14
UB_UserServiceProxy/pom.xml

@ -43,11 +43,17 @@
<scope>test</scope>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
<scope>test</scope>
</dependency>
</dependency>
<!--
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
-->
</dependencies>
<build>

1
UB_UserServiceProxy/src/main/java/com/example/urbanbazaar/controller/UserController.java

@ -68,6 +68,7 @@ public class UserController {
return new ResponseEntity<String>("Password mismatch.", HttpStatus.BAD_REQUEST);
return new ResponseEntity<String>("Login success !!", HttpStatus.OK);
}
@PutMapping("/update/")
public void update(@RequestBody User user) {
User oldu=repo.findById(user.getUserid()).get();

2
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

3
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 {

2
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();
}
}
Loading…
Cancel
Save