gustavoponce7 / spring-login Goto Github PK
View Code? Open in Web Editor NEWAuthentication process using Spring Boot and MySQL
License: Apache License 2.0
Authentication process using Spring Boot and MySQL
License: Apache License 2.0
Hi Gustavo!
In UnitTest (UserServiceTest) you have:
// Run the test
User result = userServiceUnderTest.saveUser(User.builder().build());
but the correct to works is:
User result = userServiceUnderTest.saveUser(user); //Using the user created in setup
[ ]'s
Giuseppe Lopes
please help me !
Can you please provide a solution for the login problem. I have tried many different solutions but login is still not working. The roles query seems like the cause of the problem.
The UserServiceTest class produces an incompatible type error.
It says 'void cannot be converted to [my.package.app].model.User
The suggested solution is to "Make 'saveUser' return [my.package.app].model.User";
Not sure how to proceed...
can you provide me a login details please ....
Could you submit a license for this code, so that users know if this code can be used for project, I am very interested in using this code, but wanted to get your permission first.
[ERROR] contextLoads(com.gpch.login.LoginApplicationTests) Time elapsed: 0.001 s <<< ERROR!
java.lang.IllegalStateException: Failed to load ApplicationContext
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.class]: Invocation of init method failed; nested exception is java.lang.NoClassDefFoundError: javax/xml/bind/JAXBException
Caused by: java.lang.NoClassDefFoundError: javax/xml/bind/JAXBException
Caused by: java.lang.ClassNotFoundException: javax.xml.bind.JAXBException
[INFO] Running com.gpch.login.service.UserServiceTest
[ERROR] Tests run: 2, Failures: 0, Errors: 2, Skipped: 0, Time elapsed: 0.104 s <<< FAILURE! - in com.gpch.login.service.UserServiceTest
[ERROR] testSaveUser(com.gpch.login.service.UserServiceTest) Time elapsed: 0.041 s <<< ERROR!
org.mockito.exceptions.base.MockitoException:
Mockito cannot mock this class: interface com.gpch.login.repository.UserRepository.
Mockito can only mock non-private & non-final classes.
If you're not sure why you're getting this error, please report to the mailing list.
Java : 11
JVM vendor name : Oracle Corporation
JVM vendor version : 11.0.1+13-LTS
JVM name : Java HotSpot(TM) 64-Bit Server VM
JVM version : 11.0.1+13-LTS
JVM info : mixed mode
OS name : Mac OS X
OS version : 10.14.1
Underlying exception : java.lang.UnsupportedOperationException: Cannot define class using reflection
at com.gpch.login.service.UserServiceTest.setUp(UserServiceTest.java:31)
Caused by: java.lang.UnsupportedOperationException: Cannot define class using reflection
at com.gpch.login.service.UserServiceTest.setUp(UserServiceTest.java:31)
Caused by: java.lang.IllegalStateException: Could not find sun.misc.Unsafe
at com.gpch.login.service.UserServiceTest.setUp(UserServiceTest.java:31)
Caused by: java.lang.NoSuchMethodException: sun.misc.Unsafe.defineClass(java.lang.String, [B, int, int, java.lang.ClassLoader, java.security.ProtectionDomain)
at com.gpch.login.service.UserServiceTest.setUp(UserServiceTest.java:31)
[ERROR] testFindUserByEmail(com.gpch.login.service.UserServiceTest) Time elapsed: 0.062 s <<< ERROR!
org.mockito.exceptions.base.MockitoException:
Mockito cannot mock this class: interface com.gpch.login.repository.UserRepository.
Mockito can only mock non-private & non-final classes.
If you're not sure why you're getting this error, please report to the mailing list.
Java : 11
JVM vendor name : Oracle Corporation
JVM vendor version : 11.0.1+13-LTS
JVM name : Java HotSpot(TM) 64-Bit Server VM
JVM version : 11.0.1+13-LTS
JVM info : mixed mode
OS name : Mac OS X
OS version : 10.14.1
Underlying exception : java.lang.UnsupportedOperationException: Cannot define class using reflection
at com.gpch.login.service.UserServiceTest.setUp(UserServiceTest.java:31)
Caused by: java.lang.UnsupportedOperationException: Cannot define class using reflection
at com.gpch.login.service.UserServiceTest.setUp(UserServiceTest.java:31)
Caused by: java.lang.IllegalStateException: Could not find sun.misc.Unsafe
at com.gpch.login.service.UserServiceTest.setUp(UserServiceTest.java:31)
Caused by: java.lang.NoSuchMethodException: sun.misc.Unsafe.defineClass(java.lang.String, [B, int, int, java.lang.ClassLoader, java.security.ProtectionDomain)
at com.gpch.login.service.UserServiceTest.setUp(UserServiceTest.java:31)
[INFO]
[INFO] Results:
[INFO]
[ERROR] Errors:
[ERROR] LoginApplicationTests.contextLoads » IllegalState Failed to load ApplicationCo...
[ERROR] UserServiceTest.setUp:31 Mockito
Mockito cannot mock this class: interface co...
[ERROR] UserServiceTest.setUp:31 Mockito
Mockito cannot mock this class: interface co...
[INFO]
[ERROR] Tests run: 3, Failures: 0, Errors: 3, Skipped: 0
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 05:46 min
[INFO] Finished at: 2018-11-29T13:03:32+01:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.21.0:test (default-test) on project login: There are test failures.
[ERROR]
[ERROR] Please refer to /Users/sid/Documents/university/intergiciel/tutorial-example/spring-login/target/surefire-reports for the individual test results.
[ERROR] Please refer to dump files (if any exist) [date]-jvmRun[N].dump, [date].dumpstream and [date]-jvmRun[N].dumpstream.
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException```
Hello, gustavoponce7. This code is working. But the data.sql file is not understandable. After import it not gives the necessary table queries. Want the queries for the database structure for tables,views,stored procedures etc to create the database objects in Mysql. Then it would be more helpful. Thank you.
When I create a new user in the registration page a user is created successfully. But when I login to the login page it redirects to the login page. I have checked the DB and a new user is created in the user table. When observing the network tab there is a 302 in login. Please refer this image for the reference.
is it possible to convert it into multi-auth
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.