Skip to content

Commit

Permalink
Fix POM files in coffee kata and coffee kata solution
Browse files Browse the repository at this point in the history
Signed-off-by: Aqsa Malik <[email protected]>
  • Loading branch information
aqsa505 committed Sep 11, 2023
1 parent 720e906 commit 1e0850a
Show file tree
Hide file tree
Showing 71 changed files with 189 additions and 285 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/solutions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,6 @@ jobs:
restore-keys: |
${{ runner.os }}-maven-
- name: Maven
run: mvn -pl calendar-kata-solutions,code-point-kata-solutions,deck-of-cards-kata-solutions,donut-kata-solutions,java-lambda-kata-solutions,pitest-mutation-kata-solutions,coffee-shop-kata-solutions/new-java-features-solutions,kata-of-katas-solutions verify -Dmaven.javadoc.skip=true -B -V --no-transfer-progress
run: mvn -pl calendar-kata-solutions,code-point-kata-solutions,deck-of-cards-kata-solutions,donut-kata-solutions,java-lambda-kata-solutions,pitest-mutation-kata-solutions,coffee-shop-kata-solutions,kata-of-katas-solutions verify -Dmaven.javadoc.skip=true -B -V --no-transfer-progress
env:
MAVEN_OPTS: "-Dmaven.repo.local=$HOME/.m2/repository -Xmx1g -Dorg.slf4j.simpleLogger.showDateTime=true -Dorg.slf4j.simpleLogger.dateTimeFormat=HH:mm:ss:SSS"
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,14 @@
<modelVersion>4.0.0</modelVersion>

<groupId>bnymellon.codekatas</groupId>
<version>1.0.0</version>
<artifactId>new-java-features-solutions</artifactId>
<version>1.0.0-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
</dependency>
</dependencies>
<artifactId>coffee-shop-kata-solutions</artifactId>

<name>Coffee Shop Kata Solutions</name>
<description>
Expand All @@ -32,34 +38,28 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

<maven.compiler.source>20</maven.compiler.source>
<maven.compiler.target>20</maven.compiler.target>
<maven.compiler.source>21</maven.compiler.source>
<maven.compiler.target>21</maven.compiler.target>
<junit5.version>5.9.3</junit5.version>
</properties>

