• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Talathussain110 / ProductOrderManagement / #27

21 Dec 2025 02:30AM UTC coverage: 94.737% (-5.3%) from 100.0%
#27

push

web-flow
Merge pull request #3 from Talathussain110/integration

REST Integration

12 of 14 new or added lines in 2 files covered. (85.71%)

36 of 38 relevant lines covered (94.74%)

0.95 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

85.71
/src/main/java/com/example/demo/controller/ProductRestController.java
1
package com.example.demo.controller;
2

3
import java.util.List;
4

5
import org.springframework.beans.factory.annotation.Autowired;
6
import org.springframework.web.bind.annotation.DeleteMapping;
7
import org.springframework.web.bind.annotation.GetMapping;
8
import org.springframework.web.bind.annotation.PathVariable;
9
import org.springframework.web.bind.annotation.PostMapping;
10
import org.springframework.web.bind.annotation.PutMapping;
11
import org.springframework.web.bind.annotation.RequestBody;
12
import org.springframework.web.bind.annotation.RequestMapping;
13
import org.springframework.web.bind.annotation.RestController;
14

15
import com.example.demo.model.Product;
16
import com.example.demo.services.ProductService;
17

18
@RestController
19
@RequestMapping("/api/products")
20
public class ProductRestController {
1✔
21

22
        @Autowired
23
        private ProductService productService;
24

25
        @GetMapping
26
        public List<Product> allProducts() {
27
                return productService.getAllProducts();
1✔
28
        }
29

30
        @GetMapping("/{id}")
31
        public Product product(@PathVariable long id) {
NEW
32
                return productService.getProductById(id);
×
33
        }
34

35
        @PostMapping("/new")
36
        public Product newProduct(@RequestBody Product product) {
37
                return productService.insertNewProduct(product);
1✔
38
        }
39

40
        @PutMapping("/{id}")
41
        public Product updateProduct(@PathVariable long id, @RequestBody Product replacement) {
42
                return productService.updateProductById(id, replacement);
1✔
43
        }
44

45
        @DeleteMapping("/{id}")
46
        public void deleteProduct(@PathVariable long id) {
47
                productService.deleteProductById(id);
1✔
48
        }
1✔
49
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc