Skip to content

[Test]: 도메인 변경에 따른 테스트 깨짐 현상 수정 #6

[Test]: 도메인 변경에 따른 테스트 깨짐 현상 수정

[Test]: 도메인 변경에 따른 테스트 깨짐 현상 수정 #6

GitHub Actions / JUnit Test Report failed Sep 4, 2024 in 0s

31 tests run, 29 passed, 0 skipped, 2 failed.

Annotations

Check failure on line 36 in zzansuni-api-server/app/src/test/java/org/haedal/zzansuni/challengegroup/domain/application/ChallengeGroupServiceTest.java

See this annotation in the file changed.

@github-actions github-actions / JUnit Test Report

ChallengeGroupServiceTest.챌린지 그룹 생성이 정상적으로 동작한다.

jakarta.validation.ConstraintViolationException: activePeriod: activePeriod는 필수값입니다.
Raw output
jakarta.validation.ConstraintViolationException: activePeriod: activePeriod는 필수값입니다.
	at app//org.haedal.zzansuni.core.utils.SelfValidating.validateSelf(SelfValidating.java:29)
	at app//org.haedal.zzansuni.challengegroup.domain.ChallengeGroupCommand$CreateChallenge.<init>(ChallengeGroupCommand.java:57)
	at app//org.haedal.zzansuni.challengegroup.domain.ChallengeGroupCommand$CreateChallenge$CreateChallengeBuilder.build(ChallengeGroupCommand.java:50)
	at app//org.haedal.zzansuni.challengegroup.domain.application.ChallengeGroupServiceTest.createChallengeGroup(ChallengeGroupServiceTest.java:36)
	at [email protected]/java.lang.reflect.Method.invoke(Method.java:569)
	at [email protected]/java.util.ArrayList.forEach(ArrayList.java:1511)
	at [email protected]/java.util.ArrayList.forEach(ArrayList.java:1511)

Check failure on line 76 in zzansuni-api-server/app/src/test/java/org/haedal/zzansuni/challengegroup/domain/application/ChallengeGroupServiceTest.java

See this annotation in the file changed.

@github-actions github-actions / JUnit Test Report

ChallengeGroupServiceTest.챌린지 그룹 삭제가 정상적으로 동작한다.

org.springframework.dao.DataIntegrityViolationException: could not execute statement [NULL not allowed for column "JOIN_END_DATE"; SQL statement:
insert into challenge_group (category,content,created_at,cumulative_count,guide,join_end_date,join_start_date,modified_at,title,id) values (?,?,?,?,?,?,?,?,?,default) [23502-224]] [insert into challenge_group (category,content,created_at,cumulative_count,guide,join_end_date,join_start_date,modified_at,title,id) values (?,?,?,?,?,?,?,?,?,default)]; SQL [insert into challenge_group (category,content,created_at,cumulative_count,guide,join_end_date,join_start_date,modified_at,title,id) values (?,?,?,?,?,?,?,?,?,default)]; constraint [null]
Raw output
org.springframework.dao.DataIntegrityViolationException: could not execute statement [NULL not allowed for column "JOIN_END_DATE"; SQL statement:
insert into challenge_group (category,content,created_at,cumulative_count,guide,join_end_date,join_start_date,modified_at,title,id) values (?,?,?,?,?,?,?,?,?,default) [23502-224]] [insert into challenge_group (category,content,created_at,cumulative_count,guide,join_end_date,join_start_date,modified_at,title,id) values (?,?,?,?,?,?,?,?,?,default)]; SQL [insert into challenge_group (category,content,created_at,cumulative_count,guide,join_end_date,join_start_date,modified_at,title,id) values (?,?,?,?,?,?,?,?,?,default)]; constraint [null]
	at app//org.springframework.orm.jpa.vendor.HibernateJpaDialect.convertHibernateAccessException(HibernateJpaDialect.java:290)
	at app//org.springframework.orm.jpa.vendor.HibernateJpaDialect.translateExceptionIfPossible(HibernateJpaDialect.java:241)
	at app//org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.translateExceptionIfPossible(AbstractEntityManagerFactoryBean.java:550)
	at app//org.springframework.dao.support.ChainedPersistenceExceptionTranslator.translateExceptionIfPossible(ChainedPersistenceExceptionTranslator.java:61)
	at app//org.springframework.dao.support.DataAccessUtils.translateIfNecessary(DataAccessUtils.java:335)
	at app//org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:152)
	at app//org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:184)
	at app//org.springframework.data.jpa.repository.support.CrudMethodMetadataPostProcessor$CrudMethodMetadataPopulatingMethodInterceptor.invoke(CrudMethodMetadataPostProcessor.java:165)
	at app//org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:184)
	at app//org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:97)
	at app//org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:184)
	at app//org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:223)
	at app/jdk.proxy3/jdk.proxy3.$Proxy174.save(Unknown Source)
	at app//org.haedal.zzansuni.challengegroup.domain.application.ChallengeGroupServiceTest.deleteChallengeGroup(ChallengeGroupServiceTest.java:76)
	at [email protected]/java.lang.reflect.Method.invoke(Method.java:569)
	at [email protected]/java.util.ArrayList.forEach(ArrayList.java:1511)
	at [email protected]/java.util.ArrayList.forEach(ArrayList.java:1511)
