Skip to content

Commit

Permalink
fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
Kuangcp committed Nov 6, 2024
1 parent 3e36aee commit de0ab98
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 44 deletions.
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
# Java 基础学习
<p align="center"><img width=120 src="https://www.svgrepo.com/show/184143/java.svg"></p>
<h3 align="center">Java 基础</h3>

[![Java Version](https://img.shields.io/badge/JDK-Java%208-red.svg)](https://www.java.com/zh_CN/download/)
[![Gradle 5.3](https://img.shields.io/badge/Gradle-5.3-green.svg)](https://docs.gradle.org/5.3/userguide/userguide.html)
[![996.icu](https://img.shields.io/badge/link-996.icu-red.svg)](https://996.icu)
[![codebeat badge](https://codebeat.co/badges/9145f9a8-a1aa-4c67-bb2b-f9dd12e924d4)](https://codebeat.co/projects/github-com-kuangcp-javabase-master)
[![Maintainability](https://api.codeclimate.com/v1/badges/23134c0d2348845fecec/maintainability)](https://codeclimate.com/github/Kuangcp/JavaBase/maintainability)
<p align="center">
<a href="https://www.java.com/zh_CN/download/"><img src="https://img.shields.io/badge/JDK-Java%208-red.svg"></a>
<a href="https://996.icu"><img src="https://img.shields.io/badge/Dev-996.icu-red.svg"></a>
<a href="https://codebeat.co/projects/github-com-kuangcp-javabase-master"><img src="https://codebeat.co/badges/9145f9a8-a1aa-4c67-bb2b-f9dd12e924d4"></a>
<a href="https://codeclimate.com/github/Kuangcp/JavaBase/maintainability"><img src="https://api.codeclimate.com/v1/badges/23134c0d2348845fecec/maintainability"></a>
</p>

************************

Expand All @@ -16,8 +18,6 @@
| [Java Gui](/gui) | [测试](/test) | [业务问题](/question) |




************************

## 同类仓库
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,45 +7,45 @@
@Slf4j
public class BeanValidatorTest {

@Test
public void testValid() {
TestParam param = new TestParam();
param.setState(ActiveState.ACTIVE);
param.setStr(StrState.SECOND);
BeanValidator.check(param);
}
@Test
public void testValid() {
TestParam param = new TestParam();
param.setState(ActiveState.ACTIVE);
param.setStr(StrState.SECOND);
BeanValidator.check(param);
}

@Test
public void testInvalid() {
TestParam param = new TestParam();
param.setState(-1);
param.setStr(StrState.SECOND);
try {
BeanValidator.check(param);
Assert.fail();
} catch (Exception e) {
Assert.assertEquals(e.getMessage(), ErrorMsgConstant.STATE_ERROR);
@Test
public void testInvalid() {
TestParam param = new TestParam();
param.setState(-1);
param.setStr(StrState.SECOND);
try {
BeanValidator.check(param);
Assert.fail();
} catch (Exception e) {
Assert.assertEquals(e.getMessage(), ErrorMsgConstant.STATE_ERROR);
}
}
}

@Test
public void testValidStr() {
TestParam param = new TestParam();
param.setStr(StrState.SECOND);
param.setState(ActiveState.NONE);
BeanValidator.check(param);
}
@Test
public void testValidStr() {
TestParam param = new TestParam();
param.setStr(StrState.SECOND);
param.setState(ActiveState.NONE);
BeanValidator.check(param);
}

@Test
public void testInvalidStr() {
TestParam param = new TestParam();
param.setStr("2s");
param.setState(3);
try {
BeanValidator.check(param);
Assert.fail();
} catch (Exception e) {
Assert.assertEquals(e.getMessage(), ErrorMsgConstant.STR_STATE_ERROR);
@Test
public void testInvalidStr() {
TestParam param = new TestParam();
param.setStr("2s");
param.setState(3);
try {
BeanValidator.check(param);
Assert.fail();
} catch (Exception e) {
Assert.assertEquals(e.getMessage(), ErrorMsgConstant.STR_STATE_ERROR);
}
}
}
}

0 comments on commit de0ab98

Please sign in to comment.