Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yaoai-video
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
姚珂
yaoai-video
Commits
b9d8f02b
Commit
b9d8f02b
authored
Apr 28, 2026
by
yaoke.yk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add focused storyboard contract tests
parent
16cbe1d3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
101 additions
and
4 deletions
+101
-4
pom.xml
yaoai-comic-studio/yaoai-bootstrap/pom.xml
+5
-0
StoryboardDTOTest.java
...src/test/java/com/yaoai/api/dto/ai/StoryboardDTOTest.java
+3
-4
StoryboardMapperTest.java
...st/java/com/yaoai/domain/mapper/StoryboardMapperTest.java
+93
-0
No files found.
yaoai-comic-studio/yaoai-bootstrap/pom.xml
View file @
b9d8f02b
...
@@ -73,6 +73,11 @@
...
@@ -73,6 +73,11 @@
<artifactId>
spring-boot-starter-test
</artifactId>
<artifactId>
spring-boot-starter-test
</artifactId>
<scope>
test
</scope>
<scope>
test
</scope>
</dependency>
</dependency>
<dependency>
<groupId>
com.h2database
</groupId>
<artifactId>
h2
</artifactId>
<scope>
test
</scope>
</dependency>
</dependencies>
</dependencies>
<build>
<build>
...
...
yaoai-comic-studio/yaoai-bootstrap/src/test/java/com/yaoai/
pipeline/service/impl/StoryboardPipelineServiceImpl
Test.java
→
yaoai-comic-studio/yaoai-bootstrap/src/test/java/com/yaoai/
api/dto/ai/StoryboardDTO
Test.java
View file @
b9d8f02b
package
com
.
yaoai
.
pipeline
.
service
.
impl
;
package
com
.
yaoai
.
api
.
dto
.
ai
;
import
com.yaoai.api.dto.ai.StoryboardDTO
;
import
com.yaoai.domain.entity.Storyboard
;
import
com.yaoai.domain.entity.Storyboard
;
import
org.junit.jupiter.api.Test
;
import
org.junit.jupiter.api.Test
;
import
static
org
.
junit
.
jupiter
.
api
.
Assertions
.
assertEquals
;
import
static
org
.
junit
.
jupiter
.
api
.
Assertions
.
assertEquals
;
class
Storyboard
PipelineServiceImpl
Test
{
class
Storyboard
DTO
Test
{
@Test
@Test
void
storyboardDtoF
romExposesSceneRefAndVideoPrompt
()
{
void
f
romExposesSceneRefAndVideoPrompt
()
{
Storyboard
storyboard
=
new
Storyboard
();
Storyboard
storyboard
=
new
Storyboard
();
storyboard
.
setSceneRef
(
"scene-ref-001"
);
storyboard
.
setSceneRef
(
"scene-ref-001"
);
storyboard
.
setVideoPrompt
(
"A slow dolly-in across the moonlit alley."
);
storyboard
.
setVideoPrompt
(
"A slow dolly-in across the moonlit alley."
);
...
...
yaoai-comic-studio/yaoai-bootstrap/src/test/java/com/yaoai/domain/mapper/StoryboardMapperTest.java
0 → 100644
View file @
b9d8f02b
package
com
.
yaoai
.
domain
.
mapper
;
import
com.yaoai.domain.entity.Storyboard
;
import
org.h2.jdbcx.JdbcDataSource
;
import
org.apache.ibatis.mapping.Environment
;
import
org.apache.ibatis.session.Configuration
;
import
org.apache.ibatis.session.SqlSession
;
import
org.apache.ibatis.session.SqlSessionFactory
;
import
org.apache.ibatis.session.SqlSessionFactoryBuilder
;
import
org.apache.ibatis.transaction.jdbc.JdbcTransactionFactory
;
import
org.junit.jupiter.api.Test
;
import
java.sql.Connection
;
import
java.sql.PreparedStatement
;
import
java.sql.Statement
;
import
java.util.List
;
import
static
org
.
junit
.
jupiter
.
api
.
Assertions
.
assertEquals
;
class
StoryboardMapperTest
{
@Test
void
findMissingVideoPromptByEpisodeReturnsOnlyMatchingRowsInSequenceOrder
()
throws
Exception
{
JdbcDataSource
dataSource
=
new
JdbcDataSource
();
dataSource
.
setURL
(
"jdbc:h2:mem:storyboard_mapper;MODE=MySQL;DB_CLOSE_DELAY=-1"
);
dataSource
.
setUser
(
"sa"
);
dataSource
.
setPassword
(
""
);
createSchema
(
dataSource
);
seedStoryboards
(
dataSource
);
Environment
environment
=
new
Environment
(
"test"
,
new
JdbcTransactionFactory
(),
dataSource
);
Configuration
configuration
=
new
Configuration
(
environment
);
configuration
.
setMapUnderscoreToCamelCase
(
true
);
configuration
.
addMapper
(
StoryboardMapper
.
class
);
SqlSessionFactory
sqlSessionFactory
=
new
SqlSessionFactoryBuilder
().
build
(
configuration
);
try
(
SqlSession
sqlSession
=
sqlSessionFactory
.
openSession
())
{
StoryboardMapper
mapper
=
sqlSession
.
getMapper
(
StoryboardMapper
.
class
);
List
<
Storyboard
>
storyboards
=
mapper
.
findMissingVideoPromptByEpisode
(
10L
,
20L
);
assertEquals
(
2
,
storyboards
.
size
());
assertEquals
(
List
.
of
(
102L
,
101L
),
storyboards
.
stream
().
map
(
Storyboard:
:
getId
).
toList
());
assertEquals
(
List
.
of
(
"scene-2"
,
"scene-1"
),
storyboards
.
stream
().
map
(
Storyboard:
:
getSceneRef
).
toList
());
}
}
private
static
void
createSchema
(
JdbcDataSource
dataSource
)
throws
Exception
{
try
(
Connection
connection
=
dataSource
.
getConnection
();
Statement
statement
=
connection
.
createStatement
())
{
statement
.
execute
(
"""
CREATE TABLE storyboards (
id BIGINT NOT NULL PRIMARY KEY,
episode_id BIGINT NOT NULL,
tenant_id BIGINT NOT NULL,
sequence_num INT NOT NULL,
scene_ref VARCHAR(128),
video_prompt LONGTEXT
)
"""
);
}
}
private
static
void
seedStoryboards
(
JdbcDataSource
dataSource
)
throws
Exception
{
try
(
Connection
connection
=
dataSource
.
getConnection
();
PreparedStatement
statement
=
connection
.
prepareStatement
(
"""
INSERT INTO storyboards (id, episode_id, tenant_id, sequence_num, scene_ref, video_prompt)
VALUES (?, ?, ?, ?, ?, ?)
"""
))
{
insertStoryboard
(
statement
,
101L
,
10L
,
20L
,
2
,
"scene-1"
,
null
);
insertStoryboard
(
statement
,
102L
,
10L
,
20L
,
1
,
"scene-2"
,
" "
);
insertStoryboard
(
statement
,
103L
,
10L
,
20L
,
3
,
"scene-3"
,
"Ready for video"
);
insertStoryboard
(
statement
,
104L
,
10L
,
21L
,
4
,
"scene-4"
,
null
);
}
}
private
static
void
insertStoryboard
(
PreparedStatement
statement
,
Long
id
,
Long
episodeId
,
Long
tenantId
,
int
sequenceNum
,
String
sceneRef
,
String
videoPrompt
)
throws
Exception
{
statement
.
setLong
(
1
,
id
);
statement
.
setLong
(
2
,
episodeId
);
statement
.
setLong
(
3
,
tenantId
);
statement
.
setInt
(
4
,
sequenceNum
);
statement
.
setString
(
5
,
sceneRef
);
statement
.
setString
(
6
,
videoPrompt
);
statement
.
executeUpdate
();
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment