Skip to content

Commit 6902833

Browse files
committed
Revert "Add test helper method"
This reverts commit d3935e8.
1 parent d3935e8 commit 6902833

2 files changed

Lines changed: 0 additions & 27 deletions

File tree

modules/openapi-generator/src/test/java/org/openapitools/codegen/TestUtils.java

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -177,31 +177,6 @@ public static void assertFileContains(Path path, String... lines) {
177177
}
178178
}
179179

180-
/**
181-
* Verify line is found at given lineNumber
182-
* @param path
183-
* @param lineNumber
184-
* @param line
185-
*/
186-
public static void assertFileContains(Path path, int lineNumber, String line) {
187-
try {
188-
List<String> linesInFile = Files.readAllLines(path);
189-
int index = lineNumber - 1;
190-
191-
assertTrue(index >= 0 && index < linesInFile.size(),
192-
"Invalid line number: " + lineNumber);
193-
194-
String targetLine = linearize(linesInFile.get(index));
195-
String expectedLine = linearize(line);
196-
197-
assertTrue(targetLine.contains(expectedLine),
198-
"Expected line [" + expectedLine + "] not found at line number " + lineNumber);
199-
200-
} catch (IOException e) {
201-
fail("Unable to evaluate file " + path);
202-
}
203-
}
204-
205180
public static String linearize(String target) {
206181
return target.replaceAll("\r?\n", "").replaceAll("\\s+", "\\s");
207182
}

modules/openapi-generator/src/test/java/org/openapitools/codegen/typescript/TypeScriptClientCodegenTest.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,6 @@ public void testDeprecatedOperation() throws Exception {
229229
// verify operation is deprecated
230230
TestUtils.assertFileContains(
231231
Paths.get(output + "/apis/DefaultApi.ts"),
232-
18,
233232
"* @deprecated"
234233
);
235234
}
@@ -252,7 +251,6 @@ public void testDeprecatedParameter() throws Exception {
252251
// verify parameter is deprecated parameter
253252
TestUtils.assertFileContains(
254253
Paths.get(output + "/apis/DefaultApi.ts"),
255-
20,
256254
"* @param name name of pet (@deprecated)"
257255
);
258256
}

0 commit comments

Comments
 (0)