You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by ah...@apache.org on 2020/11/30 16:20:06 UTC

[isis] branch master updated: ISIS-2464: minor test cleanup

This is an automated email from the ASF dual-hosted git repository.

ahuber pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/isis.git


The following commit(s) were added to refs/heads/master by this push:
     new b881d02  ISIS-2464: minor test cleanup
b881d02 is described below

commit b881d02064bfc68662939ef159f2c21b6b22c78b
Author: Andi Huber <ah...@apache.org>
AuthorDate: Mon Nov 30 17:19:53 2020 +0100

    ISIS-2464: minor test cleanup
---
 .../apache/isis/testdomain/factory/ViewModelFactoryTest.java  | 11 ++++-------
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/regressiontests/stable/src/test/java/org/apache/isis/testdomain/factory/ViewModelFactoryTest.java b/regressiontests/stable/src/test/java/org/apache/isis/testdomain/factory/ViewModelFactoryTest.java
index b0d2f1b..31fb69a 100644
--- a/regressiontests/stable/src/test/java/org/apache/isis/testdomain/factory/ViewModelFactoryTest.java
+++ b/regressiontests/stable/src/test/java/org/apache/isis/testdomain/factory/ViewModelFactoryTest.java
@@ -18,6 +18,7 @@
  */
 package org.apache.isis.testdomain.factory;
 
+import static org.junit.jupiter.api.Assertions.assertEquals;
 import static org.junit.jupiter.api.Assertions.assertTrue;
 
 import javax.inject.Inject;
@@ -48,7 +49,7 @@ class ViewModelFactoryTest extends IsisIntegrationTestAbstract {
     // -- VIEW MODEL SAMPLES
     
     @DomainObject(nature = Nature.VIEW_MODEL)
-    public static class SampleViewModel {
+    public static class SimpleViewModel {
         @Inject private RepositoryService repository;
         
         public boolean areInjectionPointsResolved() {
@@ -66,17 +67,13 @@ class ViewModelFactoryTest extends IsisIntegrationTestAbstract {
         public boolean areInjectionPointsResolved() {
             return repository!=null;
         }
-        
-        public boolean isNameInitialized() {
-            return name!=null;
-        }
     }
     
     // -- TESTS
     
     @Test
     void sampleViewModel_shouldHave_injectionPointsResolved() {
-        val sampleViewModel = factoryService.viewModel(new SampleViewModel());
+        val sampleViewModel = factoryService.viewModel(SimpleViewModel.class);
 
         assertTrue(sampleViewModel.areInjectionPointsResolved());
     }
@@ -86,7 +83,7 @@ class ViewModelFactoryTest extends IsisIntegrationTestAbstract {
         val advancedViewModel = factoryService.viewModel(new AdvancedViewModel("aName"));
         
         assertTrue(advancedViewModel.areInjectionPointsResolved());
-        assertTrue(advancedViewModel.isNameInitialized());
+        assertEquals("aName", advancedViewModel.getName());
     }