chore: 测试覆盖率action
This commit is contained in:
parent
5183a9f919
commit
7e94a91fbb
|
@ -26,3 +26,5 @@ jobs:
|
||||||
run: mvn -B package --file pom.xml
|
run: mvn -B package --file pom.xml
|
||||||
- name: Upload coverage reports to Codecov
|
- name: Upload coverage reports to Codecov
|
||||||
uses: codecov/codecov-action@v3
|
uses: codecov/codecov-action@v3
|
||||||
|
with:
|
||||||
|
token: ${{ secrets.CODECOV_TOKEN }}
|
||||||
|
|
|
@ -5,6 +5,7 @@ import io.metersphere.domain.User;
|
||||||
import io.metersphere.sdk.UserService;
|
import io.metersphere.sdk.UserService;
|
||||||
import jakarta.annotation.Resource;
|
import jakarta.annotation.Resource;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
|
import org.springframework.web.bind.annotation.PathVariable;
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
|
@ -20,4 +21,9 @@ public class UserController {
|
||||||
public List<User> listAll() {
|
public List<User> listAll() {
|
||||||
return userService.list();
|
return userService.list();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@GetMapping("/get/{userId}")
|
||||||
|
public User getUser(@PathVariable String userId) {
|
||||||
|
return userService.getById(userId);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,4 +28,13 @@ public class UserControllerTests {
|
||||||
.andDo(print());
|
.andDo(print());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testSelectAll2() throws Exception {
|
||||||
|
mockMvc.perform(MockMvcRequestBuilders.get("/user/get/admin"))
|
||||||
|
.andExpect(status().isOk())
|
||||||
|
// .andExpect(content().contentType(MediaType.APPLICATION_JSON))
|
||||||
|
// .andExpect(jsonPath("$.person.name").value("Jason"))
|
||||||
|
.andDo(print());
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue