Add converter for microsoft.sql.DateTimeOffset.

Original pull request #1875
Closes #1873
This commit is contained in:
Mikhail2048
2024-09-07 10:30:54 +03:00
committed by Jens Schauder
parent 44f96b86f7
commit 1b9b9b2ed2
5 changed files with 46 additions and 13 deletions

View File

@@ -0,0 +1,26 @@
package org.springframework.data.jdbc.core.dialect;
import java.time.Instant;
import java.util.List;
import org.assertj.core.api.Assertions;
import org.junit.jupiter.api.Test;
import org.springframework.data.jdbc.core.convert.JdbcCustomConversions;
/**
* Tests for {@link JdbcSqlServerDialect}
*
* @author Mikhail Polivakha
*/
class JdbcSqlServerDialectTest {
@Test
void testCustomConversions() {
JdbcCustomConversions jdbcCustomConversions = new JdbcCustomConversions(
(List<?>) JdbcSqlServerDialect.INSTANCE.getConverters());
Assertions
.assertThat(jdbcCustomConversions.hasCustomReadTarget(microsoft.sql.DateTimeOffset.class, Instant.class))
.isTrue();
}
}

View File

@@ -44,7 +44,7 @@ import org.springframework.test.context.ContextCustomizerFactories;
*/
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.TYPE)
// required twice as the annotation lookup doesn't merge multiple occurences of the same annotation
// required twice as the annotation lookup doesn't merge multiple occurrences of the same annotation
@ContextCustomizerFactories(value = { TestClassCustomizerFactory.class, EnabledOnDatabaseCustomizerFactory.class })
@Documented
@Inherited

View File

@@ -49,7 +49,7 @@ import org.springframework.transaction.annotation.Transactional;
* @see EnabledOnDatabase
*/
@TestExecutionListeners(value = AssumeFeatureTestExecutionListener.class, mergeMode = MERGE_WITH_DEFAULTS)
// required twice as the annotation lookup doesn't merge multiple occurences of the same annotation
// required twice as the annotation lookup doesn't merge multiple occurrences of the same annotation
@ContextCustomizerFactories(value = { TestClassCustomizerFactory.class, EnabledOnDatabaseCustomizerFactory.class })
@ActiveProfiles(resolver = CombiningActiveProfileResolver.class)
@ExtendWith(SpringExtension.class)