Skip to content

Commit

Permalink
fixes how config value is changed in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Rishabh committed Mar 20, 2022
1 parent 1496d14 commit f41c976
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/test/java/io/supertokens/storage/mysql/test/Utils.java
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,8 @@ public static void setValueInConfig(String key, String value) throws FileNotFoun
// we close the storage layer since there might be a change in the db related config.
StorageLayer.close();

String oldStr = "((#\\s)?)" + key + "(:|((:\\s).+))\n";
String newStr = key + ": " + value + "\n";
String oldStr = "\n((#\\s)?)" + key + "(:|((:\\s).+))\n";
String newStr = "\n" + key + ": " + value + "\n";
StringBuilder originalFileContent = new StringBuilder();
try (BufferedReader reader = new BufferedReader(new FileReader("../config.yaml"))) {
String currentReadingLine = reader.readLine();
Expand All @@ -129,8 +129,8 @@ public static void commentConfigValue(String key) throws IOException {
// we close the storage layer since there might be a change in the db related config.
StorageLayer.close();

String oldStr = "((#\\s)?)" + key + "(:|((:\\s).+))\n";
String newStr = "# " + key + ":";
String oldStr = "\n((#\\s)?)" + key + "(:|((:\\s).+))\n";
String newStr = "\n# " + key + ":";

StringBuilder originalFileContent = new StringBuilder();
try (BufferedReader reader = new BufferedReader(new FileReader("../config.yaml"))) {
Expand Down

0 comments on commit f41c976

Please sign in to comment.