기본키 매핑
이런식으로 실행된 로그를 보면 sequence가 나오는데 실제 h2.db에는 그대로 identity 전략이 사용되네요 ㅠㅠ (사진)15:40:10.597 [main] DEBUG org.springframework.test.context.junit4.SpringJUnit4ClassRunner - SpringJUnit4ClassRunner constructor called with [class jpabook.jpashop.MemberRepositoryTest]15:40:10.607 [main] DEBUG org.springframework.test.context.BootstrapUtils - Instantiating CacheAwareContextLoaderDelegate from class [org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate]15:40:10.621 [main] DEBUG org.springframework.test.context.BootstrapUtils - Instantiating BootstrapContext using constructor [public org.springframework.test.context.support.DefaultBootstrapContext(java.lang.Class,org.springframework.test.context.CacheAwareContextLoaderDelegate)]15:40:10.688 [main] DEBUG org.springframework.test.context.BootstrapUtils - Instantiating TestContextBootstrapper for test class [jpabook.jpashop.MemberRepositoryTest] from class [org.springframework.boot.test.context.SpringBootTestContextBootstrapper]15:40:10.717 [main] INFO org.springframework.boot.test.context.SpringBootTestContextBootstrapper - Neither @ContextConfiguration nor @ContextHierarchy found for test class [jpabook.jpashop.MemberRepositoryTest], using SpringBootContextLoader15:40:10.725 [main] DEBUG org.springframework.test.context.support.AbstractContextLoader - Did not detect default resource location for test class [jpabook.jpashop.MemberRepositoryTest]: class path resource [jpabook/jpashop/MemberRepositoryTest-context.xml] does not exist15:40:10.726 [main] DEBUG org.springframework.test.context.support.AbstractContextLoader - Did not detect default resource location for test class [jpabook.jpashop.MemberRepositoryTest]: class path resource [jpabook/jpashop/MemberRepositoryTestContext.groovy] does not exist15:40:10.726 [main] INFO org.springframework.test.context.support.AbstractContextLoader - Could not detect default resource locations for test class [jpabook.jpashop.MemberRepositoryTest]: no resource found for suffixes {-context.xml, Context.groovy}.15:40:10.727 [main] INFO org.springframework.test.context.support.AnnotationConfigContextLoaderUtils - Could not detect default configuration classes for test class [jpabook.jpashop.MemberRepositoryTest]: MemberRepositoryTest does not declare any static, non-private, non-final, nested classes annotated with @Configuration.15:40:10.824 [main] DEBUG org.springframework.test.context.support.ActiveProfilesUtils - Could not find an 'annotation declaring class' for annotation type [org.springframework.test.context.ActiveProfiles] and class [jpabook.jpashop.MemberRepositoryTest]15:40:10.948 [main] DEBUG org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider - Identified candidate component class: file [C:\Users\hal8h\OneDrive\바탕 화면\새 폴더\jpashop\out\production\classes\jpabook\jpashop\JpashopApplication.class]15:40:10.952 [main] INFO org.springframework.boot.test.context.SpringBootTestContextBootstrapper - Found @SpringBootConfiguration jpabook.jpashop.JpashopApplication for test class jpabook.jpashop.MemberRepositoryTest15:40:11.193 [main] DEBUG org.springframework.boot.test.context.SpringBootTestContextBootstrapper - @TestExecutionListeners is not present for class [jpabook.jpashop.MemberRepositoryTest]: using defaults.15:40:11.195 [main] INFO org.springframework.boot.test.context.SpringBootTestContextBootstrapper - Loaded default TestExecutionListener class names from location [META-INF/spring.factories]: [org.springframework.boot.test.autoconfigure.restdocs.RestDocsTestExecutionListener, org.springframework.boot.test.autoconfigure.web.client.MockRestServiceServerResetTestExecutionListener, org.springframework.boot.test.autoconfigure.web.servlet.MockMvcPrintOnlyOnFailureTestExecutionListener, org.springframework.boot.test.autoconfigure.web.servlet.WebDriverTestExecutionListener, org.springframework.boot.test.autoconfigure.webservices.client.MockWebServiceServerTestExecutionListener, org.springframework.boot.test.mock.mockito.MockitoTestExecutionListener, org.springframework.boot.test.mock.mockito.ResetMocksTestExecutionListener, org.springframework.test.context.web.ServletTestExecutionListener, org.springframework.test.context.support.DirtiesContextBeforeModesTestExecutionListener, org.springframework.test.context.event.ApplicationEventsTestExecutionListener, org.springframework.test.context.support.DependencyInjectionTestExecutionListener, org.springframework.test.context.support.DirtiesContextTestExecutionListener, org.springframework.test.context.transaction.TransactionalTestExecutionListener, org.springframework.test.context.jdbc.SqlScriptsTestExecutionListener, org.springframework.test.context.event.EventPublishingTestExecutionListener]15:40:11.241 [main] INFO org.springframework.boot.test.context.SpringBootTestContextBootstrapper - Using TestExecutionListeners: [org.springframework.test.context.web.ServletTestExecutionListener@7c214cc0, org.springframework.test.context.support.DirtiesContextBeforeModesTestExecutionListener@5b67bb7e, org.springframework.test.context.event.ApplicationEventsTestExecutionListener@609db546, org.springframework.boot.test.mock.mockito.MockitoTestExecutionListener@20f5281c, org.springframework.boot.test.autoconfigure.SpringBootDependencyInjectionTestExecutionListener@56c4278e, org.springframework.test.context.support.DirtiesContextTestExecutionListener@301eda63, org.springframework.test.context.transaction.TransactionalTestExecutionListener@3d246ea3, org.springframework.test.context.jdbc.SqlScriptsTestExecutionListener@341814d3, org.springframework.test.context.event.EventPublishingTestExecutionListener@4397ad89, org.springframework.boot.test.autoconfigure.restdocs.RestDocsTestExecutionListener@59cba5a, org.springframework.boot.test.autoconfigure.web.client.MockRestServiceServerResetTestExecutionListener@1bd39d3c, org.springframework.boot.test.autoconfigure.web.servlet.MockMvcPrintOnlyOnFailureTestExecutionListener@6f19ac19, org.springframework.boot.test.autoconfigure.web.servlet.WebDriverTestExecutionListener@119cbf96, org.springframework.boot.test.autoconfigure.webservices.client.MockWebServiceServerTestExecutionListener@71329995, org.springframework.boot.test.mock.mockito.ResetMocksTestExecutionListener@768fc0f2]15:40:11.245 [main] DEBUG org.springframework.test.annotation.ProfileValueUtils - Retrieved @ProfileValueSourceConfiguration [null] for test class [jpabook.jpashop.MemberRepositoryTest]15:40:11.248 [main] DEBUG org.springframework.test.annotation.ProfileValueUtils - Retrieved ProfileValueSource type [class org.springframework.test.annotation.SystemProfileValueSource] for class [jpabook.jpashop.MemberRepositoryTest]15:40:11.250 [main] DEBUG org.springframework.test.annotation.ProfileValueUtils - Retrieved @ProfileValueSourceConfiguration [null] for test class [jpabook.jpashop.MemberRepositoryTest]15:40:11.251 [main] DEBUG org.springframework.test.annotation.ProfileValueUtils - Retrieved ProfileValueSource type [class org.springframework.test.annotation.SystemProfileValueSource] for class [jpabook.jpashop.MemberRepositoryTest]15:40:11.251 [main] DEBUG org.springframework.test.annotation.ProfileValueUtils - Retrieved @ProfileValueSourceConfiguration [null] for test class [jpabook.jpashop.MemberRepositoryTest]15:40:11.251 [main] DEBUG org.springframework.test.annotation.ProfileValueUtils - Retrieved ProfileValueSource type [class org.springframework.test.annotation.SystemProfileValueSource] for class [jpabook.jpashop.MemberRepositoryTest]15:40:11.265 [main] DEBUG org.springframework.test.annotation.ProfileValueUtils - Retrieved @ProfileValueSourceConfiguration [null] for test class [jpabook.jpashop.MemberRepositoryTest]15:40:11.265 [main] DEBUG org.springframework.test.annotation.ProfileValueUtils - Retrieved ProfileValueSource type [class org.springframework.test.annotation.SystemProfileValueSource] for class [jpabook.jpashop.MemberRepositoryTest]15:40:11.267 [main] DEBUG org.springframework.test.annotation.ProfileValueUtils - Retrieved @ProfileValueSourceConfiguration [null] for test class [jpabook.jpashop.MemberRepositoryTest]15:40:11.268 [main] DEBUG org.springframework.test.annotation.ProfileValueUtils - Retrieved ProfileValueSource type [class org.springframework.test.annotation.SystemProfileValueSource] for class [jpabook.jpashop.MemberRepositoryTest]15:40:11.269 [main] DEBUG org.springframework.test.annotation.ProfileValueUtils - Retrieved @ProfileValueSourceConfiguration [null] for test class [jpabook.jpashop.MemberRepositoryTest]15:40:11.269 [main] DEBUG org.springframework.test.annotation.ProfileValueUtils - Retrieved ProfileValueSource type [class org.springframework.test.annotation.SystemProfileValueSource] for class [jpabook.jpashop.MemberRepositoryTest]15:40:11.279 [main] DEBUG org.springframework.test.context.support.AbstractDirtiesContextTestExecutionListener - Before test class: context [DefaultTestContext@338c99c8 testClass = MemberRepositoryTest, testInstance = [null], testMethod = [null], testException = [null], mergedContextConfiguration = [WebMergedContextConfiguration@21ba0741 testClass = MemberRepositoryTest, locations = '{}', classes = '{class jpabook.jpashop.JpashopApplication}', contextInitializerClasses = '[]', activeProfiles = '{}', propertySourceLocations = '{}', propertySourceProperties = '{org.springframework.boot.test.context.SpringBootTestContextBootstrapper=true}', contextCustomizers = set[org.springframework.boot.test.autoconfigure.actuate.metrics.MetricsExportContextCustomizerFactory$DisableMetricExportContextCustomizer@76ed1b7c, org.springframework.boot.test.autoconfigure.properties.PropertyMappingContextCustomizer@0, org.springframework.boot.test.autoconfigure.web.servlet.WebDriverContextCustomizerFactory$Customizer@71c3b41, org.springframework.boot.test.context.filter.ExcludeFilterContextCustomizer@5f16132a, org.springframework.boot.test.json.DuplicateJsonObjectContextCustomizerFactory$DuplicateJsonObjectContextCustomizer@87a85e1, org.springframework.boot.test.mock.mockito.MockitoContextCustomizer@0, org.springframework.boot.test.web.client.TestRestTemplateContextCustomizer@152aa092, org.springframework.boot.test.context.SpringBootTestArgs@1, org.springframework.boot.test.context.SpringBootTestWebEnvironment@368f2016], resourceBasePath = 'src/main/webapp', contextLoader = 'org.springframework.boot.test.context.SpringBootContextLoader', parent = [null]], attributes = map['org.springframework.test.context.web.ServletTestExecutionListener.activateListener' -> true]], class annotated with @DirtiesContext [false] with mode [null].15:40:11.286 [main] DEBUG org.springframework.test.annotation.ProfileValueUtils - Retrieved @ProfileValueSourceConfiguration [null] for test class [jpabook.jpashop.MemberRepositoryTest]15:40:11.286 [main] DEBUG org.springframework.test.annotation.ProfileValueUtils - Retrieved ProfileValueSource type [class org.springframework.test.annotation.SystemProfileValueSource] for class [jpabook.jpashop.MemberRepositoryTest] . ____ _ /\\ / ___'_ __ (_)_ _ \ \ \ \( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \ \\/ ___)| |_)| | | | | || (_| | ) ) ) ) ' |____| .__|_| |_|_| |_\__, | / / / / =========|_|==============|___/=/_/_/_/ :: Spring Boot :: (v2.6.12)2022-10-10 15:40:12.007 INFO 11752 --- [ main] jpabook.jpashop.MemberRepositoryTest : Starting MemberRepositoryTest using Java 11.0.15 on DESKTOP-71386SR with PID 11752 (started by hal8h in C:\Users\hal8h\OneDrive\바탕 화면\새 폴더\jpashop)2022-10-10 15:40:12.008 INFO 11752 --- [ main] jpabook.jpashop.MemberRepositoryTest : No active profile set, falling back to 1 default profile: "default"2022-10-10 15:40:12.985 INFO 11752 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data JPA repositories in DEFAULT mode.2022-10-10 15:40:13.004 INFO 11752 --- [ main] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 9 ms. Found 0 JPA repository interfaces.2022-10-10 15:40:13.965 INFO 11752 --- [ main] o.hibernate.jpa.internal.util.LogHelper : HHH000204: Processing PersistenceUnitInfo [name: default]2022-10-10 15:40:14.051 INFO 11752 --- [ main] org.hibernate.Version : HHH000412: Hibernate ORM core version 5.6.11.Final2022-10-10 15:40:14.325 INFO 11752 --- [ main] o.hibernate.annotations.common.Version : HCANN000001: Hibernate Commons Annotations {5.1.2.Final}2022-10-10 15:40:14.964 INFO 11752 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Starting...2022-10-10 15:40:15.061 INFO 11752 --- [ main] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Start completed.2022-10-10 15:40:15.123 INFO 11752 --- [ main] org.hibernate.dialect.Dialect : HHH000400: Using dialect: org.hibernate.dialect.H2Dialect2022-10-10 15:40:16.021 DEBUG 11752 --- [ main] org.hibernate.SQL : drop table if exists member CASCADE 2022-10-10 15:40:16.028 INFO 11752 --- [ main] p6spy : #1665384016028 | took 2ms | statement | connection 1| url jdbc:h2:tcp://localhost/~/jpashop drop table if exists member CASCADE drop table if exists member CASCADE ;2022-10-10 15:40:16.028 DEBUG 11752 --- [ main] org.hibernate.SQL : drop sequence if exists hibernate_sequence2022-10-10 15:40:16.029 INFO 11752 --- [ main] p6spy : #1665384016029 | took 1ms | statement | connection 1| url jdbc:h2:tcp://localhost/~/jpashop drop sequence if exists hibernate_sequence drop sequence if exists hibernate_sequence;2022-10-10 15:40:16.032 DEBUG 11752 --- [ main] org.hibernate.SQL : create sequence hibernate_sequence start with 1 increment by 12022-10-10 15:40:16.034 INFO 11752 --- [ main] p6spy : #1665384016034 | took 0ms | statement | connection 2| url jdbc:h2:tcp://localhost/~/jpashopcreate sequence hibernate_sequence start with 1 increment by 1create sequence hibernate_sequence start with 1 increment by 1;2022-10-10 15:40:16.034 DEBUG 11752 --- [ main] org.hibernate.SQL : create table member ( id bigint not null, username varchar(255), primary key (id) )2022-10-10 15:40:16.035 INFO 11752 --- [ main] p6spy : #1665384016035 | took 0ms | statement | connection 2| url jdbc:h2:tcp://localhost/~/jpashop create table member ( id bigint not null, username varchar(255), primary key (id) ) create table member ( id bigint not null, username varchar(255), primary key (id) );2022-10-10 15:40:16.037 INFO 11752 --- [ main] o.h.e.t.j.p.i.JtaPlatformInitiator : HHH000490: Using JtaPlatform implementation: [org.hibernate.engine.transaction.jta.platform.internal.NoJtaPlatform]2022-10-10 15:40:16.050 INFO 11752 --- [ main] j.LocalContainerEntityManagerFactoryBean : Initialized JPA EntityManagerFactory for persistence unit 'default'2022-10-10 15:40:16.542 WARN 11752 --- [ main] JpaBaseConfiguration$JpaWebConfiguration : spring.jpa.open-in-view is enabled by default. Therefore, database queries may be performed during view rendering. Explicitly configure spring.jpa.open-in-view to disable this warning2022-10-10 15:40:17.060 INFO 11752 --- [ main] o.s.b.a.w.s.WelcomePageHandlerMapping : Adding welcome page: class path resource [static/index.html]2022-10-10 15:40:17.624 INFO 11752 --- [ main] jpabook.jpashop.MemberRepositoryTest : Started MemberRepositoryTest in 6.253 seconds (JVM running for 7.742)2022-10-10 15:40:17.783 INFO 11752 --- [ main] o.s.t.c.transaction.TransactionContext : Began transaction (1) for test context [DefaultTestContext@338c99c8 testClass = MemberRepositoryTest, testInstance = jpabook.jpashop.MemberRepositoryTest@68f264bf, testMethod = testMember@MemberRepositoryTest, testException = [null], mergedContextConfiguration = [WebMergedContextConfiguration@21ba0741 testClass = MemberRepositoryTest, locations = '{}', classes = '{class jpabook.jpashop.JpashopApplication}', contextInitializerClasses = '[]', activeProfiles = '{}', propertySourceLocations = '{}', propertySourceProperties = '{org.springframework.boot.test.context.SpringBootTestContextBootstrapper=true}', contextCustomizers = set[org.springframework.boot.test.autoconfigure.actuate.metrics.MetricsExportContextCustomizerFactory$DisableMetricExportContextCustomizer@76ed1b7c, org.springframework.boot.test.autoconfigure.properties.PropertyMappingContextCustomizer@0, org.springframework.boot.test.autoconfigure.web.servlet.WebDriverContextCustomizerFactory$Customizer@71c3b41, org.springframework.boot.test.context.filter.ExcludeFilterContextCustomizer@5f16132a, org.springframework.boot.test.json.DuplicateJsonObjectContextCustomizerFactory$DuplicateJsonObjectContextCustomizer@87a85e1, org.springframework.boot.test.mock.mockito.MockitoContextCustomizer@0, org.springframework.boot.test.web.client.TestRestTemplateContextCustomizer@152aa092, org.springframework.boot.test.context.SpringBootTestArgs@1, org.springframework.boot.test.context.SpringBootTestWebEnvironment@368f2016], resourceBasePath = 'src/main/webapp', contextLoader = 'org.springframework.boot.test.context.SpringBootContextLoader', parent = [null]], attributes = map['org.springframework.test.context.web.ServletTestExecutionListener.activateListener' -> true, 'org.springframework.test.context.web.ServletTestExecutionListener.populatedRequestContextHolder' -> true, 'org.springframework.test.context.web.ServletTestExecutionListener.resetRequestContextHolder' -> true, 'org.springframework.test.context.event.ApplicationEventsTestExecutionListener.recordApplicationEvents' -> false]]; transaction manager [org.springframework.orm.jpa.JpaTransactionManager@16890f00]; rollback [false]2022-10-10 15:40:18.006 DEBUG 11752 --- [ main] org.hibernate.SQL : call next value for hibernate_sequence2022-10-10 15:40:18.026 INFO 11752 --- [ main] p6spy : #1665384018026 | took 11ms | statement | connection 3| url jdbc:h2:tcp://localhost/~/jpashopcall next value for hibernate_sequencecall next value for hibernate_sequence;findMember == member: true2022-10-10 15:40:18.327 DEBUG 11752 --- [ main] org.hibernate.SQL : insert into member (username, id) values (?, ?)2022-10-10 15:40:18.338 INFO 11752 --- [ main] p6spy : #1665384018338 | took 1ms | statement | connection 3| url jdbc:h2:tcp://localhost/~/jpashopinsert into member (username, id) values (?, ?)insert into member (username, id) values ('memberd', 1);2022-10-10 15:40:18.350 INFO 11752 --- [ main] p6spy : #1665384018350 | took 1ms | commit | connection 3| url jdbc:h2:tcp://localhost/~/jpashop;2022-10-10 15:40:18.353 INFO 11752 --- [ main] o.s.t.c.transaction.TransactionContext : Committed transaction for test: [DefaultTestContext@338c99c8 testClass = MemberRepositoryTest, testInstance = jpabook.jpashop.MemberRepositoryTest@68f264bf, testMethod = testMember@MemberRepositoryTest, testException = [null], mergedContextConfiguration = [WebMergedContextConfiguration@21ba0741 testClass = MemberRepositoryTest, locations = '{}', classes = '{class jpabook.jpashop.JpashopApplication}', contextInitializerClasses = '[]', activeProfiles = '{}', propertySourceLocations = '{}', propertySourceProperties = '{org.springframework.boot.test.context.SpringBootTestContextBootstrapper=true}', contextCustomizers = set[org.springframework.boot.test.autoconfigure.actuate.metrics.MetricsExportContextCustomizerFactory$DisableMetricExportContextCustomizer@76ed1b7c, org.springframework.boot.test.autoconfigure.properties.PropertyMappingContextCustomizer@0, org.springframework.boot.test.autoconfigure.web.servlet.WebDriverContextCustomizerFactory$Customizer@71c3b41, org.springframework.boot.test.context.filter.ExcludeFilterContextCustomizer@5f16132a, org.springframework.boot.test.json.DuplicateJsonObjectContextCustomizerFactory$DuplicateJsonObjectContextCustomizer@87a85e1, org.springframework.boot.test.mock.mockito.MockitoContextCustomizer@0, org.springframework.boot.test.web.client.TestRestTemplateContextCustomizer@152aa092, org.springframework.boot.test.context.SpringBootTestArgs@1, org.springframework.boot.test.context.SpringBootTestWebEnvironment@368f2016], resourceBasePath = 'src/main/webapp', contextLoader = 'org.springframework.boot.test.context.SpringBootContextLoader', parent = [null]], attributes = map['org.springframework.test.context.web.ServletTestExecutionListener.activateListener' -> true, 'org.springframework.test.context.web.ServletTestExecutionListener.populatedRequestContextHolder' -> true, 'org.springframework.test.context.web.ServletTestExecutionListener.resetRequestContextHolder' -> true, 'org.springframework.test.context.event.ApplicationEventsTestExecutionListener.recordApplicationEvents' -> false]]2022-10-10 15:40:18.375 INFO 11752 --- [ionShutdownHook] j.LocalContainerEntityManagerFactoryBean : Closing JPA EntityManagerFactory for persistence unit 'default'2022-10-10 15:40:18.379 INFO 11752 --- [ionShutdownHook] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown initiated...2022-10-10 15:40:18.400 INFO 11752 --- [ionShutdownHook] com.zaxxer.hikari.HikariDataSource : HikariPool-1 - Shutdown completed.Process finished with exit code 0