Normal view
- Bootstrapped confidence interval overestimates variance in difference of means โ stats.stackexchange.comI'm trying to translate a Welch T-test into a bootstrap sampling scheme. However, I'm finding that the bootstrapped 95% confidence interval is much larger than the Welch T-test. Perhaps this is just a ...
- Spring boot upgrade from 3.1.9 to 3.2.3 Caused by: java.lang.IllegalArgumentException: authenticationManager cannot be nullI am upgrading my spring boot project from 3.1.9 to 3.2.3, I am getting error while running the tests. Found that below line of code is causing the issue. httpsecurity.anonymous(AbstractHttpConfigurer::disable) Below is the exception stack trace [INFO] T E S T S [INFO] ------------------------------------------------------- [INFO] Running com.test.AuthenticationPropertiesTest
Spring boot upgrade from 3.1.9 to 3.2.3 Caused by: java.lang.IllegalArgumentException: authenticationManager cannot be null
I am upgrading my spring boot project from 3.1.9 to 3.2.3, I am getting error while running the tests. Found that below line of code is causing the issue.
httpsecurity.anonymous(AbstractHttpConfigurer::disable)
Below is the exception stack trace
[INFO] T E S T S
[INFO] -------------------------------------------------------
[INFO] Running com.test.AuthenticationPropertiesTest
OpenJDK 64-Bit Server VM warning: Sharing is only supported for boot loader classes because bootstrap classpath has been appended
2024-04-24T10:41:55.505+05:30 INFO 24448 --- [ main] org.ehcache.core.EhcacheManager : Cache 'authenticationCache' created in EhcacheManager.
10:41:56.565 [main] ERROR org.springframework.boot.SpringApplication - Application run failed
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.springframework.security.config.annotation.web.configuration.WebSecurityConfiguration': Unsatisfied dependency expressed through method 'setFilterChains' parameter 0: Error creating bean with name 'filterChain' defined in class path resource [com/sample/WebSecurityConfig.class]: Failed to instantiate [org.springframework.security.web.SecurityFilterChain]: Factory method 'filterChain' threw exception with message: authenticationManager cannot be null
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredMethodElement.resolveMethodArguments(AutowiredAnnotationBeanPostProcessor.java:895) ~[spring-beans-6.1.4.jar:6.1.4]
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredMethodElement.inject(AutowiredAnnotationBeanPostProcessor.java:848) ~[spring-beans-6.1.4.jar:6.1.4]
at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:145) ~[spring-beans-6.1.4.jar:6.1.4]
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessProperties(AutowiredAnnotationBeanPostProcessor.java:508) ~[spring-beans-6.1.4.jar:6.1.4]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1419) ~[spring-beans-6.1.4.jar:6.1.4]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:599) ~[spring-beans-6.1.4.jar:6.1.4]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:522) ~[spring-beans-6.1.4.jar:6.1.4]
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:325) ~[spring-beans-6.1.4.jar:6.1.4]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-6.1.4.jar:6.1.4]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:323) ~[spring-beans-6.1.4.jar:6.1.4]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199) ~[spring-beans-6.1.4.jar:6.1.4]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:975) ~[spring-beans-6.1.4.jar:6.1.4]
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:959) ~[spring-context-6.1.4.jar:6.1.4]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:624) ~[spring-context-6.1.4.jar:6.1.4]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:754) ~[spring-boot-3.2.3.jar:3.2.3]
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:456) ~[spring-boot-3.2.3.jar:3.2.3]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:334) ~[spring-boot-3.2.3.jar:3.2.3]
at org.springframework.boot.test.context.SpringBootContextLoader.lambda$loadContext$3(SpringBootContextLoader.java:137) ~[spring-boot-test-3.2.3.jar:3.2.3]
at org.springframework.util.function.ThrowingSupplier.get(ThrowingSupplier.java:58) ~[spring-core-6.1.4.jar:6.1.4]
at org.springframework.util.function.ThrowingSupplier.get(ThrowingSupplier.java:46) ~[spring-core-6.1.4.jar:6.1.4]
at org.springframework.boot.SpringApplication.withHook(SpringApplication.java:1454) ~[spring-boot-3.2.3.jar:3.2.3]
at org.springframework.boot.test.context.SpringBootContextLoader$ContextLoaderHook.run(SpringBootContextLoader.java:553) ~[spring-boot-test-3.2.3.jar:3.2.3]
at org.springframework.boot.test.context.SpringBootContextLoader.loadContext(SpringBootContextLoader.java:137) ~[spring-boot-test-3.2.3.jar:3.2.3]
at org.springframework.boot.test.context.SpringBootContextLoader.loadContext(SpringBootContextLoader.java:108) ~[spring-boot-test-3.2.3.jar:3.2.3]
at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContextInternal(DefaultCacheAwareContextLoaderDelegate.java:225) ~[spring-test-6.1.4.jar:6.1.4]
at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:152) ~[spring-test-6.1.4.jar:6.1.4]
at org.springframework.test.context.support.DefaultTestContext.getApplicationContext(DefaultTestContext.java:130) ~[spring-test-6.1.4.jar:6.1.4]
at org.springframework.test.context.web.ServletTestExecutionListener.setUpRequestContextIfNecessary(ServletTestExecutionListener.java:191) ~[spring-test-6.1.4.jar:6.1.4]
at org.springframework.test.context.web.ServletTestExecutionListener.prepareTestInstance(ServletTestExecutionListener.java:130) ~[spring-test-6.1.4.jar:6.1.4]
at org.springframework.test.context.TestContextManager.prepareTestInstance(TestContextManager.java:260) ~[spring-test-6.1.4.jar:6.1.4]
at org.springframework.test.context.junit.jupiter.SpringExtension.postProcessTestInstance(SpringExtension.java:163) ~[spring-test-6.1.4.jar:6.1.4]
at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.lambda$invokeTestInstancePostProcessors$10(ClassBasedTestDescriptor.java:378) ~[junit-jupiter-engine-5.10.2.jar:5.10.2]
at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.executeAndMaskThrowable(ClassBasedTestDescriptor.java:383) ~[junit-jupiter-engine-5.10.2.jar:5.10.2]
at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.lambda$invokeTestInstancePostProcessors$11(ClassBasedTestDescriptor.java:378) ~[junit-jupiter-engine-5.10.2.jar:5.10.2]
at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197) ~[?:?]
at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:179) ~[?:?]
at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1625) ~[?:?]
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509) ~[?:?]
at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499) ~[?:?]
at java.util.stream.StreamSpliterators$WrappingSpliterator.forEachRemaining(StreamSpliterators.java:310) ~[?:?]
at java.util.stream.Streams$ConcatSpliterator.forEachRemaining(Streams.java:735) ~[?:?]
at java.util.stream.Streams$ConcatSpliterator.forEachRemaining(Streams.java:734) ~[?:?]
at java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:762) ~[?:?]
at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.invokeTestInstancePostProcessors(ClassBasedTestDescriptor.java:377) ~[junit-jupiter-engine-5.10.2.jar:5.10.2]
at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.lambda$instantiateAndPostProcessTestInstance$6(ClassBasedTestDescriptor.java:290) ~[junit-jupiter-engine-5.10.2.jar:5.10.2]
at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) ~[junit-platform-engine-1.10.2.jar:1.10.2]
at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.instantiateAndPostProcessTestInstance(ClassBasedTestDescriptor.java:289) ~[junit-jupiter-engine-5.10.2.jar:5.10.2]
at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.lambda$testInstancesProvider$4(ClassBasedTestDescriptor.java:279) ~[junit-jupiter-engine-5.10.2.jar:5.10.2]
at java.util.Optional.orElseGet(Optional.java:364) ~[?:?]
at org.junit.jupiter.engine.descriptor.ClassBasedTestDescriptor.lambda$testInstancesProvider$5(ClassBasedTestDescriptor.java:278) ~[junit-jupiter-engine-5.10.2.jar:5.10.2]
at org.junit.jupiter.engine.execution.TestInstancesProvider.getTestInstances(TestInstancesProvider.java:31) ~[junit-jupiter-engine-5.10.2.jar:5.10.2]
at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$prepare$0(TestMethodTestDescriptor.java:106) ~[junit-jupiter-engine-5.10.2.jar:5.10.2]
at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) ~[junit-platform-engine-1.10.2.jar:1.10.2]
at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.prepare(TestMethodTestDescriptor.java:105) ~[junit-jupiter-engine-5.10.2.jar:5.10.2]
at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.prepare(TestMethodTestDescriptor.java:69) ~[junit-jupiter-engine-5.10.2.jar:5.10.2]
at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$prepare$2(NodeTestTask.java:123) ~[junit-platform-engine-1.10.2.jar:1.10.2]
at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) ~[junit-platform-engine-1.10.2.jar:1.10.2]
at org.junit.platform.engine.support.hierarchical.NodeTestTask.prepare(NodeTestTask.java:123) ~[junit-platform-engine-1.10.2.jar:1.10.2]
at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:90) ~[junit-platform-engine-1.10.2.jar:1.10.2]
at java.util.ArrayList.forEach(ArrayList.java:1511) ~[?:?]
at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:41) ~[junit-platform-engine-1.10.2.jar:1.10.2]
at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6(NodeTestTask.java:155) ~[junit-platform-engine-1.10.2.jar:1.10.2]
at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) ~[junit-platform-engine-1.10.2.jar:1.10.2]
at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:141) ~[junit-platform-engine-1.10.2.jar:1.10.2]
at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137) ~[junit-platform-engine-1.10.2.jar:1.10.2]
at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9(NodeTestTask.java:139) ~[junit-platform-engine-1.10.2.jar:1.10.2]
at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) ~[junit-platform-engine-1.10.2.jar:1.10.2]
at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:138) ~[junit-platform-engine-1.10.2.jar:1.10.2]
at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:95) ~[junit-platform-engine-1.10.2.jar:1.10.2]
at java.util.ArrayList.forEach(ArrayList.java:1511) ~[?:?]
at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:41) ~[junit-platform-engine-1.10.2.jar:1.10.2]
at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6(NodeTestTask.java:155) ~[junit-platform-engine-1.10.2.jar:1.10.2]
at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) ~[junit-platform-engine-1.10.2.jar:1.10.2]
at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:141) ~[junit-platform-engine-1.10.2.jar:1.10.2]
at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137) ~[junit-platform-engine-1.10.2.jar:1.10.2]
at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9(NodeTestTask.java:139) ~[junit-platform-engine-1.10.2.jar:1.10.2]
at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73) ~[junit-platform-engine-1.10.2.jar:1.10.2]
at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:138) ~[junit-platform-engine-1.10.2.jar:1.10.2]
at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:95) ~[junit-platform-engine-1.10.2.jar:1.10.2]
at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.submit(SameThreadHierarchicalTestExecutorService.java:35) ~[junit-platform-engine-1.10.2.jar:1.10.2]
at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute(HierarchicalTestExecutor.java:57) ~[junit-platform-engine-1.10.2.jar:1.10.2]
at org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine.execute(HierarchicalTestEngine.java:54) ~[junit-platform-engine-1.10.2.jar:1.10.2]
at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:198) ~[junit-platform-launcher-1.10.2.jar:1.10.2]
at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:169) ~[junit-platform-launcher-1.10.2.jar:1.10.2]
at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:93) ~[junit-platform-launcher-1.10.2.jar:1.10.2]
at org.junit.platform.launcher.core.EngineExecutionOrchestrator.lambda$execute$0(EngineExecutionOrchestrator.java:58) ~[junit-platform-launcher-1.10.2.jar:1.10.2]
at org.junit.platform.launcher.core.EngineExecutionOrchestrator.withInterceptedStreams(EngineExecutionOrchestrator.java:141) [junit-platform-launcher-1.10.2.jar:1.10.2]
at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:57) [junit-platform-launcher-1.10.2.jar:1.10.2]
at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:103) [junit-platform-launcher-1.10.2.jar:1.10.2]
at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:85) [junit-platform-launcher-1.10.2.jar:1.10.2]
at org.junit.platform.launcher.core.DelegatingLauncher.execute(DelegatingLauncher.java:47) [junit-platform-launcher-1.10.2.jar:1.10.2]
at org.apache.maven.surefire.junitplatform.LazyLauncher.execute(LazyLauncher.java:56) [surefire-junit-platform-3.1.2.jar:3.1.2]
at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.execute(JUnitPlatformProvider.java:184) [surefire-junit-platform-3.1.2.jar:3.1.2]
at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.invokeAllTests(JUnitPlatformProvider.java:148) [surefire-junit-platform-3.1.2.jar:3.1.2]
at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.invoke(JUnitPlatformProvider.java:122) [surefire-junit-platform-3.1.2.jar:3.1.2]
at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:385) [surefire-booter-3.1.2.jar:3.1.2]
at org.apache.maven.surefire.booter.ForkedBooter.execute(ForkedBooter.java:162) [surefire-booter-3.1.2.jar:3.1.2]
at org.apache.maven.surefire.booter.ForkedBooter.run(ForkedBooter.java:507) [surefire-booter-3.1.2.jar:3.1.2]
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:495) [surefire-booter-3.1.2.jar:3.1.2]
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'filterChain' defined in class path resource [com/sample/WebSecurityConfig.class]: Failed to instantiate [org.springframework.security.web.SecurityFilterChain]: Factory method 'filterChain' threw exception with message: authenticationManager cannot be null
at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:651) ~[spring-beans-6.1.4.jar:6.1.4]
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:639) ~[spring-beans-6.1.4.jar:6.1.4]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1335) ~[spring-beans-6.1.4.jar:6.1.4]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1165) ~[spring-beans-6.1.4.jar:6.1.4]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:562) ~[spring-beans-6.1.4.jar:6.1.4]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:522) ~[spring-beans-6.1.4.jar:6.1.4]
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:325) ~[spring-beans-6.1.4.jar:6.1.4]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-6.1.4.jar:6.1.4]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:323) ~[spring-beans-6.1.4.jar:6.1.4]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199) ~[spring-beans-6.1.4.jar:6.1.4]
at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:254) ~[spring-beans-6.1.4.jar:6.1.4]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.addCandidateEntry(DefaultListableBeanFactory.java:1689) ~[spring-beans-6.1.4.jar:6.1.4]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:1653) ~[spring-beans-6.1.4.jar:6.1.4]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveMultipleBeanCollection(DefaultListableBeanFactory.java:1543) ~[spring-beans-6.1.4.jar:6.1.4]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveMultipleBeans(DefaultListableBeanFactory.java:1511) ~[spring-beans-6.1.4.jar:6.1.4]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1392) ~[spring-beans-6.1.4.jar:6.1.4]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1353) ~[spring-beans-6.1.4.jar:6.1.4]
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredMethodElement.resolveMethodArguments(AutowiredAnnotationBeanPostProcessor.java:887) ~[spring-beans-6.1.4.jar:6.1.4]
... 98 more
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.security.web.SecurityFilterChain]: Factory method 'filterChain' threw exception with message: authenticationManager cannot be null
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:177) ~[spring-beans-6.1.4.jar:6.1.4]
at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:647) ~[spring-beans-6.1.4.jar:6.1.4]
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:639) ~[spring-beans-6.1.4.jar:6.1.4]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1335) ~[spring-beans-6.1.4.jar:6.1.4]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1165) ~[spring-beans-6.1.4.jar:6.1.4]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:562) ~[spring-beans-6.1.4.jar:6.1.4]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:522) ~[spring-beans-6.1.4.jar:6.1.4]
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:325) ~[spring-beans-6.1.4.jar:6.1.4]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-6.1.4.jar:6.1.4]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:323) ~[spring-beans-6.1.4.jar:6.1.4]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199) ~[spring-beans-6.1.4.jar:6.1.4]
at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:254) ~[spring-beans-6.1.4.jar:6.1.4]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.addCandidateEntry(DefaultListableBeanFactory.java:1689) ~[spring-beans-6.1.4.jar:6.1.4]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:1653) ~[spring-beans-6.1.4.jar:6.1.4]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveMultipleBeanCollection(DefaultListableBeanFactory.java:1543) ~[spring-beans-6.1.4.jar:6.1.4]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveMultipleBeans(DefaultListableBeanFactory.java:1511) ~[spring-beans-6.1.4.jar:6.1.4]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1392) ~[spring-beans-6.1.4.jar:6.1.4]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1353) ~[spring-beans-6.1.4.jar:6.1.4]
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredMethodElement.resolveMethodArguments(AutowiredAnnotationBeanPostProcessor.java:887) ~[spring-beans-6.1.4.jar:6.1.4]
... 98 more
Caused by: java.lang.IllegalArgumentException: authenticationManager cannot be null
at org.springframework.util.Assert.notNull(Assert.java:172) ~[spring-core-6.1.4.jar:6.1.4]
at org.springframework.security.web.authentication.www.BasicAuthenticationFilter.<init>(BasicAuthenticationFilter.java:135) ~[spring-security-web-6.2.2.jar:6.2.2]
at org.springframework.security.config.annotation.web.configurers.HttpBasicConfigurer.configure(HttpBasicConfigurer.java:211) ~[spring-security-config-6.2.2.jar:6.2.2]
at org.springframework.security.config.annotation.web.configurers.HttpBasicConfigurer.configure(HttpBasicConfigurer.java:83) ~[spring-security-config-6.2.2.jar:6.2.2]
at org.springframework.security.config.annotation.AbstractConfiguredSecurityBuilder.configure(AbstractConfiguredSecurityBuilder.java:376) ~[spring-security-config-6.2.2.jar:6.2.2]
at org.springframework.security.config.annotation.AbstractConfiguredSecurityBuilder.doBuild(AbstractConfiguredSecurityBuilder.java:330) ~[spring-security-config-6.2.2.jar:6.2.2]
at org.springframework.security.config.annotation.AbstractSecurityBuilder.build(AbstractSecurityBuilder.java:38) ~[spring-security-config-6.2.2.jar:6.2.2]
at com.sample.WebSecurityConfig.filterChain(WebSecurityConfig.java:85) ~[classes/:?]
at com.sample.WebSecurityConfig$$SpringCGLIB$$0.CGLIB$filterChain$0(<generated>) ~[classes/:?]
at com.sample.WebSecurityConfig$$SpringCGLIB$$FastClass$$1.invoke(<generated>) ~[classes/:?]
at org.springframework.cglib.proxy.MethodProxy.invokeSuper(MethodProxy.java:258) ~[spring-core-6.1.4.jar:6.1.4]
at org.springframework.context.annotation.ConfigurationClassEnhancer$BeanMethodInterceptor.intercept(ConfigurationClassEnhancer.java:331) ~[spring-context-6.1.4.jar:6.1.4]
at com.sample.audit.WebSecurityConfig$$SpringCGLIB$$0.filterChain(<generated>) ~[classes/:?]
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77) ~[?:?]
at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
at java.lang.reflect.Method.invoke(Method.java:568) ~[?:?]
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:140) ~[spring-beans-6.1.4.jar:6.1.4]
at org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:647) ~[spring-beans-6.1.4.jar:6.1.4]
at org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:639) ~[spring-beans-6.1.4.jar:6.1.4]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1335) ~[spring-beans-6.1.4.jar:6.1.4]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1165) ~[spring-beans-6.1.4.jar:6.1.4]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:562) ~[spring-beans-6.1.4.jar:6.1.4]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:522) ~[spring-beans-6.1.4.jar:6.1.4]
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:325) ~[spring-beans-6.1.4.jar:6.1.4]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-6.1.4.jar:6.1.4]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:323) ~[spring-beans-6.1.4.jar:6.1.4]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199) ~[spring-beans-6.1.4.jar:6.1.4]
at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:254) ~[spring-beans-6.1.4.jar:6.1.4]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.addCandidateEntry(DefaultListableBeanFactory.java:1689) ~[spring-beans-6.1.4.jar:6.1.4]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.findAutowireCandidates(DefaultListableBeanFactory.java:1653) ~[spring-beans-6.1.4.jar:6.1.4]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveMultipleBeanCollection(DefaultListableBeanFactory.java:1543) ~[spring-beans-6.1.4.jar:6.1.4]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveMultipleBeans(DefaultListableBeanFactory.java:1511) ~[spring-beans-6.1.4.jar:6.1.4]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1392) ~[spring-beans-6.1.4.jar:6.1.4]
at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1353) ~[spring-beans-6.1.4.jar:6.1.4]
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredMethodElement.resolveMethodArguments(AutowiredAnnotationBeanPostProcessor.java:887) ~[spring-beans-6.1.4.jar:6.1.4]
... 98 more
And SecurityFilterChain configuration as below
@Bean
public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
http.securityContext(a->a.requireExplicitSave(false))
.authorizeHttpRequests(a->a.dispatcherTypeMatchers(DispatcherType.ERROR, DispatcherType.FORWARD).permitAll());
http.csrf(AbstractHttpConfigurer::disable).sessionManagement(a->a.sessionCreationPolicy(SessionCreationPolicy.ALWAYS));
http.authorizeHttpRequests(a->a.requestMatchers(HttpMethod.GET, "/**").hasAnyAuthority(getAppPermissions())
.requestMatchers(HttpMethod.PUT, "/**").hasAnyAuthority(getAppPermissions())
.anyRequest().denyAll())
.anonymous(AbstractHttpConfigurer::disable)
.exceptionHandling(b->b.accessDeniedPage("/unauthorized"));
http.httpBasic(a->a.authenticationEntryPoint(authenticationEntryPoint));
http.headers(a->a.addHeaderWriter(new StaticHeadersWriter("Content-Security-Policy",getContentSecurityPolicy())));
return http.build();
}
From the above code if I comment .anonymous(AbstractHttpConfigurer::disable)
the build is successful, Please let me know if I am missing anything as commenting it is not a solution for me.
- How does reducing my alpha-threshold to 0.005 affect my required sample size? โ stats.stackexchange.comAmong statisticians there is an ongoing debate whether the long-standing "standard" threshold for declaring the outcome of a statistical test as "significant" (a.k.a. alpha-level) ...
How does reducing my alpha-threshold to 0.005 affect my required sample size? โ stats.stackexchange.com
- Why are my playwright tests sometimes successful and sometimes not?I have some playwright tests which are successful sometimes and sometimes not. (I actually had this problem with a website which is still in development. But I adapted it to a public url.) These are my files (file content is at the bottom of this post): โโโ Dockerfile โโโ package.json โโโ tests โ โโโ 00.spec.ts โ โโโ 01.spec.ts โ โโโ 02.spec.ts โ โโโ 03.spec.ts โ โโโ 04.spec.ts tests/00.spec.ts combines the tests 01-04 in one file. So I have four different tests and each is run twice
Why are my playwright tests sometimes successful and sometimes not?
I have some playwright tests which are successful sometimes and sometimes not.
(I actually had this problem with a website which is still in development. But I adapted it to a public url.)
These are my files (file content is at the bottom of this post):
โโโ Dockerfile
โโโ package.json
โโโ tests
โ โโโ 00.spec.ts
โ โโโ 01.spec.ts
โ โโโ 02.spec.ts
โ โโโ 03.spec.ts
โ โโโ 04.spec.ts
tests/00.spec.ts combines the tests 01-04 in one file. So I have four different tests and each is run twice (once in 00.spec.ts and once in 0x.spec.ts).
Execution command:
docker build -t playwright-test . && docker run --rm -it playwright-test
I ran the execution command ten times with the following results:
all successful
04 failed, others were successful
all successful
00 (league form 1) failed, others were successful
04 failed, others were successful
03 failed, others were successful
02 failed, others were successful
00 (league form 1) failed, others were successful
all successful
all successful
When a test fails, I see this error:
1) tests/00.spec.ts:54:7 โบ league form 1 โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
Test timeout of 30000ms exceeded.
Error: locator.click: Test timeout of 30000ms exceeded.
Call log:
- waiting for locator('#news-sidebar .sidebar-teaser form').locator('.form-wrapper').locator('.select-wrapper').nth(5).locator('a').filter({ hasText: /^Deutschland$/ })
- locator resolved to <a class="ng-binding" data-ng-click="wamData.areas.โฆ>Deutschland</a>
- attempting click action
- waiting for element to be visible, enabled and stable
- element is not visible - waiting...
58 | for (const div of await form_wrapper.locator('.select-wrapper').all()) {
59 | await div.locator('span.icon-angle-down').click(); // show dropdown options
> 60 | await div.locator('a', {hasText: new RegExp('^' + leagues[url][i] + '$') }).click(); // select option
| ^
61 | i++;
62 | }
63 | await form.locator('button:has-text("anzeigen")').click();
at /usr/src/app/tests/00.spec.ts:60:83
Why are the tests sometimes successful and sometimes not? Is there a way to make them always successful? (Maybe improve the playwright settings somehow?)
Files:
Dockerfile
FROM mcr.microsoft.com/playwright:v1.41.1-jammy
WORKDIR /usr/src/app
COPY package*.json ./
RUN npm install
COPY . .
ENTRYPOINT ["npx", "playwright", "test"]
package.json
{
"name": "playwright-tests",
"version": "1.0.0",
"description": "Testing web access using Playwright",
"scripts": {
"test": "jest"
},
"devDependencies": {
"@playwright/test": "^1.16.1",
"jest": "^27.3.1"
}
}
tests/00.spec.ts
import { test, expect } from '@playwright/test';
const delay = ms => new Promise(resolve => setTimeout(resolve, ms))
test.beforeEach(async ({ page }) => {
await page.goto('http://www.fussball.de');
// accept cookies
var ucr = await page.locator('#usercentrics-root');
await ucr.locator('button:has-text("Akzeptiere alle")').click();
});
var leagues = {
'https://www.fussball.de/spieltagsuebersicht/a-junioren-bundesliga-west-deutschland-a-junioren-bundesliga-a-junioren-saison2324-deutschland/-/staffel/02LNP13DU800000FVS5489B4VUAB0UC4-G#!/': [
'Deutschland',
'23/24',
'Meisterschaften',
'A-Junioren',
'Bundesliga',
'Deutschland',
'A-Junioren-Bundesliga West'
],
'https://www.fussball.de/spieltagsuebersicht/bfv-landesliga-odenwald-baden-landesliga-herren-saison2324-baden/-/staffel/02M5LMHKRK00000FVS5489B4VSAUO6GA-G#!/': [
'Baden',
'23/24',
'Meisterschaften',
'Herren',
'Landesliga',
'Baden',
'bfv-Landesliga Odenwald'
],
'https://www.fussball.de/spieltagsuebersicht/landesliga-mitte-bayern-landesliga-herren-saison2324-bayern/-/staffel/02LS70U7C4000007VS5489B4VUAB0UC4-G#!/': [
'Bayern',
'23/24',
'Meisterschaften',
'Herren',
'Landesliga',
'Bayern',
'Landesliga Mitte'
],
'https://www.fussball.de/spieltagsuebersicht/herren-landesliga-st1-berlin-landesliga-herren-saison2324-berlin/-/staffel/02M7480S2O000006VS5489B4VSAUO6GA-G#!/': [
'Berlin',
'23/24',
'Meisterschaften',
'Herren',
'Landesliga',
'Berlin',
'Herren Landesliga St.1'
],
};
var j = 1;
for (const url of Object.keys(leagues)) {
test('league form ' + j, async ({ page }) => {
var form = await page.locator('#news-sidebar .sidebar-teaser form');
var form_wrapper = await form.locator('.form-wrapper');
var i = 0;
for (const div of await form_wrapper.locator('.select-wrapper').all()) {
await div.locator('span.icon-angle-down').click(); // show dropdown options
await div.locator('a', {hasText: new RegExp('^' + leagues[url][i] + '$') }).click(); // select option
i++;
}
await form.locator('button:has-text("anzeigen")').click();
await expect(page).toHaveURL(url);
});
j++;
}
tests/01.spec.ts
import { test, expect } from '@playwright/test';
const delay = ms => new Promise(resolve => setTimeout(resolve, ms))
test.beforeEach(async ({ page }) => {
await page.goto('http://www.fussball.de');
// accept cookies
var ucr = await page.locator('#usercentrics-root');
await ucr.locator('button:has-text("Akzeptiere alle")').click();
});
var leagues = {
'https://www.fussball.de/spieltagsuebersicht/a-junioren-bundesliga-west-deutschland-a-junioren-bundesliga-a-junioren-saison2324-deutschland/-/staffel/02LNP13DU800000FVS5489B4VUAB0UC4-G#!/': [
'Deutschland',
'23/24',
'Meisterschaften',
'A-Junioren',
'Bundesliga',
'Deutschland',
'A-Junioren-Bundesliga West'
],
};
var j = 1;
for (const url of Object.keys(leagues)) {
test('league form ' + j, async ({ page }) => {
var form = await page.locator('#news-sidebar .sidebar-teaser form');
var form_wrapper = await form.locator('.form-wrapper');
var i = 0;
for (const div of await form_wrapper.locator('.select-wrapper').all()) {
await div.locator('span.icon-angle-down').click(); // show dropdown options
await div.locator('a', {hasText: new RegExp('^' + leagues[url][i] + '$') }).click(); // select option
i++;
}
await form.locator('button:has-text("anzeigen")').click();
await expect(page).toHaveURL(url);
});
j++;
}
tests/02.spec.ts
import { test, expect } from '@playwright/test';
const delay = ms => new Promise(resolve => setTimeout(resolve, ms))
test.beforeEach(async ({ page }) => {
await page.goto('http://www.fussball.de');
// accept cookies
var ucr = await page.locator('#usercentrics-root');
await ucr.locator('button:has-text("Akzeptiere alle")').click();
});
var leagues = {
'https://www.fussball.de/spieltagsuebersicht/bfv-landesliga-odenwald-baden-landesliga-herren-saison2324-baden/-/staffel/02M5LMHKRK00000FVS5489B4VSAUO6GA-G#!/': [
'Baden',
'23/24',
'Meisterschaften',
'Herren',
'Landesliga',
'Baden',
'bfv-Landesliga Odenwald'
],
};
var j = 1;
for (const url of Object.keys(leagues)) {
test('league form ' + j, async ({ page }) => {
var form = await page.locator('#news-sidebar .sidebar-teaser form');
var form_wrapper = await form.locator('.form-wrapper');
var i = 0;
for (const div of await form_wrapper.locator('.select-wrapper').all()) {
await div.locator('span.icon-angle-down').click(); // show dropdown options
await div.locator('a', {hasText: new RegExp('^' + leagues[url][i] + '$') }).click(); // select option
i++;
}
await form.locator('button:has-text("anzeigen")').click();
await expect(page).toHaveURL(url);
});
j++;
}
tests/03.spec.ts
import { test, expect } from '@playwright/test';
const delay = ms => new Promise(resolve => setTimeout(resolve, ms))
test.beforeEach(async ({ page }) => {
await page.goto('http://www.fussball.de');
// accept cookies
var ucr = await page.locator('#usercentrics-root');
await ucr.locator('button:has-text("Akzeptiere alle")').click();
});
var leagues = {
'https://www.fussball.de/spieltagsuebersicht/landesliga-mitte-bayern-landesliga-herren-saison2324-bayern/-/staffel/02LS70U7C4000007VS5489B4VUAB0UC4-G#!/': [
'Bayern',
'23/24',
'Meisterschaften',
'Herren',
'Landesliga',
'Bayern',
'Landesliga Mitte'
],
};
var j = 1;
for (const url of Object.keys(leagues)) {
test('league form ' + j, async ({ page }) => {
var form = await page.locator('#news-sidebar .sidebar-teaser form');
var form_wrapper = await form.locator('.form-wrapper');
var i = 0;
for (const div of await form_wrapper.locator('.select-wrapper').all()) {
await div.locator('span.icon-angle-down').click(); // show dropdown options
await div.locator('a', {hasText: new RegExp('^' + leagues[url][i] + '$') }).click(); // select option
i++;
}
await form.locator('button:has-text("anzeigen")').click();
await expect(page).toHaveURL(url);
});
j++;
}
tests/04.spec.ts
import { test, expect } from '@playwright/test';
const delay = ms => new Promise(resolve => setTimeout(resolve, ms))
test.beforeEach(async ({ page }) => {
await page.goto('http://www.fussball.de');
// accept cookies
var ucr = await page.locator('#usercentrics-root');
await ucr.locator('button:has-text("Akzeptiere alle")').click();
});
var leagues = {
'https://www.fussball.de/spieltagsuebersicht/herren-landesliga-st1-berlin-landesliga-herren-saison2324-berlin/-/staffel/02M7480S2O000006VS5489B4VSAUO6GA-G#!/': [
'Berlin',
'23/24',
'Meisterschaften',
'Herren',
'Landesliga',
'Berlin',
'Herren Landesliga St.1'
],
};
var j = 1;
for (const url of Object.keys(leagues)) {
test('league form ' + j, async ({ page }) => {
var form = await page.locator('#news-sidebar .sidebar-teaser form');
var form_wrapper = await form.locator('.form-wrapper');
var i = 0;
for (const div of await form_wrapper.locator('.select-wrapper').all()) {
await div.locator('span.icon-angle-down').click(); // show dropdown options
await div.locator('a', {hasText: new RegExp('^' + leagues[url][i] + '$') }).click(); // select option
i++;
}
await form.locator('button:has-text("anzeigen")').click();
await expect(page).toHaveURL(url);
});
j++;
}
- Significant Mann Whitney, and significant t-test, but in the other direction โ stats.stackexchange.comI was wondering if it is possible to have 2 samples (A and B), where A is stochastically dominant over B (via Mann Withney, or Kruskal Wallis), but where conversely B has a significantly higher mean ...
Significant Mann Whitney, and significant t-test, but in the other direction โ stats.stackexchange.com
- Calculate difference in 90th percentiles of two samples โ stats.stackexchange.comI have a dataset of ambulance response times before and after a quality improvement change. I'm looking to see if there is a difference in response times before and after the change. Specifically, I'm ...
Calculate difference in 90th percentiles of two samples โ stats.stackexchange.com
- using unpaired t-test when differences not normally distributed โ stats.stackexchange.comSuppose I have paired data. The differences are however not normally distributed (i.e., we cannot use paired t-test), but the individual data for the two groups are normally distributed and they seem ...
using unpaired t-test when differences not normally distributed โ stats.stackexchange.com
- Registering WebMvcConfigurer for MockMvc testI have a spring boot backend API where I use the following Configuration to do some formatting on the payload received by the API. @Configuration class WebConfig : WebMvcConfigurer { override fun addFormatters(registry: FormatterRegistry) { registerSpringFormatters(registry) //This is a custom method I wrote } } Now I need to write a unit test to test whether the input received to my controller is formatted correctly. I have written the following test for this. class MyApiContro
Registering WebMvcConfigurer for MockMvc test
I have a spring boot backend API where I use the following Configuration to do some formatting on the payload received by the API.
@Configuration
class WebConfig : WebMvcConfigurer {
override fun addFormatters(registry: FormatterRegistry) {
registerSpringFormatters(registry) //This is a custom method I wrote
}
}
Now I need to write a unit test to test whether the input received to my controller is formatted correctly. I have written the following test for this.
class MyApiControllerTest {
private val myService: OrderedProjectVintagesService = mock()
private val myController = MyController(
myService = myService
)
private lateinit var mockMvc: MockMvc
@Test
fun `test comma in attributes`() {
val input = Request(
projectTypes = listOf("type1,2"),
)
val sortedSummaries = listOf(
Summary(
currentPrice = BigDecimal("35"),
projectName = "Project 1"
)
)
whenever(
myService.listProjects(
projectTypes = input.projectTypes!!
)
).thenReturn(sortedSummaries)
mockMvc = MockMvcBuilders
.standaloneSetup(productItemOrderingController)
.build()
mockMvc.perform(
get("/api/ordered-projects")
.param("projectTypes", "type1,2")
).andExpect(status().isOk)
verify(myService, times(1)).listProjects(
projectTypes = input.projectTypes!!,
)
}
}
However, my test fails as the WebConfig being not registered during the test. How can I get my test to work with input properly formatted with the WebConfig?
- Unable to download PDF file using playwright with js because it's open in preview mode in Chrome browserI am facing an issue where I am unable to download a PDF file because it opens in the preview mode in the Chrome browser i want to enable this option using playwright with JS so i can download directly without opening the preview import { test, expect } from '@playwright/test'; const { chromium } = require('playwright'); test.only('test', async () => { const browser = await chromium.launch({ args: ['--disable-pdf-extension'], }); const context = await browser.new
Unable to download PDF file using playwright with js because it's open in preview mode in Chrome browser
I am facing an issue where I am unable to download a PDF file because it opens in the preview mode in the Chrome browser i want to enable this option using playwright with JS so i can download directly without opening the preview
import { test, expect } from '@playwright/test';
const { chromium } = require('playwright');
test.only('test', async () => {
const browser = await chromium.launch({
args: ['--disable-pdf-extension'],
});
const context = await browser.newContext({
acceptDownloads: true, // Enable automatic download handling
});
// Navigate to the page containing the PDF link
const page = await context.newPage();
await page.goto('https://example.com');
await page.getByRole('textbox', { name: 'Email' }).fill('[email protected]');
await page.getByRole('textbox', { name: 'Email' }).press('Tab');
await page.getByPlaceholder('Password').fill('admin123');
await page.getByPlaceholder('Password').press('Enter');
await page.getByRole('link', { name: 'Qa testing Learning', exact: true }).click();
await page.getByText('Subscribers').click();
const pdfLink = page.getByRole('row', { name: 'pdf' }).getByRole('link');
await pdfLink.click();
await page.pause();
});
- What does reported "r" mean in the context of a t-test? โ stats.stackexchange.comIn a psychological paper (Fujita et al., 2006), the authors perform a two sample t-test for independent means. They report the following values: $M_1$ = 9.88, $M_2$ = 8.47, t(66) = 2.25, p = 0.03, ...
What does reported "r" mean in the context of a t-test? โ stats.stackexchange.com
- Is it correct to compare values relative to baseline with a paired Student's t Test? Is this a one sample Student's t Test? โ stats.stackexchange.comI want to analyze data from same patients in two timepoints. The problem is the measurements have high variability between patients and it makes more sense to first adjust the observed value to the ...
Is it correct to compare values relative to baseline with a paired Student's t Test? Is this a one sample Student's t Test? โ stats.stackexchange.com
- The non-nullable local variable 'mockLoginRespository' must be assigned before it can be usedI am trying to develop my app using Clean TDD (Test Driven Development) Architecture. For the login feature , I am writing the test case as follows: import 'package:dartz/dartz.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:mockito/mockito.dart'; import 'package:test_app/features/login/domain/entities/user.dart'; import 'package:test_app/features/login/domain/repositories/login_repository.dart'; import 'package:test_app/features/login/domain/usecases/call_login.dart'; c
The non-nullable local variable 'mockLoginRespository' must be assigned before it can be used
I am trying to develop my app using Clean TDD (Test Driven Development) Architecture. For the login feature , I am writing the test case as follows:
import 'package:dartz/dartz.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:mockito/mockito.dart';
import 'package:test_app/features/login/domain/entities/user.dart';
import 'package:test_app/features/login/domain/repositories/login_repository.dart';
import 'package:test_app/features/login/domain/usecases/call_login.dart';
class MockLoginRespository extends Mock implements LoginRepository {}
void main() {
CallLogin usecase;
MockLoginRespository mockLoginRespository;
final tUserName = "test.user";
final tPassword = "test.password";
final tUser = User(
userID: "test.userID", email: "test.email", userName: "test.userName");
setUp(() {
mockLoginRespository = MockLoginRespository();
usecase = CallLogin(mockLoginRespository);
});
test(
'should perform login from the repository',
() async {
when(mockLoginRespository.login(any, any))
.thenAnswer((_) async => Right(tUser));
final result =
await usecase.execute(username: tUserName, password: tPassword);
expect(result, Right(tUser));
verify(mockLoginRespository.login(tUserName, tPassword));
verifyNoMoreInteractions(mockLoginRespository);
},
);
}
I am getting error as :
The non-nullable local variable 'mockLoginRespository' must be assigned before it can be used. Try giving it an initializer expression, or ensure that it's assigned on every execution path.
How should I properly initialize the mockLoginRepository?
I tried adding the initialization expression inside the test async function.
test(
'should perform login from the repository',
() async {
// Added initialization down here
mockLoginRespository = MockLoginRespository();
usecase = CallLogin(mockLoginRespository);
when(mockLoginRespository.login(any, any))
.thenAnswer((_) async => Right(tUser));
.
.
.
},`
This removes the error, but is it the right way to do it ? The code tutorial I follow doesn't make the initialization this way.
- In playwright test cases failing in parallel mode whereas passes in serial model. The tests are running inside a docker containerBackground: My project runs locally inside a docker container. I have a test file say abc.spec.ts that has 20 tests. I run my test in HEADLESS mode inside the docker container(I can run it in NON-HEADLESS mode also outside my docker container, I usually do it while I am writing tests). I run command npm run playwright:test configured in my package.json to run my tests. Each of the tests in abc.spec.ts file runs successfully when run in default mode i.e. tests run one after the other in sequentia
In playwright test cases failing in parallel mode whereas passes in serial model. The tests are running inside a docker container
Background: My project runs locally inside a docker container. I have a test file say abc.spec.ts
that has 20 tests. I run my test in HEADLESS mode inside the docker container(I can run it in NON-HEADLESS mode also outside my docker container, I usually do it while I am writing tests). I run command npm run playwright:test
configured in my package.json
to run my tests.
Each of the tests in abc.spec.ts
file runs successfully when run in default
mode i.e. tests run one after the other in sequential manner. which is the default behaviour of playwright. However when I run test in parallel mode by adding the line test.describe.configure({mode: "parallel"});
at the top scope of my test file then I am observing that some of the tests are failing.
I did run tests in this parallel mode for a number of times observed -
1. Random number of tests are failing with Navigation failed because page crashed!
error.
2. Certain tests are failing around 90% of the time on an assertion statement that is looking for temporary visible text in UI. Like for example when you do some actions in UI and while that action is being performed the UI shows some temporary visible text like - "Loading..", "Please wait...", "Submitting data...". So the assertion like await page.getByText("Loading...").toBeVisible()
, await page.getByText("Please wait...").toBeVisible()
, await page.getByText("Submitting data...").toBeVisible()
are failing most the time. Interestingly these are randomly passing sometimes as well.
Note : I know that tests should not depend on each other and should run independently in parallel mode. I have ensured that all my 20 tests are independent of each other and can be run in parallel. My docker has 8 CPUS, 8 GB RAM, 1 GB swap.
Can anyone please suggest me anything how to fix it. It is important for me to run my test successfully in parallel
mode to save time as I have lot of test to run. Thank you!
- I have applied many statistical tests to my data, but still cannot determine normality โ stats.stackexchange.comI have run multiple tests to determine normality on my dataset, but I am unsure which one to adhere to, especially since my histograms, density plots, and QQ plots leave much to be desired in terms of ...
I have applied many statistical tests to my data, but still cannot determine normality โ stats.stackexchange.com
- Got some wacky numbers doing a Student's t-test โ stats.stackexchange.comFor context, I am currently enrolled in a Quantitative Analysis course for chemistry at my university. We've been focusing on errors and statistical analysis to determine whether the random error is ...
Got some wacky numbers doing a Student's t-test โ stats.stackexchange.com
- Playwright. The run test does not appearI'm starting to learn the Playwright. It's my first try to run a test. I've installed the Playwright Test for VSCode extention, then I've run npm init playwright@latest --yes -- --quiet --browser=chromium --browser=firefox --browser=webkit to install the browsers and the excemples. Now, when I'm opening the demo-todo-app.spec.ts I don't see the run button next to the test block The green triangle next to the test block does not appear I'm using macOS, node v18.17.1, VS Code version 1.80.0 (Uni
Playwright. The run test does not appear
I'm starting to learn the Playwright. It's my first try to run a test. I've installed the Playwright Test for VSCode extention, then I've run
npm init playwright@latest --yes -- --quiet --browser=chromium --browser=firefox --browser=webkit
to install the browsers and the excemples. Now, when I'm opening the demo-todo-app.spec.ts I don't see the run button next to the test block The green triangle next to the test block does not appear
I'm using macOS, node v18.17.1, VS Code version 1.80.0 (Universal) and Playwright Version 1.37.1.
How I can get the run test button?
I'd try also use v16 but it didn't help
I'd try all the solutions I've find here Playwright VSCode gives `No tests found` message but nothing helped
- Countering t-test "any feature is significant" results for large sample size datasets โ stats.stackexchange.comI'm doing some analysis over natural language data, which basically entails: Computing some feature over all samples. Evaluating if this feature statistically significantly discriminates between ...
Countering t-test "any feature is significant" results for large sample size datasets โ stats.stackexchange.com
- Is it okay to say that 95% confidence interval is more significant than 80%? โ stats.stackexchange.comSo, the higher the confidence interval the lower the false positive rate,but false negative rate will increase lowering the recall.Is it possible to determine which confidence interval is better/more ...