CreateSupplyRecordTest

12

tests

0

failures

0

ignored

0.168s

duration

100%

successful

Tests

Test Duration Result
testCreateSupplyRecordValidInputs() 0.009s passed
testCreateSupplyRecordWithDNESupplyID() 0.005s passed
testCreateSupplyRecordWithFiveDecimals() 0.008s passed
testCreateSupplyRecordWithNegativeInputs() 0.014s passed
testCreateSupplyRecordWithOldDateAndDiffSupplyID() 0.016s passed
testCreateSupplyRecordWithOldDateAndSameSupplyID() 0.033s passed
testCreateSupplyRecordWithOnlyConsume() 0.008s passed
testCreateSupplyRecordWithSameDateAndDiffSupplyID() 0.019s passed
testCreateSupplyRecordWithSameDateAndSameSupplyID() 0.014s passed
testCreateSupplyRecordWithZeroAddedOrZeroConsumed() 0.016s passed
testCreateSupplyRecordWithZeroConsumedAndZeroAdded() 0.016s passed
testCreateSupplyRecordWithZeroDecimalPlace() 0.010s passed

Standard output

database name: db_poultry
database pass: DogIsSoAmazingAndKind
database port: 5432
Welcome to DBPoultry's DBMS
Connected to: jdbc:postgresql://localhost:5432/db_poultry

============================== DB_POULTRY ERROR 
Error at `createSupplyRecord()` in `CreateSupplyRecord`.
Date of the record to be inserted is after the last inserted record
Solution: Ensure that the date of the SupplyRecord to be inserted is after the last insert

======================== END OF DB_POULTRY ERROR
database name: db_poultry
database pass: DogIsSoAmazingAndKind
database port: 5432
Welcome to DBPoultry's DBMS
Connected to: jdbc:postgresql://localhost:5432/db_poultry

============================== DB_POULTRY ERROR 
Error at `createSupplyRecord()` in `CreateSupplyRecord`.
Added and consumed values are invalid.
Solution: Make sure that these values are positive, and consumed does make the currentSupplyNegative.

======================== END OF DB_POULTRY ERROR
database name: db_poultry
database pass: DogIsSoAmazingAndKind
database port: 5432
Welcome to DBPoultry's DBMS
Connected to: jdbc:postgresql://localhost:5432/db_poultry
database name: db_poultry
database pass: DogIsSoAmazingAndKind
database port: 5432
Welcome to DBPoultry's DBMS
Connected to: jdbc:postgresql://localhost:5432/db_poultry
database name: db_poultry
database pass: DogIsSoAmazingAndKind
database port: 5432
Welcome to DBPoultry's DBMS
Connected to: jdbc:postgresql://localhost:5432/db_poultry
database name: db_poultry
database pass: DogIsSoAmazingAndKind
database port: 5432
Welcome to DBPoultry's DBMS
Connected to: jdbc:postgresql://localhost:5432/db_poultry
database name: db_poultry
database pass: DogIsSoAmazingAndKind
database port: 5432
Welcome to DBPoultry's DBMS
Connected to: jdbc:postgresql://localhost:5432/db_poultry

============================== DB_POULTRY ERROR 
Error at `createSupplyRecord()` in `CreateSupplyRecord`.
Added and consumed values are invalid.
Solution: Make sure that these values are positive, and consumed does make the currentSupplyNegative.

======================== END OF DB_POULTRY ERROR

============================== DB_POULTRY ERROR 
Error at `createSupplyRecord()` in `CreateSupplyRecord`.
Added and consumed values are invalid.
Solution: Make sure that these values are positive, and consumed does make the currentSupplyNegative.

======================== END OF DB_POULTRY ERROR

============================== DB_POULTRY ERROR 
Error at `createSupplyRecord()` in `CreateSupplyRecord`.
Added and consumed values are invalid.
Solution: Make sure that these values are positive, and consumed does make the currentSupplyNegative.

======================== END OF DB_POULTRY ERROR
database name: db_poultry
database pass: DogIsSoAmazingAndKind
database port: 5432
Welcome to DBPoultry's DBMS
Connected to: jdbc:postgresql://localhost:5432/db_poultry

