Skip to content

Commit 888ec98

Browse files
テスト実施時不安定なテストケースを修正
1 parent ad42496 commit 888ec98

File tree

1 file changed

+5
-10
lines changed

1 file changed

+5
-10
lines changed

src/test/java/jp/co/future/uroborosql/SqlAgentImplAdditionalTest.java

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,6 @@
1111
import static org.hamcrest.Matchers.notNullValue;
1212
import static org.junit.jupiter.api.Assertions.assertThrows;
1313

14-
import java.sql.SQLException;
15-
import java.time.Instant;
16-
1714
import org.junit.jupiter.api.Test;
1815

1916
/**
@@ -61,13 +58,10 @@ public void testHandleExceptionMethod() {
6158
@Test
6259
public void testFormatElapsedTimeMethod() throws Exception {
6360
// Execute a query that will use formatElapsedTime internally
64-
var start = Instant.now();
6561
var result = agent.queryWith("SELECT 'test' AS test_column")
6662
.collect();
67-
var end = Instant.now();
6863

6964
assertThat(result, is(notNullValue()));
70-
assertThat(end.isAfter(start), is(true));
7165
}
7266

7367
/**
@@ -80,7 +74,7 @@ public void testTransformContextMethod() throws Exception {
8074
.collect();
8175
assertThat(result, is(notNullValue()));
8276

83-
// Test with Map parameters using paramMap
77+
// Test with Map parameters using paramMap
8478
var result2 = agent.queryWith("SELECT 1 AS map_value")
8579
.collect();
8680
assertThat(result2, is(notNullValue()));
@@ -97,7 +91,7 @@ public void testApplyPropertiesMethod() throws Exception {
9791
.collect();
9892
assertThat(result, is(notNullValue()));
9993

100-
// Test with fetch size set
94+
// Test with fetch size set
10195
agent.getSqlConfig().getSqlAgentProvider().setFetchSize(100);
10296
var result2 = agent.queryWith("SELECT 'fetch_test' AS test_column")
10397
.collect();
@@ -134,8 +128,9 @@ public void testGetSqlResourceManagerMethod() throws Exception {
134128
@Test
135129
public void testGetEntityHandlerMethod() throws Exception {
136130
// Create table for test entity
137-
agent.updateWith("CREATE TABLE IF NOT EXISTS TEST (PRODUCT_ID BIGINT PRIMARY KEY, PRODUCT_NAME VARCHAR(255))").count();
138-
131+
agent.updateWith("CREATE TABLE IF NOT EXISTS TEST (PRODUCT_ID BIGINT PRIMARY KEY, PRODUCT_NAME VARCHAR(255))")
132+
.count();
133+
139134
// Create a simple entity class for testing
140135
var product = new TestEntity();
141136
product.productId = 1L;

0 commit comments

Comments
 (0)