Skip to content

Commit

Permalink
update unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
bsorrentino committed Apr 16, 2018
1 parent 780f34f commit edc41a2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public void functionalInterfaceTest() {
Assert.assertThat(TypescriptConverter.isFunctionalInterface(java.lang.Runnable.class) , is(true));
Assert.assertThat(TypescriptConverter.isFunctionalInterface(Consumer.class) , is(true));
Assert.assertThat(TypescriptConverter.isFunctionalInterface(Action.class) , is(true));
Assert.assertThat(TypescriptConverter.isFunctionalInterface(Action.class, (m-> Assert.assertThat(m.getName(), equalTo("apply")))) , is(true));
Assert.assertThat(TypescriptConverter.isFunctionalInterface(Action.class), is(true));
Assert.assertThat(TypescriptConverter.isFunctionalInterface(Action2.class) , is(false));
}
}
8 changes: 4 additions & 4 deletions core/src/test/java/org/bsc/java2typescript/ProcessorTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public void testWildcardType() throws Exception {
final Method m = type.getValue().getMethod("merge", BiConsumer.class );
final String result = converter.getMethodParametersAndReturnDecl( m,
type,
declaredTypeMap( TSType.from(String.class), TSType.from(Sample2.class), TSType.from(BiConsumer.class)),
declaredTypeMap( TSType.from(String.class), TSType.from(Sample2.class), TSType.from(BiConsumer.class, "BiConsumer", false)),
true) ;

Assert.assertThat( result, IsNull.notNullValue());
Expand Down Expand Up @@ -214,8 +214,8 @@ public void testSample1() throws Exception {
final Method m = type.getMethod("method1_3");
final Type rType = m.getGenericReturnType();
final String result = TypescriptConverter.convertJavaToTS(rType, m,
TSType.from(type),
declaredClassMap(java.util.function.BiPredicate.class),
TSType.from(type),
declaredTypeMap( TSType.from(java.util.function.BiPredicate.class, "BiPredicate",false) ),
true,
Optional.of(addTypeVar));
Assert.assertThat( result, IsNull.notNullValue());
Expand Down Expand Up @@ -302,7 +302,7 @@ public void testSample1() throws Exception {
final Type pType = m.getParameters()[0].getParameterizedType();
final String rresult = TypescriptConverter.convertJavaToTS(pType, m,
TSType.from(type),
declaredClassMap(Sample2.class, Consumer.class),
declaredTypeMap( TSType.from(Sample2.class), TSType.from(Consumer.class, "Consumer", false)),
true,
Optional.empty());
Assert.assertThat( rresult, IsNull.notNullValue());
Expand Down

0 comments on commit edc41a2

Please sign in to comment.