Java 11 migration: ambassador async-method-invocation balking bridge builder (#1076)

* Moves ambassador pattern to java 11

* Moves async-method-invocation pattern  to java 11

* Moves balking pattern  to java 11

* Moves bridge pattern  to java 11

* Moves builder pattern  to java 11
This commit is contained in:
Anurag Agarwal
2019-11-12 01:17:09 +05:30
committed by Ilkka Seppälä
parent f0f0143d48
commit c4418311c6
27 changed files with 173 additions and 176 deletions
@@ -26,15 +26,11 @@ package com.iluwatar.builder;
import org.junit.jupiter.api.Test;
/**
*
* Application test
*
*/
public class AppTest {
class AppTest {
@Test
public void test() {
String[] args = {};
App.main(args);
void test() {
App.main(new String[]{});
}
}
@@ -23,24 +23,24 @@
package com.iluwatar.builder;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertThrows;
import org.junit.jupiter.api.Test;
/**
* Date: 12/6/15 - 11:01 PM
*
* @author Jeroen Meulemeester
*/
public class HeroTest {
class HeroTest {
/**
* Test if we get the expected exception when trying to create a hero without a profession
*/
@Test
public void testMissingProfession() throws Exception {
void testMissingProfession() {
assertThrows(IllegalArgumentException.class, () -> new Hero.Builder(null, "Sir without a job"));
}
@@ -48,7 +48,7 @@ public class HeroTest {
* Test if we get the expected exception when trying to create a hero without a name
*/
@Test
public void testMissingName() throws Exception {
void testMissingName() {
assertThrows(IllegalArgumentException.class, () -> new Hero.Builder(Profession.THIEF, null));
}
@@ -56,10 +56,10 @@ public class HeroTest {
* Test if the hero build by the builder has the correct attributes, as requested
*/
@Test
public void testBuildHero() throws Exception {
void testBuildHero() {
final String heroName = "Sir Lancelot";
final Hero hero = new Hero.Builder(Profession.WARRIOR, heroName)
final var hero = new Hero.Builder(Profession.WARRIOR, heroName)
.withArmor(Armor.CHAIN_MAIL)
.withWeapon(Weapon.SWORD)
.withHairType(HairType.LONG_CURLY)