Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Testcontainers #21

Merged
merged 11 commits into from
Sep 20, 2021
Merged

Testcontainers #21

merged 11 commits into from
Sep 20, 2021

Conversation

SirNoob97
Copy link
Contributor

@SirNoob97 SirNoob97 commented Sep 19, 2021

  • Basic test cases for the client repository
  • Couple of suggestions
  • Update mongodb version in the docker-compose file

#2 #17

@SirNoob97
Copy link
Contributor Author

This is my first time using mongo so I don't know if extending the TestContainer class of the config package is a good idea, but the it works.

@Autowired
private ClientRepository clientRepository;

@AfterEach
public void deleteArterTest(){
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo

Copy link
Owner

@kgotlelelo-cmd kgotlelelo-cmd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow.. I really appreciate your time and effort.
It's more than what i had in mind regarding testing great work.
Thanks i didn't know about test container library

@kgotlelelo-cmd kgotlelelo-cmd merged commit 83beeb9 into kgotlelelo-cmd:main Sep 20, 2021
@SirNoob97
Copy link
Contributor Author

No problem. Now we must decide what kind of method the project needs for the client repository and then continue with the implementation of the tests.

@kgotlelelo-cmd
Copy link
Owner

I think we should use simple for student email
and not sure what more methods to add to repository.. but if possible return specific person's posts.
there is a bug when posting a post the post id is always zero i need help with.

please bring forth idea which might the project better
the project is mini twitter type of project with spring as domain layer that talks with data base and
nodejs that call domain manipulate the data and sent to reactjs (no business logic will be implemented in reactjs)
I am thinking of doing user authentication in nodejs I don't know if it going to be a good idea.

hopefully I understood your suggestion.

@SirNoob97
Copy link
Contributor Author

Observing these resources #6, I notice that the embedded documents have no identification and that is probably the reason. And testing with Integer (not the primitive) and String, I see that the id does not persist in the database, so if you want a relationship between your entities, mongo is probably not a good idea, especially if you want to add more entities like comments.

I found this in the spring docs but it doesnt work as i expected spring mongodb docs.

I know very well postgres if you decide to change the db engine, but if it is just for learning, we can move on with mongo.

@kgotlelelo-cmd
Copy link
Owner

I think you are right.
It is better to move to postgres(SQL) now rather than later..
as you mention it might block with future features. I was my first time using it(it was for experimenting)

I have worked with sql and springboot before but it was a very small application, since you technically strong
what suggestion or advise will you give me i.e regarding the structure of the database etc.

@kgotlelelo-cmd
Copy link
Owner

I think for embedded documents with springboot you have to generate id for yourself

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants