You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by da...@apache.org on 2021/10/01 06:05:46 UTC
[isis-app-demo] branch main updated (87563e8 -> c536780)
This is an automated email from the ASF dual-hosted git repository.
danhaywood pushed a change to branch main
in repository https://gitbox.apache.org/repos/asf/isis-app-demo.git.
from 87563e8 updatesPetOwner_persona fixture script with better lastName examples
new 0ccb1eb adds firstName as parameter to PetOwner#updateName
new c536780 adds default for new parameter of PetOwner#updateName
The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails. The revisions
listed as "add" were already present in the repository and have only
been added to this reference.
Summary of changes:
.../java/petclinic/modules/pets/dom/petowner/PetOwner_Test.java | 2 +-
.../modules/pets/integtests/tests/PetOwner_IntegTest.java | 4 ++--
.../main/java/petclinic/modules/pets/dom/petowner/PetOwner.java | 9 +++++++--
.../java/petclinic/webapp/integtests/smoke/Smoke_IntegTest.java | 4 ++--
4 files changed, 12 insertions(+), 7 deletions(-)
[isis-app-demo] 02/02: adds default for new parameter of
PetOwner#updateName
Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
danhaywood pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/isis-app-demo.git
commit c5367807450879cde0ae419df7408419a28a18a9
Author: Dan Haywood <da...@haywood-associates.co.uk>
AuthorDate: Fri Oct 1 07:04:30 2021 +0100
adds default for new parameter of PetOwner#updateName
---
.../src/main/java/petclinic/modules/pets/dom/petowner/PetOwner.java | 3 +++
1 file changed, 3 insertions(+)
diff --git a/module-pets/src/main/java/petclinic/modules/pets/dom/petowner/PetOwner.java b/module-pets/src/main/java/petclinic/modules/pets/dom/petowner/PetOwner.java
index e9f7aa8..0b05f17 100644
--- a/module-pets/src/main/java/petclinic/modules/pets/dom/petowner/PetOwner.java
+++ b/module-pets/src/main/java/petclinic/modules/pets/dom/petowner/PetOwner.java
@@ -134,6 +134,9 @@ public class PetOwner implements Comparable<PetOwner> {
public String default0UpdateName() {
return getLastName();
}
+ public String default1UpdateName() {
+ return getFirstName();
+ }
public String validate0UpdateName(String newName) {
for (char prohibitedCharacter : "&%$!".toCharArray()) {
if( newName.contains(""+prohibitedCharacter)) {
[isis-app-demo] 01/02: adds firstName as parameter to
PetOwner#updateName
Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.
danhaywood pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/isis-app-demo.git
commit 0ccb1eb4d578113629fd92bf43a2058f6366e41f
Author: Dan Haywood <da...@haywood-associates.co.uk>
AuthorDate: Fri Oct 1 07:04:15 2021 +0100
adds firstName as parameter to PetOwner#updateName
---
.../java/petclinic/modules/pets/dom/petowner/PetOwner_Test.java | 2 +-
.../petclinic/modules/pets/integtests/tests/PetOwner_IntegTest.java | 4 ++--
.../src/main/java/petclinic/modules/pets/dom/petowner/PetOwner.java | 6 ++++--
.../java/petclinic/webapp/integtests/smoke/Smoke_IntegTest.java | 4 ++--
4 files changed, 9 insertions(+), 7 deletions(-)
diff --git a/module-pets-tests/src/test/java/petclinic/modules/pets/dom/petowner/PetOwner_Test.java b/module-pets-tests/src/test/java/petclinic/modules/pets/dom/petowner/PetOwner_Test.java
index 5cc3830..a153ab0 100644
--- a/module-pets-tests/src/test/java/petclinic/modules/pets/dom/petowner/PetOwner_Test.java
+++ b/module-pets-tests/src/test/java/petclinic/modules/pets/dom/petowner/PetOwner_Test.java
@@ -41,7 +41,7 @@ class PetOwner_Test {
assertThat(object.getLastName()).isEqualTo("Foo");
// when
- object.updateName("Bar");
+ object.updateName("Bar", null);
// then
assertThat(object.getLastName()).isEqualTo("Bar");
diff --git a/module-pets-tests/src/test/java/petclinic/modules/pets/integtests/tests/PetOwner_IntegTest.java b/module-pets-tests/src/test/java/petclinic/modules/pets/integtests/tests/PetOwner_IntegTest.java
index ca51bb1..34135be 100644
--- a/module-pets-tests/src/test/java/petclinic/modules/pets/integtests/tests/PetOwner_IntegTest.java
+++ b/module-pets-tests/src/test/java/petclinic/modules/pets/integtests/tests/PetOwner_IntegTest.java
@@ -60,7 +60,7 @@ public class PetOwner_IntegTest extends PetsModuleIntegTestAbstract {
public void can_be_updated_directly() {
// when
- wrap(petOwner).updateName("new name");
+ wrap(petOwner).updateName("new name", null);
transactionService.flushTransaction();
// then
@@ -74,7 +74,7 @@ public class PetOwner_IntegTest extends PetsModuleIntegTestAbstract {
InvalidException cause = assertThrows(InvalidException.class, ()->{
// when
- wrap(petOwner).updateName("new name!");
+ wrap(petOwner).updateName("new name!", null);
});
// then
diff --git a/module-pets/src/main/java/petclinic/modules/pets/dom/petowner/PetOwner.java b/module-pets/src/main/java/petclinic/modules/pets/dom/petowner/PetOwner.java
index 41d9a5e..e9f7aa8 100644
--- a/module-pets/src/main/java/petclinic/modules/pets/dom/petowner/PetOwner.java
+++ b/module-pets/src/main/java/petclinic/modules/pets/dom/petowner/PetOwner.java
@@ -125,8 +125,10 @@ public class PetOwner implements Comparable<PetOwner> {
@Action(semantics = IDEMPOTENT, commandPublishing = Publishing.ENABLED, executionPublishing = Publishing.ENABLED)
@ActionLayout(associateWith = "lastName", promptStyle = PromptStyle.INLINE)
public PetOwner updateName(
- @LastName final String name) {
- setLastName(name);
+ @LastName final String lastName,
+ @FirstName String firstName) {
+ setLastName(lastName);
+ setFirstName(firstName);
return this;
}
public String default0UpdateName() {
diff --git a/webapp-tests/src/test/java/petclinic/webapp/integtests/smoke/Smoke_IntegTest.java b/webapp-tests/src/test/java/petclinic/webapp/integtests/smoke/Smoke_IntegTest.java
index 8af6b77..4876a84 100644
--- a/webapp-tests/src/test/java/petclinic/webapp/integtests/smoke/Smoke_IntegTest.java
+++ b/webapp-tests/src/test/java/petclinic/webapp/integtests/smoke/Smoke_IntegTest.java
@@ -54,7 +54,7 @@ class Smoke_IntegTest extends WebAppIntegTestAbstract {
// when
- wrap(fred).updateName("Freddy");
+ wrap(fred).updateName("Freddy", null);
transactionService.flushTransaction();
// then
@@ -71,7 +71,7 @@ class Smoke_IntegTest extends WebAppIntegTestAbstract {
// when
Assertions.assertThrows(InvalidException.class, () -> {
- wrap(fred).updateName("New name !!!");
+ wrap(fred).updateName("New name !!!", null);
transactionService.flushTransaction();
}, "Exclamation mark is not allowed");