Skip to content

Commit 9075978

Browse files
committed
Fixed broken tests
1 parent 245099e commit 9075978

10 files changed

Lines changed: 28 additions & 28 deletions

File tree

cddjava/src/main/resources/Merged/mergedComponent1.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ class Pet {
44
return this.name;
55
}
66

7+
/**
8+
* Type of long[][][]
9+
*/
10+
long[][][] names;
11+
712
/**
813
* Type of integer
914
*/
@@ -14,11 +19,6 @@ class Pet {
1419
*/
1520
long id;
1621

17-
/**
18-
* Type of long[][][]
19-
*/
20-
long[][][] names;
21-
2222
/**
2323
* Type of string
2424
*/
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
class Error {
22

33
/**
4-
* Type of integer
4+
* Type of int32
55
*/
6-
int message;
6+
int code;
77

88
/**
9-
* Type of int32
9+
* Type of integer
1010
*/
11-
int code;
11+
int message;
1212
}

cddjava/src/main/resources/OpenAPISpec2/componentCode1.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ class Pet {
33
/**
44
* Type of integer
55
*/
6-
int name;
6+
int tag1;
77

88
/**
99
* Type of integer
1010
*/
11-
int tag1;
11+
int name;
1212

1313
/**
1414
* Type of int64

cddjava/src/main/resources/OpenAPISpec2/openapi.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ paths:
3232
content:
3333
application/json:
3434
schema:
35-
$ref: "#/components/schemas/Pets"
35+
$ref: "#/components/schemas/Pet"
3636
default:
3737
description: unexpected error
3838
content:
@@ -72,7 +72,7 @@ paths:
7272
content:
7373
application/json:
7474
schema:
75-
$ref: "#/components/schemas/Pets"
75+
$ref: "#/components/schemas/Pet"
7676
default:
7777
description: unexpected error
7878
content:

cddjava/src/main/resources/OpenAPISpec2/routesCode.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ interface Routes {
66
* @return Expected response to a valid request (Status Code 200), unexpected error (Status Code default),
77
*/
88
@GET(path = "/pets/{petId}")
9-
Call<Pets> showDogById(int petId);
9+
Call<Pet> showDogById(int petId);
1010

1111
/**
1212
* Create a pet
@@ -19,12 +19,12 @@ interface Routes {
1919
* @param limit of type int32. How many items to return at one time (max 100).
2020
* @return A paged array of pets (Status Code 200), unexpected error (Status Code default),
2121
*/
22-
Call<Pets> listPets(int limit);
22+
Call<Pet> listPets(int limit);
2323

2424
/**
2525
* Info for a specific pet
2626
* @param petId of type integer. The id of the pet to retrieve.
2727
* @return Expected response to a valid request (Status Code 200), unexpected error (Status Code default),
2828
*/
29-
Call<Pets> showPetById(int petId);
29+
Call<Pet> showPetById(int petId);
3030
}

cddjava/src/test/java/io/offscale/MergeTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ private static String readFileToString(String filePath) {
3434
public void mergeComponents_addNewComponent() {
3535
final Merge merge = new Merge(ImmutableMap.copyOf(openAPISpec2Components), openAPISpec2Routes, "OpenAPISpec1/openapi.yaml");
3636
final ImmutableMap<String, String> mergedComponents = merge.mergeComponents();
37-
assertEquals(4, mergedComponents.size());
37+
assertEquals(3, mergedComponents.size());
3838
assertEquals(mergedComponents.get("Pet"), readFileToString("src/main/resources/Merged/mergedComponent1.txt"));
3939
assertEquals(mergedComponents.get("Error"), readFileToString("src/main/resources/OpenAPISpec1/componentCode2.txt"));
4040
}
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
class Error {
22

33
/**
4-
* Type of integer
4+
* Type of int32
55
*/
6-
int message;
6+
int code;
77

88
/**
9-
* Type of int32
9+
* Type of integer
1010
*/
11-
int code;
11+
int message;
1212
}

cddjava/target/classes/OpenAPISpec2/componentCode1.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@ class Pet {
33
/**
44
* Type of integer
55
*/
6-
int name;
6+
int tag1;
77

88
/**
99
* Type of integer
1010
*/
11-
int tag1;
11+
int name;
1212

1313
/**
1414
* Type of int64

cddjava/target/classes/OpenAPISpec2/openapi.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ paths:
3232
content:
3333
application/json:
3434
schema:
35-
$ref: "#/components/schemas/Pets"
35+
$ref: "#/components/schemas/Pet"
3636
default:
3737
description: unexpected error
3838
content:
@@ -72,7 +72,7 @@ paths:
7272
content:
7373
application/json:
7474
schema:
75-
$ref: "#/components/schemas/Pets"
75+
$ref: "#/components/schemas/Pet"
7676
default:
7777
description: unexpected error
7878
content:

cddjava/target/classes/OpenAPISpec2/routesCode.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ interface Routes {
66
* @return Expected response to a valid request (Status Code 200), unexpected error (Status Code default),
77
*/
88
@GET(path = "/pets/{petId}")
9-
Call<Pets> showDogById(int petId);
9+
Call<Pet> showDogById(int petId);
1010

1111
/**
1212
* Create a pet
@@ -19,12 +19,12 @@ interface Routes {
1919
* @param limit of type int32. How many items to return at one time (max 100).
2020
* @return A paged array of pets (Status Code 200), unexpected error (Status Code default),
2121
*/
22-
Call<Pets> listPets(int limit);
22+
Call<Pet> listPets(int limit);
2323

2424
/**
2525
* Info for a specific pet
2626
* @param petId of type integer. The id of the pet to retrieve.
2727
* @return Expected response to a valid request (Status Code 200), unexpected error (Status Code default),
2828
*/
29-
Call<Pets> showPetById(int petId);
29+
Call<Pet> showPetById(int petId);
3030
}

0 commit comments

Comments
 (0)