Skip to content

Commit 0090024

Browse files
committed
Resolve merge conflicts3
1 parent f4927af commit 0090024

File tree

2 files changed

+3
-51
lines changed

2 files changed

+3
-51
lines changed

app/src/main/java/hexlet/code/Parser.java

Lines changed: 0 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -52,51 +52,3 @@ public static Map<String, Object> parse(String filePath) throws IOException {
5252
return objectMapper.readValue(new File(filePath), new TypeReference<Map<String, Object>>() { });
5353
}
5454
}
55-
56-
57-
58-
59-
60-
//package hexlet.code;
61-
//
62-
//import com.fasterxml.jackson.core.type.TypeReference;
63-
//import com.fasterxml.jackson.databind.ObjectMapper;
64-
//import com.fasterxml.jackson.dataformat.yaml.YAMLFactory;
65-
//
66-
//import java.io.File;
67-
//import java.io.IOException;
68-
//import java.net.URISyntaxException;
69-
//import java.nio.file.Path;
70-
//import java.nio.file.Paths;
71-
//import java.util.Map;
72-
//import java.util.Objects;
73-
//
74-
//public class Parser {
75-
//
76-
// public static Map<String, Object> parse(String filePath) throws IOException {
77-
// ObjectMapper objectMapper;
78-
//
79-
// if (filePath.endsWith(".json")) {
80-
// objectMapper = new ObjectMapper();
81-
// } else if (filePath.endsWith(".yaml") || filePath.endsWith(".yml")) {
82-
// objectMapper = new ObjectMapper(new YAMLFactory()); // Используем YAML парсер
83-
// } else {
84-
// throw new IllegalArgumentException("Unsupported file format: " + filePath);
85-
// }
86-
//
87-
// Path path;
88-
// try {
89-
// path = Paths.get(Objects.requireNonNull(
90-
// Parser.class.getClassLoader().getResource("fixtures/" + filePath)).toURI());
91-
// } catch (URISyntaxException e) {
92-
// throw new RuntimeException("Invalid file path: " + filePath, e);
93-
// }
94-
//
95-
// return objectMapper.readValue(path.toFile(), new TypeReference<Map<String, Object>>() {});
96-
// }
97-
//}
98-
99-
100-
101-
// return objectMapper.readValue(new File("src/main/resources/fixtures/" + filePath),
102-
// new TypeReference<Map<String, Object>>() { });

app/src/test/java/hexlet/code/DifferTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ void testGenerateDiffForJsonStylish() throws IOException {
134134
var data2 = Parser.parseFromResources("file2.json");
135135
var diff = Differ.calculateDiff(data1, data2);
136136
var actual = Formatter.format(diff, "stylish");
137-
assertEquals(EXPECTED_JSON_STYLISH.trim(), actual.strip());
137+
assertEquals(EXPECTED_JSON_STYLISH.strip(), actual.strip());
138138
System.out.println("ВСЕ РАБОТАЕТ!!!");
139139
}
140140

@@ -144,7 +144,7 @@ void testGenerateDiffForJsonPlain() throws IOException {
144144
var data2 = Parser.parseFromResources("file2.yml");
145145
var diff = Differ.calculateDiff(data1, data2);
146146
var actual = Formatter.format(diff, "plain");
147-
assertEquals(EXPECTED_DIFF_PLAIN.trim(), actual.strip());
147+
assertEquals(EXPECTED_DIFF_PLAIN.strip(), actual.strip());
148148
System.out.println("ВСЕ РАБОТАЕТ! лала!!!");
149149
}
150150

@@ -155,7 +155,7 @@ void testGenerateDiffForJsonJson() throws IOException {
155155
var data2 = Parser.parseFromResources("file2.json");
156156
var diff = Differ.calculateDiff(data1, data2);
157157
var actual = Formatter.format(diff, "json");
158-
assertEquals(EXPECTED_JSON.trim(), actual.strip());
158+
assertEquals(EXPECTED_JSON.strip(), actual.strip());
159159
System.out.println("ВСЕ РАБОТАЕТ! дада!!!");
160160
}
161161
}

0 commit comments

Comments
 (0)