fix(aihr): align disabled scenario prep cards
This commit is contained in:
+1
@@ -377,6 +377,7 @@ public class AihrPracticeSeedService {
|
||||
}
|
||||
|
||||
public PrepCardResponse prepCard(String scenarioId) {
|
||||
ensureScenarioEnabledForStart(scenarioId);
|
||||
ScenarioResponse scenario = scenario(scenarioId);
|
||||
return new PrepCardResponse(
|
||||
List.of(
|
||||
|
||||
+10
@@ -296,6 +296,16 @@ public class AihrPracticeSeedServiceTest {
|
||||
assertTrue(source.contains("训练场景已停用,无法开始"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void prepCardChecksScenarioEnabledBeforeLoading() throws Exception {
|
||||
String source = Files.readString(Path.of("src/main/java/org/dromara/aihr/service/AihrPracticeSeedService.java"));
|
||||
int methodStart = source.indexOf("public PrepCardResponse prepCard(String scenarioId)");
|
||||
int methodEnd = source.indexOf("public List<RubricResponse> rubrics", methodStart);
|
||||
String method = source.substring(methodStart, methodEnd);
|
||||
|
||||
assertTrue(method.contains("ensureScenarioEnabledForStart(scenarioId)"));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void startRejectsDisabledDatabaseScenario() {
|
||||
JdbcTemplate jdbcTemplate = mock(JdbcTemplate.class);
|
||||
|
||||
Reference in New Issue
Block a user