Skip to content

Commit 76bdc8d

Browse files
committed
fixed problems with hexletcheck
1 parent 70e55de commit 76bdc8d

File tree

9 files changed

+10
-10
lines changed

9 files changed

+10
-10
lines changed
0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.
170 Bytes
Binary file not shown.
0 Bytes
Binary file not shown.

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class App implements Runnable {
2525
@Override
2626
public void run() {
2727
try {
28-
String diff = DifferThreeParameters.generate(filePath1, filePath2, format);
28+
String diff = Differ.generate(filePath1, filePath2, format);
2929
System.out.println(diff);
3030
} catch (IOException e) {
3131
System.err.println("Ошибка при чтении файла: " + e.getMessage());

app/src/main/java/hexlet/code/DifferThreeParameters.java renamed to app/src/main/java/hexlet/code/Differ.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import java.nio.file.Files;
99
import java.nio.file.Paths;
1010

11-
public class DifferThreeParameters {
11+
public class Differ {
1212
public static String generate(String data1, String data2, String format) throws IOException {
1313

1414
String content1 = new String(Files.readAllBytes(Paths.get(data1)));

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,15 @@ private static String getFixturePath(String fileName) {
2424
@Test
2525
void testGenerateJsonStylish() throws IOException {
2626
String expected = readExpected("expectedStylish.txt");
27-
String actual = DifferThreeParameters.generate(getFixturePath("file1.json"), getFixturePath("file2.json"), "stylish");
27+
String actual = Differ.generate(getFixturePath("file1.json"), getFixturePath("file2.json"), "stylish");
2828
assertEquals(expected.strip(), actual.strip());
2929
System.out.println("1 ВСЕ РАБОТАЕТ");
3030
}
3131

3232
@Test
3333
void testGenerateJsonPlain() throws IOException {
3434
String expected = readExpected("expectedPlain.txt");
35-
String actual = DifferThreeParameters.generate(getFixturePath("file1.json"), getFixturePath("file2.json"), "plain");
35+
String actual = Differ.generate(getFixturePath("file1.json"), getFixturePath("file2.json"), "plain");
3636
assertEquals(expected.strip(), actual.strip());
3737
System.out.println("2 ВСЕ РАБОТАЕТ");
3838
}
@@ -41,7 +41,7 @@ void testGenerateJsonPlain() throws IOException {
4141
void testGenerateJsonJson() throws IOException {
4242
ObjectMapper mapper = new ObjectMapper();
4343
var expected = mapper.readTree(readExpected("expectedJson.json"));
44-
var actual = mapper.readTree(DifferThreeParameters.generate(getFixturePath("file1.json"), getFixturePath("file2.json"),
44+
var actual = mapper.readTree(Differ.generate(getFixturePath("file1.json"), getFixturePath("file2.json"),
4545
"json"));
4646
assertEquals(expected, actual);
4747
System.out.println("3 ВСЕ РАБОТАЕТ");
@@ -51,15 +51,15 @@ void testGenerateJsonJson() throws IOException {
5151
@Test
5252
void testGenerateYamlStylish() throws IOException {
5353
String expected = readExpected("expectedStylish.txt");
54-
String actual = DifferThreeParameters.generate(getFixturePath("file1.yml"), getFixturePath("file2.yml"), "stylish");
54+
String actual = Differ.generate(getFixturePath("file1.yml"), getFixturePath("file2.yml"), "stylish");
5555
assertEquals(expected.strip(), actual.strip());
5656
System.out.println("4 ВСЕ РАБОТАЕТ");
5757
}
5858

5959
@Test
6060
void testGenerateYamlPlain() throws IOException {
6161
String expected = readExpected("expectedPlain.txt");
62-
String actual = DifferThreeParameters.generate(getFixturePath("file1.yml"), getFixturePath("file2.yml"), "plain");
62+
String actual = Differ.generate(getFixturePath("file1.yml"), getFixturePath("file2.yml"), "plain");
6363
assertEquals(expected.strip(), actual.strip());
6464
System.out.println("5 ВСЕ РАБОТАЕТ");
6565
}
@@ -68,7 +68,7 @@ void testGenerateYamlPlain() throws IOException {
6868
void testGenerateYamlJson() throws IOException {
6969
ObjectMapper mapper = new ObjectMapper();
7070
var expected = mapper.readTree(readExpected("expectedJson.json"));
71-
var actual = mapper.readTree(DifferThreeParameters.generate(getFixturePath("file1.yml"), getFixturePath("file2.yml"),
71+
var actual = mapper.readTree(Differ.generate(getFixturePath("file1.yml"), getFixturePath("file2.yml"),
7272
"json"));
7373
assertEquals(expected, actual);
7474
System.out.println("6 ВСЕ РАБОТАЕТ");
@@ -77,7 +77,7 @@ void testGenerateYamlJson() throws IOException {
7777
@Test
7878
void testGenerateJsonDefault() throws IOException {
7979
String expected = readExpected("expectedStylish.txt");
80-
String actual = DifferThreeParameters.generate(getFixturePath("file1.json"), getFixturePath("file2.json"));
80+
String actual = Differ.generate(getFixturePath("file1.json"), getFixturePath("file2.json"));
8181
assertEquals(expected.strip(), actual.strip());
8282
System.out.println("7 ВСЕ РАБОТАЕТ");
8383
}
@@ -86,7 +86,7 @@ void testGenerateJsonDefault() throws IOException {
8686
@Test
8787
void testGenerateYamlDefault() throws IOException {
8888
String expected = readExpected("expectedStylish.txt");
89-
String actual = DifferThreeParameters.generate(getFixturePath("file1.yml"), getFixturePath("file2.yml"));
89+
String actual = Differ.generate(getFixturePath("file1.yml"), getFixturePath("file2.yml"));
9090
assertEquals(expected.strip(), actual.strip());
9191
System.out.println("8 ВСЕ РАБОТАЕТ");
9292
}

0 commit comments

Comments
 (0)