-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #80 from wiremock/fix/issue-78-parse-annotations-i…
…n-super-class fix: avoid crash when only annotating super class (refs #78)
- Loading branch information
Showing
3 changed files
with
56 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
src/test/java/usecases/EnableWireMockOnSuperClassOnlyTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package usecases; | ||
|
||
import static org.assertj.core.api.Assertions.assertThat; | ||
|
||
import com.github.tomakehurst.wiremock.WireMockServer; | ||
import org.junit.jupiter.api.Test; | ||
import org.springframework.beans.factory.annotation.Value; | ||
import org.springframework.boot.test.context.SpringBootTest; | ||
import org.wiremock.spring.ConfigureWireMock; | ||
import org.wiremock.spring.EnableWireMock; | ||
import org.wiremock.spring.InjectWireMock; | ||
|
||
@SpringBootTest | ||
class EnableWireMockOnSuperClassOnlyTest extends EnableWireMockOnSuperClassTestSuperClass { | ||
|
||
@InjectWireMock("super-service-1") | ||
private WireMockServer superService1; | ||
|
||
@Value("${super-service-1.url}") | ||
private String superService1Url; | ||
|
||
@InjectWireMock("super-service-2") | ||
private WireMockServer superService2; | ||
|
||
@Value("${super-service-2.url}") | ||
private String superService2Url; | ||
|
||
@Test | ||
void serversConfigured() { | ||
assertThat(superService1).isNotNull(); | ||
assertThat(superService2).isNotNull(); | ||
|
||
assertThat(superService1Url).isNotEqualTo(superService2Url); | ||
} | ||
} |