add feature

This commit is contained in:
Alexey Metlyakov
2021-03-14 17:01:32 +03:00
parent c7b8ef7a18
commit 5295976ea8
4 changed files with 12 additions and 14 deletions

11
pom.xml
View File

@@ -6,7 +6,7 @@
<groupId>org.netology</groupId>
<artifactId>example-maven</artifactId>
<packaging>jar</packaging>
<version>0.1.0</version>
<version>0.2.0</version>
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
@@ -14,21 +14,12 @@
</properties>
<dependencies>
<!-- tag::joda[] -->
<dependency>
<groupId>joda-time</groupId>
<artifactId>joda-time</artifactId>
<version>2.9.2</version>
</dependency>
<!-- end::joda[] -->
<!-- tag::junit[] -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
<!-- end::junit[] -->
</dependencies>
<build>

View File

@@ -1,12 +1,9 @@
package plaindoll;
import org.joda.time.LocalTime;
public class HelloPlayer{
public static void main(String[] args) {
LocalTime currentTime = new LocalTime();
System.out.println("The current local time is: " + currentTime);
Welcomer welcomer = new Welcomer();
System.out.println(welcomer.sayWelcome());
System.out.println(welcomer.sayFarewell());
}
}

View File

@@ -4,4 +4,7 @@ public class Welcomer{
public String sayWelcome() {
return "Welcome home, good hunter. What is it your desire?";
}
public String sayFarewell() {
return "Farewell, good hunter. May you find your worth in waking world.";
}
}

View File

@@ -13,5 +13,12 @@ public class WelcomerTest {
public void welcomerSaysWelcome() {
assertThat(welcomer.sayWelcome(), containsString("Welcome"));
}
public void welcomerSaysFarewell() {
assertThat(welcomer.sayFarewell(), containsString("Farewell"));
}
public void welcomerSaysHunter() {
assertThat(welcomer.SaysWelcome(), containsString("hunter"));
assertThat(welcomer.sayFarewell(), containsString("hunter"));
}
}