tomee-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jlmonte...@apache.org
Subject [2/7] tomee git commit: TOMEE-2334: implementation of test for nonAuthorized access.
Date Wed, 02 Jan 2019 09:59:14 GMT
TOMEE-2334: implementation of test for nonAuthorized access.


Project: http://git-wip-us.apache.org/repos/asf/tomee/repo
Commit: http://git-wip-us.apache.org/repos/asf/tomee/commit/d459c0a8
Tree: http://git-wip-us.apache.org/repos/asf/tomee/tree/d459c0a8
Diff: http://git-wip-us.apache.org/repos/asf/tomee/diff/d459c0a8

Branch: refs/heads/master
Commit: d459c0a80a9564dadce08a41f74490e2a110e8a4
Parents: 83a1a56
Author: cotnic <mitja@cotnic.com>
Authored: Mon Dec 31 21:06:34 2018 +0100
Committer: cotnic <mitja@cotnic.com>
Committed: Mon Dec 31 21:06:34 2018 +0100

----------------------------------------------------------------------
 .../src/test/java/org/superbiz/store/OrdersTest.java        | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tomee/blob/d459c0a8/examples/mp-rest-jwt-principal/src/test/java/org/superbiz/store/OrdersTest.java
----------------------------------------------------------------------
diff --git a/examples/mp-rest-jwt-principal/src/test/java/org/superbiz/store/OrdersTest.java
b/examples/mp-rest-jwt-principal/src/test/java/org/superbiz/store/OrdersTest.java
index 2768f64..5f47323 100644
--- a/examples/mp-rest-jwt-principal/src/test/java/org/superbiz/store/OrdersTest.java
+++ b/examples/mp-rest-jwt-principal/src/test/java/org/superbiz/store/OrdersTest.java
@@ -19,10 +19,10 @@ package org.superbiz.store;
 import org.eclipse.microprofile.rest.client.inject.RestClient;
 import org.jboss.arquillian.container.test.api.Deployment;
 import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.arquillian.test.spi.ArquillianProxyException;
 import org.jboss.shrinkwrap.api.ShrinkWrap;
 import org.jboss.shrinkwrap.api.asset.StringAsset;
 import org.jboss.shrinkwrap.api.spec.WebArchive;
-import org.junit.Ignore;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.superbiz.store.entity.Order;
@@ -124,12 +124,9 @@ public class OrdersTest {
         assertEquals(Response.Status.NO_CONTENT.getStatusCode(), statusCode);
     }
 
-    @Test
-    @Ignore
+    @Test(expected = ArquillianProxyException.class)
     public void shouldNotHaveAccess() throws Exception {
-        int statusCode = orderRestClient.deleteOrder("Bearer " + createJwtToken(false), 1).getStatus();
-
-        assertEquals(Response.Status.FORBIDDEN.getStatusCode(), statusCode);
+        orderRestClient.deleteOrder("Bearer " + createJwtToken(false), 1).getStatus();
     }
 
     public String createJwtToken(boolean john) throws Exception {


Mime
View raw message