Skip to content

Commit 64caab5

Browse files
Remove hamcrest test dependency
1 parent d430f80 commit 64caab5

File tree

5 files changed

+11
-29
lines changed

5 files changed

+11
-29
lines changed

typescript-generator-core/pom.xml

-6
Original file line numberDiff line numberDiff line change
@@ -107,12 +107,6 @@
107107
<version>${junit.version}</version>
108108
<scope>test</scope>
109109
</dependency>
110-
<dependency>
111-
<groupId>org.hamcrest</groupId>
112-
<artifactId>hamcrest</artifactId>
113-
<version>2.2</version>
114-
<scope>test</scope>
115-
</dependency>
116110
<dependency>
117111
<groupId>org.immutables</groupId>
118112
<artifactId>value</artifactId>

typescript-generator-core/src/test/java/cz/habarta/typescript/generator/ExtensionTest.java

+1-3
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212
import java.util.ArrayList;
1313
import java.util.Collections;
1414
import java.util.List;
15-
import org.hamcrest.CoreMatchers;
16-
import org.hamcrest.MatcherAssert;
1715
import org.junit.jupiter.api.Assertions;
1816
import org.junit.jupiter.api.Test;
1917

@@ -62,7 +60,7 @@ public Model transformModel(SymbolTable symbolTable, Model model) {
6260
final TsModel result = modelCompiler.javaToTypeScript(model);
6361

6462
Assertions.assertEquals(1, result.getBean(Implementation.class).getComments().size());
65-
MatcherAssert.assertThat(result.getBean(Implementation.class).getComments().get(0), CoreMatchers.containsString("My new comment"));
63+
Assertions.assertTrue(result.getBean(Implementation.class).getComments().get(0).contains("My new comment"));
6664
}
6765

6866
private static class Implementation { }

typescript-generator-core/src/test/java/cz/habarta/typescript/generator/GenericCustomTypeMappingsTest.java

+4-6
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
import java.util.Date;
66
import java.util.List;
77
import java.util.Map;
8-
import static org.hamcrest.CoreMatchers.containsString;
9-
import static org.hamcrest.MatcherAssert.assertThat;
108
import org.junit.jupiter.api.Assertions;
119
import org.junit.jupiter.api.Test;
1210

@@ -150,10 +148,10 @@ public void byteArrayAsString() {
150148
settings.customTypeMappings.put("byte[][]", "DifferentString[]");
151149
settings.customTypeMappings.put("long[]", "SpecialString");
152150
final String output = new TypeScriptGenerator(settings).generateTypeScript(Input.from(BinaryData.class));
153-
assertThat(output, containsString("data: string"));
154-
assertThat(output, containsString("dataArray: DifferentString[]"));
155-
assertThat(output, containsString("dataList: string[]"));
156-
assertThat(output, containsString("specialData: SpecialString"));
151+
Assertions.assertTrue(output.contains("data: string"), output);
152+
Assertions.assertTrue(output.contains("dataArray: DifferentString[]"), output);
153+
Assertions.assertTrue(output.contains("dataList: string[]"), output);
154+
Assertions.assertTrue(output.contains("specialData: SpecialString"), output);
157155
}
158156

159157
}

typescript-generator-core/src/test/java/cz/habarta/typescript/generator/ModelCompilerTest.java

+6-8
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@
1111
import java.util.Date;
1212
import java.util.List;
1313
import java.util.Map;
14-
import org.hamcrest.CoreMatchers;
15-
import org.hamcrest.MatcherAssert;
1614
import org.junit.jupiter.api.Assertions;
1715
import org.junit.jupiter.api.Test;
1816

@@ -59,9 +57,9 @@ public void testIntermediateInterfacesWithoutTypeParams() throws Exception {
5957

6058
final TsModel result = modelCompiler.javaToTypeScript(model);
6159

62-
MatcherAssert.assertThat(
63-
result.getBean(WithoutTypeParam.class).getProperties().get(0).tsType,
64-
CoreMatchers.instanceOf(TsType.UnionType.class)
60+
Assertions.assertInstanceOf(
61+
TsType.UnionType.class,
62+
result.getBean(WithoutTypeParam.class).getProperties().get(0).tsType
6563
);
6664
}
6765

@@ -75,9 +73,9 @@ public void testIntermediateInterfacesWithTypeParams() throws Exception {
7573

7674
final TsModel result = modelCompiler.javaToTypeScript(model);
7775

78-
MatcherAssert.assertThat(
79-
result.getBean(WithTypeParam.class).getProperties().get(0).tsType,
80-
CoreMatchers.instanceOf(TsType.UnionType.class)
76+
Assertions.assertInstanceOf(
77+
TsType.UnionType.class,
78+
result.getBean(WithTypeParam.class).getProperties().get(0).tsType
8179
);
8280
}
8381

typescript-generator-spring/pom.xml

-6
Original file line numberDiff line numberDiff line change
@@ -69,12 +69,6 @@
6969
<version>${junit.version}</version>
7070
<scope>test</scope>
7171
</dependency>
72-
<dependency>
73-
<groupId>org.hamcrest</groupId>
74-
<artifactId>hamcrest</artifactId>
75-
<version>2.2</version>
76-
<scope>test</scope>
77-
</dependency>
7872
</dependencies>
7973

8074
<build>

0 commit comments

Comments
 (0)