Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions packages/java/typescript-generator/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,11 @@
<artifactId>spring-web</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<scope>test</scope>
</dependency>
</dependencies>

<build>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,32 +15,19 @@
*/
package com.vaadin.hilla.parser.plugins.transfertypes.file;

import java.io.IOException;
import java.net.URISyntaxException;
import java.util.List;
import java.util.Set;

import org.junit.jupiter.api.Test;

import com.vaadin.hilla.parser.core.Parser;
import com.vaadin.hilla.parser.plugins.backbone.BackbonePlugin;
import com.vaadin.hilla.parser.plugins.transfertypes.TransferTypesPlugin;
import com.vaadin.hilla.parser.plugins.transfertypes.test.helpers.TestHelper;
import com.vaadin.hilla.parser.testutils.annotations.Endpoint;
import com.vaadin.hilla.parser.testutils.AbstractFullStackTest;

public class MultipartFileTest {
private final TestHelper helper = new TestHelper(getClass());
/**
* Full-stack test for MultipartFile type handling - verifies complete Java →
* TypeScript generation pipeline.
*/
public class MultipartFileTest extends AbstractFullStackTest {

@Test
public void should_ReplaceMultipartFileClassWithLocalFileClass()
throws IOException, URISyntaxException {
var openAPI = new Parser()
.classPath(Set.of(helper.getTargetDir().toString()))
.endpointAnnotations(List.of(Endpoint.class))
.addPlugin(new BackbonePlugin())
.addPlugin(new TransferTypesPlugin())
.execute(List.of(MultipartFileEndpoint.class));

helper.executeParserWithConfig(openAPI);
throws Exception {
assertTypescriptMatchesSnapshot(MultipartFileEndpoint.class);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,32 +15,18 @@
*/
package com.vaadin.hilla.parser.plugins.transfertypes.jsonnode;

import java.io.IOException;
import java.net.URISyntaxException;
import java.util.List;
import java.util.Set;

import org.junit.jupiter.api.Test;

import com.vaadin.hilla.parser.core.Parser;
import com.vaadin.hilla.parser.plugins.backbone.BackbonePlugin;
import com.vaadin.hilla.parser.plugins.transfertypes.TransferTypesPlugin;
import com.vaadin.hilla.parser.plugins.transfertypes.test.helpers.TestHelper;
import com.vaadin.hilla.parser.testutils.annotations.Endpoint;
import com.vaadin.hilla.parser.testutils.AbstractFullStackTest;

public class JsonNodeTest {
private final TestHelper helper = new TestHelper(getClass());
/**
* Full-stack test for JsonNode type handling - verifies complete Java →
* TypeScript generation pipeline.
*/
public class JsonNodeTest extends AbstractFullStackTest {

@Test
public void should_ReplaceJsonNodeClassWithObject()
throws IOException, URISyntaxException {
var openAPI = new Parser()
.classPath(Set.of(helper.getTargetDir().toString()))
.endpointAnnotations(List.of(Endpoint.class))
.addPlugin(new BackbonePlugin())
.addPlugin(new TransferTypesPlugin())
.execute(List.of(JsonNodeEndpoint.class));

helper.executeParserWithConfig(openAPI);
public void should_ReplaceJsonNodeClassWithObject() throws Exception {
assertTypescriptMatchesSnapshot(JsonNodeEndpoint.class);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,39 +15,19 @@
*/
package com.vaadin.hilla.parser.plugins.transfertypes.push;

import java.io.File;
import java.io.IOException;
import java.net.URISyntaxException;
import java.util.List;

import org.junit.jupiter.api.Test;
import reactor.core.publisher.Flux;

import com.vaadin.hilla.EndpointSubscription;
import com.vaadin.hilla.parser.core.Parser;
import com.vaadin.hilla.parser.plugins.backbone.BackbonePlugin;
import com.vaadin.hilla.parser.plugins.transfertypes.TransferTypesPlugin;
import com.vaadin.hilla.parser.plugins.transfertypes.test.helpers.TestHelper;
import com.vaadin.hilla.parser.testutils.annotations.Endpoint;
import com.vaadin.hilla.parser.testutils.annotations.EndpointExposed;
import com.vaadin.hilla.parser.testutils.AbstractFullStackTest;

public class PushTypeTest {
private final TestHelper helper = new TestHelper(getClass());
/**
* Full-stack test for Push/Flux type handling - verifies complete Java →
* TypeScript generation pipeline.
*/
public class PushTypeTest extends AbstractFullStackTest {

@Test
public void should_ReplacePushTypes()
throws IOException, URISyntaxException {
var classpath = helper.getExtendedClassPath(Flux.class,
EndpointSubscription.class);

var openAPI = new Parser()
.classPath(classpath.split(File.pathSeparator))
.endpointAnnotations(List.of(Endpoint.class))
.endpointExposedAnnotations(List.of(EndpointExposed.class))
.addPlugin(new BackbonePlugin())
.addPlugin(new TransferTypesPlugin())
.execute(List.of(OtherEndpoint.class, PushTypeEndpoint.class));

helper.executeParserWithConfig(openAPI);
public void should_ReplacePushTypes() throws Exception {
assertTypescriptMatchesSnapshot(OtherEndpoint.class,
PushTypeEndpoint.class);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,32 +15,19 @@
*/
package com.vaadin.hilla.parser.plugins.transfertypes.signals;

import java.io.IOException;
import java.net.URISyntaxException;
import java.util.List;
import java.util.Set;

import org.junit.jupiter.api.Test;

import com.vaadin.hilla.parser.core.Parser;
import com.vaadin.hilla.parser.plugins.backbone.BackbonePlugin;
import com.vaadin.hilla.parser.plugins.transfertypes.TransferTypesPlugin;
import com.vaadin.hilla.parser.plugins.transfertypes.test.helpers.TestHelper;
import com.vaadin.hilla.parser.testutils.annotations.Endpoint;
import com.vaadin.hilla.parser.testutils.AbstractFullStackTest;

public class SignalTest {
private final TestHelper helper = new TestHelper(getClass());
/**
* Full-stack test for Signal type handling - verifies complete Java →
* TypeScript generation pipeline.
*/
public class SignalTest extends AbstractFullStackTest {

@Test
public void should_ReplaceSignalClassesWithLocalSignalRecords()
throws IOException, URISyntaxException {
var openAPI = new Parser()
.classPath(Set.of(helper.getTargetDir().toString()))
.endpointAnnotations(List.of(Endpoint.class))
.addPlugin(new BackbonePlugin())
.addPlugin(new TransferTypesPlugin())
.execute(List.of(SignalEndpoint.class));

helper.executeParserWithConfig(openAPI);
throws Exception {
assertTypescriptMatchesSnapshot(SignalEndpoint.class);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,34 +15,19 @@
*/
package com.vaadin.hilla.parser.plugins.transfertypes.uuid;

import java.io.IOException;
import java.net.URISyntaxException;
import java.util.List;
import java.util.Set;

import org.junit.jupiter.api.Test;

import com.vaadin.hilla.parser.core.Parser;
import com.vaadin.hilla.parser.plugins.backbone.BackbonePlugin;
import com.vaadin.hilla.parser.plugins.transfertypes.TransferTypesPlugin;
import com.vaadin.hilla.parser.plugins.transfertypes.test.helpers.TestHelper;
import com.vaadin.hilla.parser.testutils.annotations.Endpoint;
import com.vaadin.hilla.parser.testutils.annotations.EndpointExposed;
import com.vaadin.hilla.parser.testutils.AbstractFullStackTest;

public class UUIDTest {
private final TestHelper helper = new TestHelper(getClass());
/**
* Full-stack test for UUID type handling - verifies complete Java → TypeScript
* generation pipeline.
*/
public class UUIDTest extends AbstractFullStackTest {

@Test
public void should_ReplaceUUIDClassWithString()
throws IOException, URISyntaxException {
var openAPI = new Parser()
.classPath(Set.of(helper.getTargetDir().toString()))
.endpointAnnotations(List.of(Endpoint.class))
.endpointExposedAnnotations(List.of(EndpointExposed.class))
.addPlugin(new BackbonePlugin())
.addPlugin(new TransferTypesPlugin())
.execute(List.of(UUIDEndpoint.class));

helper.executeParserWithConfig(openAPI);
public void should_ReplaceUUIDClassWithStringInTypeScript()
throws Exception {
assertTypescriptMatchesSnapshot(UUIDEndpoint.class);
}
}
Loading