Skip to content

Commit

Permalink
chore: created OBS module
Browse files Browse the repository at this point in the history
  • Loading branch information
Koufan-De-King committed Oct 18, 2024
1 parent b10d806 commit 78ae57e
Show file tree
Hide file tree
Showing 7 changed files with 62 additions and 15 deletions.
2 changes: 1 addition & 1 deletion online-banking-service/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ target/
.sts4-cache

### IntelliJ IDEA ###
.idea
.idea/
*.iws
*.iml
*.ipr
Expand Down
9 changes: 0 additions & 9 deletions online-banking-service/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,6 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-gateway</artifactId>
</dependency>

<dependency>
<groupId>org.projectlombok</groupId>
Expand All @@ -50,11 +46,6 @@
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>io.projectreactor</groupId>
<artifactId>reactor-test</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<dependencyManagement>
<dependencies>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package com.adorsys.webank.obs.controller;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class OBSRestController {

@GetMapping("/message")
public String getMessage() {
return "Hello from OBService!";
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package com.adorsys.webank.obs.service.api;


public interface OBServiceAPI {
String getMessage();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package com.adorsys.webank.obs.service.impl;

import com.adorsys.webank.obs.service.api.OBServiceAPI;
import org.springframework.stereotype.Service;

@Service
public class OBServiceImpl implements OBServiceAPI {

@Override
public String getMessage() {
return "Hello from OBService!";
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@
import org.junit.jupiter.api.Test;
import org.springframework.boot.test.context.SpringBootTest;

@SpringBootTest
class OnlineBankingServiceApplicationTests {
@SpringBootTest(classes = OnlineBankingServiceApplication.class) // Specify main class
public class OnlineBankingServiceApplicationTests {

@Test
void contextLoads() {
public void contextLoads() {
// This test intentionally does nothing.
// The @SpringBootTest annotation simulates application startup.
}

}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package com.adorsys.webank.obs.controller;


import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.autoconfigure.web.servlet.WebMvcTest;
import org.springframework.test.web.servlet.MockMvc;
import org.springframework.test.web.servlet.request.MockMvcRequestBuilders;
import org.springframework.test.web.servlet.result.MockMvcResultMatchers;

@WebMvcTest(OBSRestController.class)
public class OBSRestControllerTest {

@Autowired
private MockMvc mockMvc;

@Test
public void testGetMessage() throws Exception {
mockMvc.perform(MockMvcRequestBuilders.get("/message"))
.andExpect(MockMvcResultMatchers.status().isOk())
.andExpect(MockMvcResultMatchers.content().string("Hello from OBService!"));
}
}

0 comments on commit 78ae57e

Please sign in to comment.