Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

自动化测试用例 #130

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions case-server/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,24 @@
<artifactId>spring-test</artifactId>
</dependency>

<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>org.junit.vintage</groupId>
<artifactId>junit-vintage-engine</artifactId>
</exclusion>
</exclusions>
</dependency>

</dependencies>

<build>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,4 +117,9 @@ public Response<?> getDirCardTree(@RequestParam @NotNull(message = "业务线id
@RequestParam @NotNull(message = "渠道为空") Integer channel) {
return Response.success(dirService.getDirTree(productLineId, channel));
}

@GetMapping("/getId")
public String getId(String parentId, Long productLineId, Integer channel, String text) {
return dirService.getId(parentId, productLineId, channel, text);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ public Response<Long> importXmind(@RequestParam MultipartFile file, String creat
Long productLineId, String title, String description, Integer channel, String requirementId, HttpServletRequest request) {
FileImportReq req = new FileImportReq(file, creator, productLineId, title, description, channel, requirementId, bizId);
req.validate();

try {
return Response.success(fileService.importXmindFile(req, request, uploadPath));
} catch (CaseServerException e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,4 +49,9 @@ public Response<?> login(@RequestBody UserLoginReq req, HttpServletRequest reque
public Response<?> logout(HttpServletRequest request,HttpServletResponse response) {
return Response.success(userService.logout(request, response));
}

@PostMapping("/logoff")
public Response<?> logoff(String Username) {
return Response.success(userService.logoff(Username));
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package com.xiaoju.framework.entity.persistent;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;

Expand All @@ -11,6 +13,8 @@
* @date 2019/11/05
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class CaseBackup {
private Long id;
private Long caseId;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,33 @@
package com.xiaoju.framework.entity.request.auth;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
* Created by didi on 2021/4/22.
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class UserLoginReq {
private String username;

private String password;

public String getUsername() {
return username;
}

public void setUsername(String username) {
this.username = username;
}

public String getPassword() {
return password;
}

public void setPassword(String password) {
this.password = password;
}
}
Original file line number Diff line number Diff line change
@@ -1,13 +1,33 @@
package com.xiaoju.framework.entity.request.auth;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
* Created by didi on 2021/4/22.
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class UserRegisterReq {
private String username;

private String password;

public String getUsername() {
return username;
}

public void setUsername(String username) {
this.username = username;
}

public String getPassword() {
return password;
}

public void setPassword(String password) {
this.password = password;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,86 @@
@NoArgsConstructor
public class CaseCreateReq implements ParamValidate {

public String getCreator() {
return creator;
}

public void setCreator(String creator) {
this.creator = creator;
}

public Long getProductLineId() {
return productLineId;
}

public void setProductLineId(Long productLineId) {
this.productLineId = productLineId;
}

public Integer getCaseType() {
return caseType;
}

public void setCaseType(Integer caseType) {
this.caseType = caseType;
}

public String getCaseContent() {
return caseContent;
}

public void setCaseContent(String caseContent) {
this.caseContent = caseContent;
}

public String getTitle() {
return title;
}

public void setTitle(String title) {
this.title = title;
}

public Integer getChannel() {
return channel;
}

public void setChannel(Integer channel) {
this.channel = channel;
}

public String getBizId() {
return bizId;
}

public void setBizId(String bizId) {
this.bizId = bizId;
}

public Long getId() {
return id;
}

public void setId(Long id) {
this.id = id;
}

public String getRequirementId() {
return requirementId;
}

public void setRequirementId(String requirementId) {
this.requirementId = requirementId;
}

public String getDescription() {
return description;
}

public void setDescription(String description) {
this.description = description;
}

/**
* 必填 创建人邮箱前缀
*/
Expand Down Expand Up @@ -76,6 +156,7 @@ public class CaseCreateReq implements ParamValidate {
*/
private String description;


@Override
public void validate() {
// 复制操作才需要id
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
package com.xiaoju.framework.entity.request.cases;

import com.xiaoju.framework.entity.request.ParamValidate;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
* 用例 逻辑删除
Expand All @@ -10,6 +12,8 @@
* @date 2020/9/7
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class CaseDeleteReq implements ParamValidate {

private Long id;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
import com.xiaoju.framework.constants.BizConstant;
import com.xiaoju.framework.constants.SystemConstant;
import com.xiaoju.framework.entity.request.ParamValidate;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.util.StringUtils;

import java.util.Arrays;
Expand All @@ -15,6 +17,8 @@
* @date 2020/9/4
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class CaseEditReq implements ParamValidate {

/**
Expand Down Expand Up @@ -58,7 +62,6 @@ public class CaseEditReq implements ParamValidate {
private String description;



@Override
public void validate() {
if (id == null || id <= 0) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package com.xiaoju.framework.entity.request.cases;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
* 用例 筛选与查询
Expand All @@ -9,6 +11,8 @@
* @date 2020/8/12
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public class CaseQueryReq {

private Long id;
Expand Down Expand Up @@ -48,4 +52,100 @@ public CaseQueryReq(Integer caseType, String title, String creator, String reqId
this.pageNum = pageNum;
this.pageSize = pageSize;
}

public Long getId() {
return id;
}

public void setId(Long id) {
this.id = id;
}

public Integer getCaseType() {
return caseType;
}

public void setCaseType(Integer caseType) {
this.caseType = caseType;
}

public Long getLineId() {
return lineId;
}

public void setLineId(Long lineId) {
this.lineId = lineId;
}

public String getTitle() {
return title;
}

public void setTitle(String title) {
this.title = title;
}

public String getCreator() {
return creator;
}

public void setCreator(String creator) {
this.creator = creator;
}

public String getRequirementId() {
return requirementId;
}

public void setRequirementId(String requirementId) {
this.requirementId = requirementId;
}

public String getBeginTime() {
return beginTime;
}

public void setBeginTime(String beginTime) {
this.beginTime = beginTime;
}

public String getEndTime() {
return endTime;
}

public void setEndTime(String endTime) {
this.endTime = endTime;
}

public Integer getChannel() {
return channel;
}

public void setChannel(Integer channel) {
this.channel = channel;
}

public String getBizId() {
return bizId;
}

public void setBizId(String bizId) {
this.bizId = bizId;
}

public Integer getPageNum() {
return pageNum;
}

public void setPageNum(Integer pageNum) {
this.pageNum = pageNum;
}

public Integer getPageSize() {
return pageSize;
}

public void setPageSize(Integer pageSize) {
this.pageSize = pageSize;
}
}
Loading