Caused by: org.hibernate.exception.ConstraintViolationException: could not execute statement [NULL not allowed for column "JOIN_END_DATE"; SQL statement:
insert into challenge_group (category,content,created_at,cumulative_count,guide,join_end_date,join_start_date,modified_at,title,id) values (?,?,?,?,?,?,?,?,?,default) [23502-224]] [insert into challenge_group (category,content,created_at,cumulative_count,guide,join_end_date,join_start_date,modified_at,title,id) values (?,?,?,?,?,?,?,?,?,default)]
	at app//org.hibernate.exception.internal.SQLExceptionTypeDelegate.convert(SQLExceptionTypeDelegate.java:62)
	at app//org.hibernate.exception.internal.StandardSQLExceptionConverter.convert(StandardSQLExceptionConverter.java:58)
	at app//org.hibernate.engine.jdbc.spi.SqlExceptionHelper.convert(SqlExceptionHelper.java:108)
	at app//org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.executeUpdate(ResultSetReturnImpl.java:197)
	at app//org.hibernate.id.insert.GetGeneratedKeysDelegate.performMutation(GetGeneratedKeysDelegate.java:116)
	at app//org.hibernate.engine.jdbc.mutation.internal.MutationExecutorSingleNonBatched.performNonBatchedOperations(MutationExecutorSingleNonBatched.java:47)
	at app//org.hibernate.engine.jdbc.mutation.internal.AbstractMutationExecutor.execute(AbstractMutationExecutor.java:55)
	at app//org.hibernate.persister.entity.mutation.InsertCoordinatorStandard.doStaticInserts(InsertCoordinatorStandard.java:194)
	at app//org.hibernate.persister.entity.mutation.InsertCoordinatorStandard.coordinateInsert(InsertCoordinatorStandard.java:132)
	at app//org.hibernate.persister.entity.mutation.InsertCoordinatorStandard.insert(InsertCoordinatorStandard.java:95)
	at app//org.hibernate.action.internal.EntityIdentityInsertAction.execute(EntityIdentityInsertAction.java:85)
	at app//org.hibernate.engine.spi.ActionQueue.execute(ActionQueue.java:670)
	at app//org.hibernate.engine.spi.ActionQueue.addResolvedEntityInsertAction(ActionQueue.java:291)
	at app//org.hibernate.engine.spi.ActionQueue.addInsertAction(ActionQueue.java:272)
	at app//org.hibernate.engine.spi.ActionQueue.addAction(ActionQueue.java:322)
	at app//org.hibernate.event.internal.AbstractSaveEventListener.addInsertAction(AbstractSaveEventListener.java:391)
	at app//org.hibernate.event.internal.AbstractSaveEventListener.performSaveOrReplicate(AbstractSaveEventListener.java:305)
	at app//org.hibernate.event.internal.AbstractSaveEventListener.performSave(AbstractSaveEventListener.java:224)
	at app//org.hibernate.event.internal.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:137)
	at app//org.hibernate.event.internal.DefaultPersistEventListener.entityIsTransient(DefaultPersistEventListener.java:175)
	at app//org.hibernate.event.internal.DefaultPersistEventListener.persist(DefaultPersistEventListener.java:93)
	at app//org.hibernate.event.internal.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:77)
	at app//org.hibernate.event.internal.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:54)
	at app//org.hibernate.event.service.internal.EventListenerGroupImpl.fireEventOnEachListener(EventListenerGroupImpl.java:127)
	at app//org.hibernate.internal.SessionImpl.firePersist(SessionImpl.java:757)
	at app//org.hibernate.internal.SessionImpl.persist(SessionImpl.java:741)
	at jdk.internal.reflect.GeneratedMethodAccessor80.invoke(Unknown Source)
	at [email protected]/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at [email protected]/java.lang.reflect.Method.invoke(Method.java:569)
	at app//org.springframework.orm.jpa.SharedEntityManagerCreator$SharedEntityManagerInvocationHandler.invoke(SharedEntityManagerCreator.java:319)
	at app/jdk.proxy3/jdk.proxy3.$Proxy168.persist(Unknown Source)
	at app//org.springframework.data.jpa.repository.support.SimpleJpaRepository.save(SimpleJpaRepository.java:628)
	at jdk.internal.reflect.GeneratedMethodAccessor79.invoke(Unknown Source)
	at [email protected]/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at [email protected]/java.lang.reflect.Method.invoke(Method.java:569)
	at app//org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:354)
	at app//org.springframework.data.repository.core.support.RepositoryMethodInvoker$RepositoryFragmentMethodInvoker.lambda$new$0(RepositoryMethodInvoker.java:277)
	at app//org.springframework.data.repository.core.support.RepositoryMethodInvoker.doInvoke(RepositoryMethodInvoker.java:170)
	at app//org.springframework.data.repository.core.support.RepositoryMethodInvoker.invoke(RepositoryMethodInvoker.java:158)
	at app//org.springframework.data.repository.core.support.RepositoryComposition$RepositoryFragments.invoke(RepositoryComposition.java:516)
	at app//org.springframework.data.repository.core.support.RepositoryComposition.invoke(RepositoryComposition.java:285)
	at app//org.springframework.data.repository.core.support.RepositoryFactorySupport$ImplementationMethodExecutionInterceptor.invoke(RepositoryFactorySupport.java:628)
	at app//org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:184)
	at app//org.springframework.data.repository.core.support.QueryExecutorMethodInterceptor.doInvoke(QueryExecutorMethodInterceptor.java:168)
	at app//org.springframework.data.repository.core.support.QueryExecutorMethodInterceptor.invoke(QueryExecutorMethodInterceptor.java:143)
	at app//org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:184)
	at app//org.springframework.data.projection.DefaultMethodInvokingMethodInterceptor.invoke(DefaultMethodInvokingMethodInterceptor.java:70)
	at app//org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:184)
	at app//org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:123)
	at app//org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:392)
	at app//org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:119)
	at app//org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:184)
	at app//org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:137)
	... 11 more