============================== DB_POULTRY ERROR 
Error at `createSupplyRecord()` in `CreateSupplyRecord`.
SupplyType does not exist
Solution: Ensure that the SupplyType ID of the SupplyRecord to be inserted exists

======================== END OF DB_POULTRY ERROR
database name: db_poultry
database pass: DogIsSoAmazingAndKind
database port: 5432
Welcome to DBPoultry's DBMS
Connected to: jdbc:postgresql://localhost:5432/db_poultry
database name: db_poultry
database pass: DogIsSoAmazingAndKind
database port: 5432
Welcome to DBPoultry's DBMS
Connected to: jdbc:postgresql://localhost:5432/db_poultry

============================== DB_POULTRY ERROR 
Error at `createSupplyRecord()` in CreateSupplyRecord.
The precision of added and/or consumed is greater than 4.
Solution: Ensure that the precision of added and consumed is at most 4.

======================== END OF DB_POULTRY ERROR
database name: db_poultry
database pass: DogIsSoAmazingAndKind
database port: 5432
Welcome to DBPoultry's DBMS
Connected to: jdbc:postgresql://localhost:5432/db_poultry

============================== DB_POULTRY ERROR 
Error in `createSupplyRecord()` in `createSupplyRecord.
SQL Exception error occurred
Solution: No solution provided.

Exception Stack Trace:

======================== END OF DB_POULTRY ERROR
database name: db_poultry
database pass: DogIsSoAmazingAndKind
database port: 5432
Welcome to DBPoultry's DBMS
Connected to: jdbc:postgresql://localhost:5432/db_poultry

Standard error

org.postgresql.util.PSQLException: ERROR: duplicate key value violates unique constraint "supply_record_supply_type_id_sr_date_key"
  Detail: Key (supply_type_id, sr_date)=(1, 2025-01-02) already exists.
	at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2725)
	at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2412)
	at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:371)
	at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:502)
	at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:419)
	at org.postgresql.jdbc.PgPreparedStatement.executeWithFlags(PgPreparedStatement.java:194)
	at org.postgresql.jdbc.PgPreparedStatement.executeUpdate(PgPreparedStatement.java:155)
	at org.db_poultry.db.supplyRecordDAO.CreateSupplyRecord.createSupplyRecord(CreateSupplyRecord.java:132)
	at org.db_poultry.db.supplyRecordDAO.CreateSupplyRecordTest.testCreateSupplyRecordWithSameDateAndSameSupplyID(CreateSupplyRecordTest.kt:79)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
	at java.base/java.lang.reflect.Method.invoke(Method.java:580)
	at org.junit.platform.commons.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:728)
	at org.junit.jupiter.engine.execution.MethodInvocation.proceed(MethodInvocation.java:60)
	at org.junit.jupiter.engine.execution.InvocationInterceptorChain$ValidatingInvocation.proceed(InvocationInterceptorChain.java:131)
	at org.junit.jupiter.engine.extension.TimeoutExtension.intercept(TimeoutExtension.java:156)
	at org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestableMethod(TimeoutExtension.java:147)
	at org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestMethod(TimeoutExtension.java:86)
	at org.junit.jupiter.engine.execution.InterceptingExecutableInvoker$ReflectiveInterceptorCall.lambda$ofVoidMethod$0(InterceptingExecutableInvoker.java:103)
	at org.junit.jupiter.engine.execution.InterceptingExecutableInvoker.lambda$invoke$0(InterceptingExecutableInvoker.java:93)
	at org.junit.jupiter.engine.execution.InvocationInterceptorChain$InterceptedInvocation.proceed(InvocationInterceptorChain.java:106)
	at org.junit.jupiter.engine.execution.InvocationInterceptorChain.proceed(InvocationInterceptorChain.java:64)
	at org.junit.jupiter.engine.execution.InvocationInterceptorChain.chainAndInvoke(InvocationInterceptorChain.java:45)
	at org.junit.jupiter.engine.execution.InvocationInterceptorChain.invoke(InvocationInterceptorChain.java:37)
	at org.junit.jupiter.engine.execution.InterceptingExecutableInvoker.invoke(InterceptingExecutableInvoker.java:92)
	at org.junit.jupiter.engine.execution.InterceptingExecutableInvoker.invoke(InterceptingExecutableInvoker.java:86)
	at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$invokeTestMethod$7(TestMethodTestDescriptor.java:218)
	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
	at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.invokeTestMethod(TestMethodTestDescriptor.java:214)
	at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:139)
	at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:69)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6(NodeTestTask.java:151)
	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:141)
	at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9(NodeTestTask.java:139)
	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:138)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:95)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1596)
	at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:41)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6(NodeTestTask.java:155)
	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:141)
	at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9(NodeTestTask.java:139)
	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:138)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:95)
	at java.base/java.util.ArrayList.forEach(ArrayList.java:1596)
	at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:41)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6(NodeTestTask.java:155)
	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:141)
	at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9(NodeTestTask.java:139)
	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:138)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:95)
	at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.submit(SameThreadHierarchicalTestExecutorService.java:35)
	at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute(HierarchicalTestExecutor.java:57)
	at org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine.execute(HierarchicalTestEngine.java:54)
	at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:198)
	at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:169)
	at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:93)
	at org.junit.platform.launcher.core.EngineExecutionOrchestrator.lambda$execute$0(EngineExecutionOrchestrator.java:58)
	at org.junit.platform.launcher.core.EngineExecutionOrchestrator.withInterceptedStreams(EngineExecutionOrchestrator.java:141)
	at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:57)
	at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:103)
	at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:85)
	at org.junit.platform.launcher.core.DelegatingLauncher.execute(DelegatingLauncher.java:47)
	at org.gradle.api.internal.tasks.testing.junitplatform.JUnitPlatformTestClassProcessor$CollectAllTestClassesExecutor.processAllTestClasses(JUnitPlatformTestClassProcessor.java:124)
	at org.gradle.api.internal.tasks.testing.junitplatform.JUnitPlatformTestClassProcessor$CollectAllTestClassesExecutor.access$000(JUnitPlatformTestClassProcessor.java:99)
	at org.gradle.api.internal.tasks.testing.junitplatform.JUnitPlatformTestClassProcessor.stop(JUnitPlatformTestClassProcessor.java:94)
	at org.gradle.api.internal.tasks.testing.SuiteTestClassProcessor.stop(SuiteTestClassProcessor.java:63)
	at java.base/jdk.internal.reflect.DirectMethodHandleAccessor.invoke(DirectMethodHandleAccessor.java:103)
	at java.base/java.lang.reflect.Method.invoke(Method.java:580)
	at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:36)
	at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
	at org.gradle.internal.dispatch.ContextClassLoaderDispatch.dispatch(ContextClassLoaderDispatch.java:33)
	at org.gradle.internal.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:92)
	at jdk.proxy1/jdk.proxy1.$Proxy4.stop(Unknown Source)
	at org.gradle.api.internal.tasks.testing.worker.TestWorker$3.run(TestWorker.java:200)
	at org.gradle.api.internal.tasks.testing.worker.TestWorker.executeAndMaintainThreadName(TestWorker.java:132)
	at org.gradle.api.internal.tasks.testing.worker.TestWorker.execute(TestWorker.java:103)
	at org.gradle.api.internal.tasks.testing.worker.TestWorker.execute(TestWorker.java:63)
	at org.gradle.process.internal.worker.child.ActionExecutionWorker.execute(ActionExecutionWorker.java:56)
	at org.gradle.process.internal.worker.child.SystemApplicationClassLoaderWorker.call(SystemApplicationClassLoaderWorker.java:122)
	at org.gradle.process.internal.worker.child.SystemApplicationClassLoaderWorker.call(SystemApplicationClassLoaderWorker.java:72)
	at worker.org.gradle.process.internal.worker.GradleWorkerMain.run(GradleWorkerMain.java:69)
	at worker.org.gradle.process.internal.worker.GradleWorkerMain.main(GradleWorkerMain.java:74)