{"action":"created","issue":{"url":"https://api.github.com/repos/DiUS/pact-jvm/issues/632","repository_url":"https://api.github.com/repos/DiUS/pact-jvm","labels_url":"https://api.github.com/repos/DiUS/pact-jvm/issues/632/labels{/name}","comments_url":"https://api.github.com/repos/DiUS/pact-jvm/issues/632/comments","events_url":"https://api.github.com/repos/DiUS/pact-jvm/issues/632/events","html_url":"https://github.com/DiUS/pact-jvm/issues/632","id":291190255,"number":632,"title":"Spring boot and @PactBroker is not working as expected with system properties","user":{"login":"steam0","id":1324739,"avatar_url":"https://avatars1.githubusercontent.com/u/1324739?v=4","gravatar_id":"","url":"https://api.github.com/users/steam0","html_url":"https://github.com/steam0","followers_url":"https://api.github.com/users/steam0/followers","following_url":"https://api.github.com/users/steam0/following{/other_user}","gists_url":"https://api.github.com/users/steam0/gists{/gist_id}","starred_url":"https://api.github.com/users/steam0/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/steam0/subscriptions","organizations_url":"https://api.github.com/users/steam0/orgs","repos_url":"https://api.github.com/users/steam0/repos","events_url":"https://api.github.com/users/steam0/events{/privacy}","received_events_url":"https://api.github.com/users/steam0/received_events","type":"User","site_admin":false},"labels":[{"id":74029102,"url":"https://api.github.com/repos/DiUS/pact-jvm/labels/enhancement","name":"enhancement","color":"84b6eb","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-01-24T12:26:38Z","updated_at":"2018-03-12T05:17:23Z","closed_at":null,"author_association":"NONE","body":"In Spring Boot you can provide an application.properties/application.yml file that contains system properties and environment properties.\r\n\r\nI use some of the system variables in my test\r\n\r\n**PactVerificationTest.java**\r\n```\r\n@RunWith(SpringRestPactRunner.class)\r\n@Provider(\"someprovider\")\r\n@IgnoreNoPactsToVerify\r\n@PactBroker(\r\n        protocol = \"https\",\r\n        host = \"${pactbroker.host}\", port = \"${pactbroker.port}\",\r\n        authentication =  @PactBrokerAuth(username = \"${pactbroker.auth.username}\", password = \"${pactbroker.auth.password}\")\r\n)\r\n@SpringBootTest(webEnvironment = SpringBootTest.WebEnvironment.DEFINED_PORT)\r\npublic class PactVerificationTest {\r\n\r\n    @TestTarget\r\n    public final Target target = new HttpTarget(50519);\r\n\r\n    @MockBean\r\n    private EmailController emailController;\r\n\r\n    @Before\r\n    public void beforeTests() {\r\n        doNothing().when(emailController).sendEmail(any(Email.class));\r\n    }\r\n\r\n    @State({\"default\", \"extra\"})\r\n    public void toDefaultState() {\r\n        System.out.println(\"Now service in default state\");\r\n    }\r\n}\r\n```\r\n\r\nAnd then I name these variables in the configuration file\r\n\r\n**application.yml**\r\n```\r\npactbroker:\r\n  host: \"my.host.name.org\"\r\n  port: \"443\"\r\n  auth:\r\n    username: \"myusername\"\r\n    password: \"mypassword\"\r\n```\r\n\r\n**Unfortunately this does not work and I get a RuntimeError**\r\n`java.lang.RuntimeException: Could not resolve property \"pactbroker.host\" in the system properties or environment variables and no default value is supplied`\r\n\r\n**So it seems as it wont read the variables.**\r\n\r\n**Versions:**\r\nSpring Boot 2.0.0.M7\r\nau.com.dius:pact-jvm-provider-spring_2.12 3.5.11"},"comment":{"url":"https://api.github.com/repos/DiUS/pact-jvm/issues/comments/372196106","html_url":"https://github.com/DiUS/pact-jvm/issues/632#issuecomment-372196106","issue_url":"https://api.github.com/repos/DiUS/pact-jvm/issues/632","id":372196106,"user":{"login":"uglyog","id":863666,"avatar_url":"https://avatars1.githubusercontent.com/u/863666?v=4","gravatar_id":"","url":"https://api.github.com/users/uglyog","html_url":"https://github.com/uglyog","followers_url":"https://api.github.com/users/uglyog/followers","following_url":"https://api.github.com/users/uglyog/following{/other_user}","gists_url":"https://api.github.com/users/uglyog/gists{/gist_id}","starred_url":"https://api.github.com/users/uglyog/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/uglyog/subscriptions","organizations_url":"https://api.github.com/users/uglyog/orgs","repos_url":"https://api.github.com/users/uglyog/repos","events_url":"https://api.github.com/users/uglyog/events{/privacy}","received_events_url":"https://api.github.com/users/uglyog/received_events","type":"User","site_admin":false},"created_at":"2018-03-12T05:17:23Z","updated_at":"2018-03-12T05:17:23Z","author_association":"MEMBER","body":"This has now been implemented. I have a test project https://github.com/uglyog/pact-springboot-test with this working nicely."}}
{"actor":{"display_login":"uglyog"}}