Caused by: org.h2.jdbc.JdbcSQLIntegrityConstraintViolationException: NULL not allowed for column "JOIN_END_DATE"; SQL statement:
insert into challenge_group (category,content,created_at,cumulative_count,guide,join_end_date,join_start_date,modified_at,title,id) values (?,?,?,?,?,?,?,?,?,default) [23502-224]
	at org.h2.message.DbException.getJdbcSQLException(DbException.java:520)
	at org.h2.message.DbException.getJdbcSQLException(DbException.java:489)
	at org.h2.message.DbException.get(DbException.java:223)
	at org.h2.message.DbException.get(DbException.java:199)
	at org.h2.table.Column.validateConvertUpdateSequence(Column.java:365)
	at org.h2.table.Table.convertInsertRow(Table.java:936)
	at org.h2.command.dml.Insert.insertRows(Insert.java:167)
	at org.h2.command.dml.Insert.update(Insert.java:135)
	at org.h2.command.CommandContainer.executeUpdateWithGeneratedKeys(CommandContainer.java:242)
	at org.h2.command.CommandContainer.update(CommandContainer.java:163)
	at org.h2.command.Command.executeUpdate(Command.java:256)
	at org.h2.jdbc.JdbcPreparedStatement.executeUpdateInternal(JdbcPreparedStatement.java:216)
	at org.h2.jdbc.JdbcPreparedStatement.executeUpdate(JdbcPreparedStatement.java:174)
	at com.zaxxer.hikari.pool.ProxyPreparedStatement.executeUpdate(ProxyPreparedStatement.java:61)
	at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.executeUpdate(HikariProxyPreparedStatement.java)
	at org.hibernate.engine.jdbc.internal.ResultSetReturnImpl.executeUpdate(ResultSetReturnImpl.java:194)
	... 60 more