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/05/14 05:31:49 UTC

[isis] branch ISIS-2619 updated: ISIS-2619: fixes unit test

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

danhaywood pushed a commit to branch ISIS-2619
in repository https://gitbox.apache.org/repos/asf/isis.git


The following commit(s) were added to refs/heads/ISIS-2619 by this push:
     new 04104d4  ISIS-2619: fixes unit test
04104d4 is described below

commit 04104d45023783d27533e2c9a70b4ad0988bc7d0
Author: danhaywood <da...@haywood-associates.co.uk>
AuthorDate: Fri May 14 06:31:27 2021 +0100

    ISIS-2619: fixes unit test
---
 .../service/swagger/internal/TaggerTest.java       | 22 +++++++++++++++-------
 1 file changed, 15 insertions(+), 7 deletions(-)

diff --git a/viewers/restfulobjects/rendering/src/test/java/org/apache/isis/viewer/restfulobjects/rendering/service/swagger/internal/TaggerTest.java b/viewers/restfulobjects/rendering/src/test/java/org/apache/isis/viewer/restfulobjects/rendering/service/swagger/internal/TaggerTest.java
index d95bbd8..b849961 100644
--- a/viewers/restfulobjects/rendering/src/test/java/org/apache/isis/viewer/restfulobjects/rendering/service/swagger/internal/TaggerTest.java
+++ b/viewers/restfulobjects/rendering/src/test/java/org/apache/isis/viewer/restfulobjects/rendering/service/swagger/internal/TaggerTest.java
@@ -18,6 +18,7 @@
  */
 package org.apache.isis.viewer.restfulobjects.rendering.service.swagger.internal;
 
+import org.junit.Before;
 import org.junit.Test;
 
 import static org.hamcrest.CoreMatchers.equalTo;
@@ -26,42 +27,49 @@ import static org.hamcrest.MatcherAssert.assertThat;
 
 public class TaggerTest {
 
+    TaggerDefault taggerDefault;
+
+    @Before
+    public void setUp() throws Exception {
+        taggerDefault = taggerDefault;
+    }
+
     public static class TagFor extends TaggerTest {
 
         @Test
         public void fullyQualifiedClass() throws Exception {
-            String tag = new TaggerDefault().tagForObjectType("foo.bar.Abc", null);
+            String tag = taggerDefault.tagForObjectType("foo.bar.Abc", null);
             assertThat(tag, is(equalTo("bar")));
         }
 
         @Test
         public void jaxb() throws Exception {
-            String tag = new TaggerDefault().tagForObjectType("todoapp.app.viewmodels.todoitem.v1_0.ToDoItemDto", null);
+            String tag = taggerDefault.tagForObjectType("todoapp.app.viewmodels.todoitem.v1_0.ToDoItemDto", null);
             assertThat(tag, is(equalTo("todoitem")));
         }
 
         @Test
         public void schemaClass() throws Exception {
-            String tag = new TaggerDefault().tagForObjectType("bar.Abc", null);
+            String tag = taggerDefault.tagForObjectType("bar.Abc", null);
             assertThat(tag, is(equalTo("bar")));
         }
 
         @Test
         public void noPackage() throws Exception {
-            String tag = new TaggerDefault().tagForObjectType("Abc", null);
+            String tag = taggerDefault.tagForObjectType("Abc", null);
             assertThat(tag, is(equalTo("Abc")));
         }
 
         @Test
         public void internals() throws Exception {
-            String tag = new TaggerDefault().tagForObjectType("org.apache.isis.applib.fixturescripts.FixtureResult", null);
+            String tag = taggerDefault.tagForObjectType("org.apache.isis.Xxx", null);
             assertThat(tag, is(equalTo(". apache isis internals")));
         }
 
         @Test
         public void applib() throws Exception {
-            String tag = new TaggerDefault().tagForObjectType("isis.conf.ConfigurationServiceMenu", null);
-            assertThat(tag, is(equalTo(". apache isis applib")));
+            String tag = taggerDefault.tagForObjectType("isis.conf.ConfigurationServiceMenu", null);
+            assertThat(tag, is(equalTo(". apache isis conf")));
         }
 
     }