Skip to content

Commit 65efdc7

Browse files
committed
reduce failing tests to 9
1 parent 2b92d44 commit 65efdc7

File tree

3 files changed

+10
-15
lines changed

3 files changed

+10
-15
lines changed

modules/swagger-parser-v3/src/test/java/io/swagger/v3/parser/processors/ResponseProcessorTest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ public void testProcessResponse() throws Exception {
6363
times = 1;
6464

6565

66+
67+
6668
}};
6769

6870
ApiResponse response = new ApiResponse();

modules/swagger-parser-v3/src/test/java/io/swagger/v3/parser/processors/SchemaProcessorTest.java

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public void testProcessRefSchema_ExternalRef() throws Exception {
3333
final String ref = "http://my.company.com/path/to/file.json#/foo/bar";
3434
final String newRef = "bar";
3535

36-
setupPropertyAndExternalRefProcessors();
36+
expectCreationOfExternalRefProcessor();
3737

3838
new Expectations() {{
3939

@@ -54,7 +54,7 @@ public void testProcessRefSchema_ExternalRef() throws Exception {
5454
public void testProcessRefSchema_InternalRef() throws Exception {
5555
final String ref = "#/components/schemas/bar";
5656

57-
setupPropertyAndExternalRefProcessors();
57+
expectCreationOfExternalRefProcessor();
5858

5959
Schema refModel = new Schema().$ref(ref);
6060

@@ -85,7 +85,7 @@ public void testProcessArraySchema() throws Exception {
8585

8686
@Test
8787
public void testProcessComposedSchema() throws Exception {
88-
setupPropertyAndExternalRefProcessors();
88+
expectCreationOfExternalRefProcessor();
8989

9090
final String ref1 = "http://my.company.com/path/to/file.json#/foo/bar";
9191
final String ref2 = "http://my.company.com/path/to/file.json#/this/that";
@@ -150,16 +150,6 @@ public void testProcessSchema() throws Exception {
150150
assertEquals(model.getProperties().get("bar"), property2);
151151
}
152152

153-
private void setupPropertyAndExternalRefProcessors() {
154-
new Expectations() {{
155-
new ExternalRefProcessor(cache, openAPI);
156-
times = 1;
157-
result = externalRefProcessor;
158-
}};
159-
}
160-
161-
162-
163153
@Test
164154
public void testProcessRefProperty_ExternalRef() throws Exception {
165155
expectCreationOfExternalRefProcessor();

modules/swagger-parser-v3/src/test/java/io/swagger/v3/parser/test/ResolverCacheTest.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,9 @@ public class ResolverCacheTest {
5454
@Injectable
5555
ApiResponse mockedResponse;
5656

57+
@Injectable
58+
DeserializationUtils deserializationUtils;
59+
5760
@Test
5861
public void testMock() throws Exception {
5962

@@ -65,7 +68,7 @@ public void testMock() throws Exception {
6568
parseOptions.setResolve(true);
6669
parseOptions.setValidateExternalRefs(true);
6770

68-
new Expectations(DeserializationUtils.class) {{
71+
new Expectations(deserializationUtils) {{
6972
RefUtils.readExternalUrlRef(ref, format, auths, "http://my.company.com/path/parent.json");
7073
times = 1;
7174
result = contentsOfExternalFile;
@@ -94,7 +97,7 @@ public void testLoadExternalRef_NoDefinitionPath() throws Exception {
9497
parseOptions.setResolve(true);
9598
parseOptions.setValidateExternalRefs(true);
9699

97-
new Expectations(DeserializationUtils.class) {{
100+
new Expectations(deserializationUtils) {{
98101
RefUtils.readExternalUrlRef(ref, format, auths, "http://my.company.com/path/parent.json");
99102
times = 1;
100103
result = contentsOfExternalFile;

0 commit comments

Comments
 (0)