Skip to content

Commit 88b1993

Browse files
Clean up empty stubbings directory (#194)
1 parent 309ba26 commit 88b1993

File tree

34 files changed

+5
-2
lines changed
  • src/test
    • java/com/databricks/jdbc/integration/fakeservice
    • resources
      • cloudfetchapi
        • concurrencyintegrationtests
        • connectionintegrationtests
          • testincorrectcredentialsforoauth/mappings
          • testincorrectcredentialsforpat/mappings
          • testsuccessfulconnection/mappings
        • errorhandlingintegrationtests
        • metadataintegrationtests
          • testcatalogandschemainformation/mappings
          • testdatabasemetadataretrieval/mappings
        • preparedstatementintegrationtests
          • testhandlingnullvalueswithpreparedstatement/mappings
          • testparameterbindinginpreparedstatement/mappings
          • testpreparedstatementcomplexqueryexecution/mappings
          • testpreparedstatementexecution/mappings
        • resultsetintegrationtests
          • testhandlingnullvalues/mappings
          • testretrievalofcomplexdatatypes/mappings
      • sqlexecapi
        • concurrencyintegrationtests
        • errorhandlingintegrationtests
        • preparedstatementintegrationtests
          • testhandlingnullvalueswithpreparedstatement/mappings
          • testparameterbindinginpreparedstatement/mappings
          • testpreparedstatementcomplexqueryexecution/mappings
          • testpreparedstatementexecution/mappings
        • resultsetintegrationtests
          • testhandlingnullvalues/mappings
          • testretrievalofcomplexdatatypes/mappings

34 files changed

+5
-2
lines changed

src/test/java/com/databricks/jdbc/integration/fakeservice/FakeServiceExtension.java

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,11 @@ private void loadStubMappings(WireMockRuntimeInfo wireMockRuntimeInfo, Extension
220220
final String stubbingDir = getStubbingDir(context);
221221
final SingleRootFileSource fileSource = new SingleRootFileSource(stubbingDir + "/mappings");
222222

223+
if (!fileSource.exists()) {
224+
// No stub mappings to load
225+
return;
226+
}
227+
223228
final List<TextFile> mappingFiles =
224229
fileSource.listFilesRecursively().stream()
225230
.filter(byFileExtension("json"))
@@ -308,8 +313,6 @@ private static void deleteFilesInDir(String dirPath) throws IOException {
308313
Path dir = Paths.get(dirPath);
309314
if (!Files.exists(dir)) {
310315
Files.createDirectories(dir);
311-
// Stub mappings directory should be tracked by git even if it's empty
312-
Files.createFile(dir.resolve(".gitkeep"));
313316
return;
314317
}
315318

src/test/resources/cloudfetchapi/concurrencyintegrationtests/testconcurrentreads/mappings/.gitkeep

Whitespace-only changes.

src/test/resources/cloudfetchapi/concurrencyintegrationtests/testconcurrentupdates/mappings/.gitkeep

Whitespace-only changes.

src/test/resources/cloudfetchapi/connectionintegrationtests/testincorrectcredentialsforoauth/mappings/.gitkeep

Whitespace-only changes.

src/test/resources/cloudfetchapi/connectionintegrationtests/testincorrectcredentialsforpat/mappings/.gitkeep

Whitespace-only changes.

src/test/resources/cloudfetchapi/connectionintegrationtests/testsuccessfulconnection/mappings/.gitkeep

Whitespace-only changes.

src/test/resources/cloudfetchapi/errorhandlingintegrationtests/testaccessingclosedresultset/mappings/.gitkeep

Whitespace-only changes.

src/test/resources/cloudfetchapi/errorhandlingintegrationtests/testcallingunsupportedsqlfeature/mappings/.gitkeep

Whitespace-only changes.

src/test/resources/cloudfetchapi/errorhandlingintegrationtests/testfailuretoloaddriver/mappings/.gitkeep

Whitespace-only changes.

src/test/resources/cloudfetchapi/errorhandlingintegrationtests/testinvalidhostname/mappings/.gitkeep

Whitespace-only changes.

0 commit comments

Comments
 (0)