-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix exising tests and add a new test for endpoint usage detector
- Loading branch information
Showing
9 changed files
with
144 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<parent> | ||
<groupId>com.vaadin</groupId> | ||
<artifactId>tests-spring</artifactId> | ||
<version>24.6-SNAPSHOT</version> | ||
</parent> | ||
<artifactId>tests-spring-no-endpoints</artifactId> | ||
<name>ITs for No Endpoints cases</name> | ||
<packaging>jar</packaging> | ||
|
||
<properties> | ||
<maven.deploy.skip>true</maven.deploy.skip> | ||
<formatter.basedir>${project.parent.parent.parent.basedir}</formatter.basedir> | ||
</properties> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>com.vaadin</groupId> | ||
<artifactId>hilla</artifactId> | ||
</dependency> | ||
<dependency> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-starter-test</artifactId> | ||
<scope>test</scope> | ||
</dependency> | ||
</dependencies> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>com.vaadin</groupId> | ||
<artifactId>hilla-maven-plugin</artifactId> | ||
<configuration> | ||
<parser> | ||
<packages> | ||
<package>com.example.application</package> | ||
</packages> | ||
</parser> | ||
</configuration> | ||
<executions> | ||
<execution> | ||
<goals> | ||
<!-- The test here assumes the build creates frontend files --> | ||
<goal>build-frontend</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
|
||
<plugin> | ||
<groupId>org.springframework.boot</groupId> | ||
<artifactId>spring-boot-maven-plugin</artifactId> | ||
<configuration> | ||
<includeSystemScope>true</includeSystemScope> | ||
</configuration> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
|
||
</project> |
16 changes: 16 additions & 0 deletions
16
...ges/java/tests/spring/no-endpoints/src/main/java/com/example/application/Application.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package com.example.application; | ||
|
||
import org.springframework.boot.SpringApplication; | ||
import org.springframework.boot.autoconfigure.SpringBootApplication; | ||
|
||
/** | ||
* The entry point of the Spring Boot application. | ||
*/ | ||
@SpringBootApplication | ||
public class Application { | ||
|
||
public static void main(String[] args) { | ||
SpringApplication.run(Application.class, args); | ||
} | ||
|
||
} |
12 changes: 12 additions & 0 deletions
12
...ng/no-endpoints/src/main/java/com/example/application/InternalBrowserCallableExample.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package com.example.application; | ||
|
||
import com.vaadin.hilla.Endpoint; | ||
import com.vaadin.hilla.InternalBrowserCallable; | ||
|
||
@Endpoint | ||
@InternalBrowserCallable | ||
public class InternalBrowserCallableExample { | ||
public String exampleMethod() { | ||
return null; | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
...ts/spring/no-endpoints/src/main/java/com/example/application/InternalEndpointExample.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package com.example.application; | ||
|
||
import com.vaadin.hilla.Endpoint; | ||
import com.vaadin.hilla.InternalBrowserCallable; | ||
|
||
@Endpoint | ||
@InternalBrowserCallable | ||
public class InternalEndpointExample { | ||
public String exampleMethod() { | ||
return null; | ||
} | ||
} |
3 changes: 3 additions & 0 deletions
3
packages/java/tests/spring/no-endpoints/src/main/resources/application.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
server.port=8888 | ||
vaadin.devmode.liveReload.enabled=false | ||
logging.level.org.atmosphere = warn |
26 changes: 26 additions & 0 deletions
26
...a/tests/spring/no-endpoints/src/test/java/com/example/application/InternalEndpointIT.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package com.example.application; | ||
|
||
import java.nio.file.Files; | ||
import java.nio.file.Path; | ||
import java.nio.file.Paths; | ||
|
||
import org.junit.Test; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertFalse; | ||
import static org.junit.jupiter.api.Assertions.assertTrue; | ||
|
||
public class InternalEndpointIT { | ||
Path frontendDir = Paths.get("frontend", "generated"); | ||
|
||
@Test | ||
public void shouldNotRunEndpointGeneratorForOnlyInternalEndpointsPresent() { | ||
assertFalse(Files.exists(frontendDir.resolve("InternalBrowserCallableExample.ts"))); | ||
assertFalse(Files.exists(frontendDir.resolve("InternalEndpointExample.ts"))); | ||
assertFalse(Files.exists(frontendDir | ||
.resolve("com/example/application/InternalBrowserCallableExample.ts"))); | ||
assertFalse(Files.exists(frontendDir | ||
.resolve("com/example/application/InternalEndpointExample.ts"))); | ||
} | ||
|
||
|
||
} |