<dependencies>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<version>${junit5.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<version>${junit5.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
</dependencyManagement>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>21</source>
<target>21</target>
</configuration>
<version>3.11.0</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.2</version>
<version>3.1.2</version>
<configuration>
<argLine>--enable-preview</argLine>
</configuration>
Expand Down
26 changes: 13 additions & 13 deletions coffee-shop-kata/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,20 @@ Java features while comparing them with older.

The domain for the kata is a Coffee Shop. There are several domain
classes that are shared by all the exercises. These are
[`Items`](./old-java-features/src/main/java/bnymellon/codekatas/coffeekata/Item.java),
[`CoffeeShopOrder`](./old-java-features/src/main/java/bnymellon/codekatas/coffeekata/CoffeeShopOrder.java),
[`Beverage`](./old-java-features/src/main/java/bnymellon/codekatas/coffeekata/beverage/Beverage.java),
[`Tea`](./old-java-features/src/main/java/bnymellon/codekatas/coffeekata/beverage/Tea.java),
[`CoffeeDrink`](./old-java-features/src/main/java/bnymellon/codekatas/coffeekata/beverage/CoffeeDrink.java),
[`Latte`](./old-java-features/src/main/java/bnymellon/codekatas/coffeekata/beverage/Latte.java),
[`Macchiato`](./old-java-features/src/main/java/bnymellon/codekatas/coffeekata/beverage/Macchiato.java),
[`Americano`](./old-java-features/src/main/java/bnymellon/codekatas/coffeekata/beverage/Americano.java),
[`BakeryItem`](./old-java-features/src/main/java/bnymellon/codekatas/coffeekata/food/BakeryItem.java),
[`Cookie`](./old-java-features/src/main/java/bnymellon/codekatas/coffeekata/food/Cookie.java),
[`Bagel`](./old-java-features/src/main/java/bnymellon/codekatas/coffeekata/food/Bagel.java), and
[`Donut`](./old-java-features/src/main/java/bnymellon/codekatas/coffeekata/food/Donut.java).
[`Items`](src/main/java/bnymellon/codekatas/coffeeshopkata/Item.java),
[`CoffeeShopOrder`](src/main/java/bnymellon/codekatas/coffeeshopkata/CoffeeShopOrder.java),
[`Beverage`](src/main/java/bnymellon/codekatas/coffeeshopkata/oldjavafeatures/beverage/Beverage.java),
[`Tea`](src/main/java/bnymellon/codekatas/coffeeshopkata/oldjavafeatures/beverage/Tea.java),
[`CoffeeDrink`](src/main/java/bnymellon/codekatas/coffeeshopkata/oldjavafeatures/beverage/CoffeeDrink.java),
[`Latte`](src/main/java/bnymellon/codekatas/coffeeshopkata/oldjavafeatures/beverage/Latte.java),
[`Macchiato`](src/main/java/bnymellon/codekatas/coffeeshopkata/oldjavafeatures/beverage/Macchiato.java),
[`Americano`](src/main/java/bnymellon/codekatas/coffeeshopkata/oldjavafeatures/beverage/Americano.java),
[`BakeryItem`](src/main/java/bnymellon/codekatas/coffeeshopkata/oldjavafeatures/food/BakeryItem.java),
[`Cookie`](src/main/java/bnymellon/codekatas/coffeeshopkata/oldjavafeatures/food/Cookie.java),
[`Bagel`](src/main/java/bnymellon/codekatas/coffeeshopkata/oldjavafeatures/food/Bagel.java), and
[`Donut`](src/main/java/bnymellon/codekatas/coffeeshopkata/oldjavafeatures/food/Donut.java).

![Diagram](CoffeeShopDomain.png)

## Getting Started ##
This kata involves refactoring existing code and implementing missing code! In the [`new-java-features`](./new-java-features) module, you will find a test class called [CoffeeShopTest](./new-java-features/src/test/java/CoffeeShopTest.java). Each test case contains a TODO that needs to be completed in order to make the code pass. All the code you need to complete is in the [`new-java-features`](./new-java-features) module, with the corresponding solutions in [`coffee-shop-kata-solutions/new-java-features`](../coffee-shop-kata-solutions/new-java-features-solutions). The purpose of the [`old-java-features`](./old-java-features) module is to show you the Java 8 way of solving these problems; there are no TODOs in this module. For technical setup, follow the instructions in [`SETUP.md`](./SETUP.md)!
This kata involves refactoring existing code and implementing missing code! In the [`new-java-features`](./new-java-features) module, you will find a test class called [CoffeeShopTest](src/test/java/bnymellon/codekata/coffeeshopkata/newjavafeatures/CoffeeShopTest.java). Each test case contains a TODO that needs to be completed in order to make the code pass. All the code you need to complete is in the [`new-java-features`](./new-java-features) module, with the corresponding solutions in [`coffee-shop-kata-solutions/new-java-features`](../coffee-shop-kata-solutions/new-java-features-solutions). The purpose of the [`old-java-features`](./old-java-features) module is to show you the Java 8 way of solving these problems; there are no TODOs in this module. For technical setup, follow the instructions in [`SETUP.md`](./SETUP.md)!
4 changes: 2 additions & 2 deletions coffee-shop-kata/SETUP.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@
2. Run [CoffeeShopTest](/old-java-features/src/test/java/CoffeeShopTest.java), all tests should pass
#### Test Java 21 module
1. Verify that the module old-java-features uses JDK 20
2. Run [CoffeeShopTest](/new-java-features/src/test/java/CoffeeShopTest.java), most tests should fail
2. Run [CoffeeShopTest](/bnymellon/codekata/coffeeshopkata/newjavafeatures/CoffeeShopTest.java), most tests should fail
#### Get started
* Make the failing tests in [CoffeeShopTest](/new-java-features/src/test/java/CoffeeShopTest.java) pass by following and completing TODOs
* Make the failing tests in [CoffeeShopTest](/bnymellon/codekata/coffeeshopkata/newjavafeatures/CoffeeShopTest.java) pass by following and completing TODOs
61 changes: 0 additions & 61 deletions coffee-shop-kata/new-java-features/pom.xml

This file was deleted.

58 changes: 0 additions & 58 deletions coffee-shop-kata/old-java-features/pom.xml

This file was deleted.

64 changes: 42 additions & 22 deletions coffee-shop-kata/pom.xml
Original file line number Diff line number Diff line change
@@ -1,47 +1,67 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright 2023 The Bank of New York Mellon.
~
~ Licensed under the Apache License, Version 2.0 (the "License");
~ you may not use this file except in compliance with the License.
~ You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing, software
~ distributed under the License is distributed on an "AS IS" BASIS,
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
~ See the License for the specific language governing permissions and
~ limitations under the License.
-->

<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>

<groupId>bnymellon.codekatas</groupId>
<version>1.0.0-SNAPSHOT</version>
<dependencies>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
</dependency>
</dependencies>
<artifactId>coffee-shop-kata</artifactId>
<version>1.0.0</version>

<name>coffee-shop-kata</name>
<packaging>pom</packaging>
<name>Coffee Shop Kata</name>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>20</maven.compiler.source>
<maven.compiler.target>20</maven.compiler.target>
</properties>

<modules>
<module>new-java-features</module>
<module>old-java-features</module>
</modules>

<build>
<pluginManagement>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.11.0</version>
</plugin>
</plugins>
</pluginManagement>
</build>
<maven.compiler.source>21</maven.compiler.source>
<maven.compiler.target>21</maven.compiler.target>
<junit5.version>5.9.3</junit5.version>
</properties>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<version>5.9.2</version>
<version>${junit5.version}</version>
<scope>test</scope>
</dependency>
</dependencies>
</dependencyManagement>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.1.2</version>
<configuration>
<argLine>--enable-preview</argLine>
</configuration>
</plugin>
</plugins>
</build>

</project>
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,8 @@
* limitations under the License.
*/

package bnymellon.codekatas.coffeekata;
package bnymellon.codekatas.coffeeshopkata.newjavafeatures;

import bnymellon.codekatas.coffeekata.beverage.Americano;
import bnymellon.codekatas.coffeekata.beverage.Latte;
import bnymellon.codekatas.coffeekata.beverage.Macchiato;
import bnymellon.codekatas.coffeekata.beverage.Tea;

import java.util.ArrayList;
import java.util.List;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

package bnymellon.codekatas.coffeekata;
package bnymellon.codekatas.coffeeshopkata.newjavafeatures;

public interface Item
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

package bnymellon.codekatas.coffeekata.beverage;
package bnymellon.codekatas.coffeeshopkata.newjavafeatures.beverage;

public final class Americano implements CoffeeDrink
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@
* limitations under the License.
*/

package bnymellon.codekatas.coffeekata.beverage;
package bnymellon.codekatas.coffeeshopkata.newjavafeatures.beverage;

import bnymellon.codekatas.coffeekata.Item;
import bnymellon.codekatas.coffeeshopkata.newjavafeatures.Item;

public interface Beverage extends Item
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

package bnymellon.codekatas.coffeekata.beverage;
package bnymellon.codekatas.coffeeshopkata.newjavafeatures.beverage;

/**
* Prior to Java 15, a class was either declared as 'final' or left 'open,'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

package bnymellon.codekatas.coffeekata.beverage;
package bnymellon.codekatas.coffeeshopkata.newjavafeatures.beverage;

public enum DrinkTemperature
{
Expand Down
Loading

0 comments on commit 1e0850a

Please sign in to comment.