You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
1.1 KiB
37 lines
1.1 KiB
5 years ago
|
package com.yipin.liuwanr;
|
||
|
|
||
|
import com.yipin.liuwanr.entity.SutdentClass;
|
||
|
import com.yipin.liuwanr.service.ClassService;
|
||
|
import org.junit.Test;
|
||
|
import org.junit.runner.RunWith;
|
||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||
|
import org.springframework.boot.test.context.SpringBootTest;
|
||
|
import org.springframework.test.context.junit4.SpringRunner;
|
||
|
|
||
|
import java.util.HashMap;
|
||
|
import java.util.List;
|
||
|
|
||
|
@RunWith(SpringRunner.class)
|
||
|
@SpringBootTest
|
||
|
public class ClassServiceTest {
|
||
|
|
||
|
@Autowired
|
||
|
private ClassService classService;
|
||
|
|
||
|
@Test
|
||
|
public void testQueryGetByClassName() {
|
||
|
HashMap<String, Object> map = classService.queryGetByClassName("");
|
||
|
Integer retcode = (Integer) map.get("retcode");
|
||
|
System.out.println(retcode);
|
||
|
if (retcode == 200) {
|
||
|
List<SutdentClass> classes = (List<SutdentClass>) map.get("retvalue");
|
||
|
classes.forEach(item -> {
|
||
|
System.out.println(item.toString());
|
||
|
});
|
||
|
} else {
|
||
|
String msg = (String) map.get("retvalue");
|
||
|
System.out.println(msg);
|
||
|
}
|
||
|
}
|
||
|
}
|