Skip to content
Merged
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
8 changes: 6 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ java {

application {
// Define the main class for the application.
mainClass = 'org.example.App'
mainClass = 'dev.project516.JavaAppTemplate.Main'
}

compileJava.dependsOn spotlessApply
Expand All @@ -44,7 +44,11 @@ spotless {
jar {
manifest {
attributes(
'Main-Class': 'org.example.App'
'Main-Class': 'dev.project516.JavaAppTemplate.Main'
)
}
}

run {
standardInput = System.in
}
13 changes: 13 additions & 0 deletions app/src/main/java/dev/project516/JavaAppTemplate/Main.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package dev.project516.JavaAppTemplate;

public class Main {

public String greetUser() {
return "Hello!";
}

public static void main(String[] args) {

System.out.println(new Main().greetUser());
}
}
13 changes: 13 additions & 0 deletions app/src/test/java/dev/project516/JavaAppTemplate/MainTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package dev.project516.JavaAppTemplate;

import static org.junit.Assert.*;

import org.junit.Test;

public class MainTest {
@Test
public void testGreetsUser() {
Main classUnderTest = new Main();
assertNotNull("Should greet the user", classUnderTest.greetUser());
}
}
2 changes: 1 addition & 1 deletion test.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/sh

./gradlew build
./gradlew build || exit 1

java -jar app/build/libs/app-all.jar
Loading