mirror of https://github.com/01-edu/public.git
docs: fix examples input
This commit is contained in:
parent
cb7db108de
commit
4c8ce4f9b4
|
@ -38,17 +38,14 @@ public class ExerciseRunner {
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
ConfigProtector protector = new ConfigProtector();
|
ConfigProtector protector = new ConfigProtector();
|
||||||
|
|
||||||
// Test case 1
|
String configFile1 = "username=admin\npassword=secret\nhost=localhost\n";
|
||||||
String configFile1 = "username=admin\n=localhost\n";
|
|
||||||
List<String> sensitiveKeys1 = Arrays.asList("password");
|
List<String> sensitiveKeys1 = Arrays.asList("password");
|
||||||
System.out.println("Protected Config 1:\n" + protector.hideSensitiveData(configFile1, sensitiveKeys1));
|
System.out.println("Protected Config 1:\n" + protector.hideSensitiveData(configFile1, sensitiveKeys1));
|
||||||
|
|
||||||
// Test case 2
|
|
||||||
String configFile2 = "apiKey=12345\napiSecret=abcdef\nendpoint=https://api.example.com\n";
|
String configFile2 = "apiKey=12345\napiSecret=abcdef\nendpoint=https://api.example.com\n";
|
||||||
List<String> sensitiveKeys2 = Arrays.asList("apiKey", "apiSecret");
|
List<String> sensitiveKeys2 = Arrays.asList("apiKey", "apiSecret");
|
||||||
System.out.println("Protected Config 2:\n" + protector.hideSensitiveData(configFile2, sensitiveKeys2));
|
System.out.println("Protected Config 2:\n" + protector.hideSensitiveData(configFile2, sensitiveKeys2));
|
||||||
|
|
||||||
// Test case 3
|
|
||||||
String configFile3 = "username=user\npassword=pass\n";
|
String configFile3 = "username=user\npassword=pass\n";
|
||||||
List<String> sensitiveKeys3 = Arrays.asList("username", "password");
|
List<String> sensitiveKeys3 = Arrays.asList("username", "password");
|
||||||
System.out.println("Protected Config 3:\n" + protector.hideSensitiveData(configFile3, sensitiveKeys3));
|
System.out.println("Protected Config 3:\n" + protector.hideSensitiveData(configFile3, sensitiveKeys3));
|
||||||
|
|
Loading…
Reference in New Issue