Skip to content
This repository has been archived by the owner on Nov 23, 2021. It is now read-only.

Autogenerated SecurityRestServiceImplTest is not save against port and context path changes #691

Closed
maybeec opened this issue Oct 2, 2018 · 3 comments

Comments

@maybeec
Copy link
Member

maybeec commented Oct 2, 2018

Generating the archetype 3.0.0, you may want to change the port and/or context path of the application.

  1. This leads to failing SecurityRestServiceImplTest.
  2. I tried to fix this, but I was not entirely able to do this with the ServiceConfigBuilder. It seems, that it does not support to set a context path at all.
@maybeec
Copy link
Member Author

maybeec commented Oct 2, 2018

possibly related to #683

@hohwille
Copy link
Member

hohwille commented Oct 8, 2018

Can you explain a little more and be more precise?
You are talking about this test:
https://github.com/oasp/oasp4j/blob/a858d6556cafd30f7226e7928f71549b29b74107/templates/server/src/main/resources/archetype-resources/core/src/test/java/__packageInPathFormat__/general/service/impl/rest/SecurityRestServiceImplTest.java

What did you change and what was the error?
Actually the test does not hardcode any port or context path.
For the port I am even sure that I have implemented some code that is taking it from the running server and as spring is using a random port for the JUnit it should not be as you are saying.
For the context path I am not sure and you might be right. Maybe the assumption here is that you have to have an empty context path. I can not remember right now, but if it is not empty then I am quite sure it is not hardcoded in another place.
For productive use you will either use envoy/istio or service discovery or you put the endpoint directly into your config. In any case you will provide an environment config:
https://github.com/oasp/oasp4j/wiki/guide-service-client#configuration

@maybeec
Copy link
Member Author

maybeec commented Oct 10, 2018

It's a duplicate of #683, I tested it.

@maybeec maybeec closed this as completed Oct 10, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants