Use build template
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
package de.thpeetz.generations;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
/**
|
||||
* Example App class.
|
||||
* @author tpeetz
|
||||
*
|
||||
*/
|
||||
public class App {
|
||||
|
||||
/**
|
||||
* Standard logger.
|
||||
*/
|
||||
private static final Logger LOG = LoggerFactory.getLogger(App.class);
|
||||
|
||||
/**
|
||||
* Returns greeting.
|
||||
* @return greeting
|
||||
*/
|
||||
public String getGreeting() {
|
||||
return "Hello world.";
|
||||
}
|
||||
|
||||
/**
|
||||
* Main entry point for application Generations.
|
||||
* @param args Arguments
|
||||
*/
|
||||
public static void main(final String[] args) {
|
||||
LOG.info("Greeting {}", new App().getGreeting());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
/**
|
||||
* Domain classes used to implement application Generations.
|
||||
*
|
||||
* @author Thomas Peetz
|
||||
* @since 1.0.0
|
||||
* @version 1.0.0
|
||||
*/
|
||||
package de.thpeetz.generations;
|
||||
@@ -0,0 +1,11 @@
|
||||
<configuration>
|
||||
<appender name="STDOUT"
|
||||
class="ch.qos.logback.core.ConsoleAppender">
|
||||
<encoder>
|
||||
<pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
|
||||
</encoder>
|
||||
</appender>
|
||||
<root level="debug">
|
||||
<appender-ref ref="STDOUT" />
|
||||
</root>
|
||||
</configuration>
|
||||
@@ -0,0 +1,36 @@
|
||||
/*
|
||||
* This Java source file was generated by the Gradle 'init' task.
|
||||
*/
|
||||
package de.thpeetz.generations;
|
||||
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import static org.junit.jupiter.api.Assertions.assertNotNull;
|
||||
import static org.junit.jupiter.api.Assertions.fail;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
class AppTest {
|
||||
|
||||
@Test
|
||||
void appHasAGreeting() {
|
||||
App classUnderTest = new App();
|
||||
assertNotNull(classUnderTest.getGreeting(),
|
||||
"app should have a greeting");
|
||||
}
|
||||
|
||||
@Test
|
||||
void checkGreeting() {
|
||||
App classUnderTest = new App();
|
||||
assertEquals("Hello world.", classUnderTest.getGreeting());
|
||||
}
|
||||
|
||||
@Test
|
||||
void checkMainWithoutArguments() {
|
||||
try {
|
||||
String[] args = {};
|
||||
App.main(args);
|
||||
} catch (Exception e) {
|
||||
fail("Exception thrown");
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
/**
|
||||
* Test classes for application Generations.
|
||||
*
|
||||
* @author Thomas Peetz
|
||||
* @since 1.0.0
|
||||
* @version 1.0.0
|
||||
*/
|
||||
package de.thpeetz.generations;
|
||||
Reference in New Issue
Block a user