Skip to content

Commit

Permalink
format details +2.
Browse files Browse the repository at this point in the history
  • Loading branch information
damonxue committed Sep 10, 2023
1 parent 2e95d83 commit e6a2521
Show file tree
Hide file tree
Showing 12 changed files with 30 additions and 39 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.mockito.Mockito.mock;
import static org.easymock.EasyMock.verify;
import static org.mockito.Mockito.verify;

/**
* Test cases for the {@link SubjectAwareExecutor} implementation.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ public AnnotatedTypeWrapper(AnnotatedType<T> wrapped, boolean keepOriginalAnnota

@Override
public boolean isAnnotationPresent(Class<? extends Annotation> annotationType) {
return annotations.stream().anyMatch(annotation -> annotationType.isInstance(annotation));
return annotations.stream().anyMatch(annotationType::isInstance);
}

private void addToBuilder(Stream.Builder<Annotation> builder, Annotation ann) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,26 +13,24 @@
*/
package org.apache.shiro.cdi;

import java.lang.annotation.Annotation;
import java.util.List;
import javax.validation.constraints.NotNull;

import lombok.SneakyThrows;
import org.apache.shiro.authz.annotation.RequiresAuthentication;
import org.apache.shiro.authz.annotation.RequiresUser;
import org.apache.shiro.authz.aop.AuthenticatedAnnotationHandler;
import org.apache.shiro.authz.aop.UserAnnotationHandler;
import org.apache.shiro.cdi.AopHelper.SecurityInterceptor;
import org.junit.jupiter.api.Test;

import javax.validation.constraints.NotNull;
import java.lang.annotation.Annotation;
import java.util.List;

import static org.apache.shiro.cdi.AopHelper.autorizationAnnotationClasses;
import static org.junit.jupiter.api.Assertions.assertEquals;

import org.junit.jupiter.api.Test;

import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.mockConstruction;
import static org.mockito.Mockito.times;
import static org.easymock.EasyMock.verify;
import static org.mockito.Mockito.verify;

/**
* AOP Helper unit test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
import static org.junit.jupiter.api.Assertions.assertSame;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.mockito.Mockito.mock;
import static org.easymock.EasyMock.verify;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@

/**
* Stops JEE server from interpreting Shiro principal as direct EJB principal,
* this has sideffects of trying to log in to remote EJBs with the credentials from Shiro,
* this has error effects of trying to log in to remote EJBs with the credentials from Shiro,
* which isn't what this meant to do, as it's meant to just transfer Shiro credentials
* to remote EJB call site.
* <p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,43 +13,37 @@
*/
package org.apache.shiro.ee.cdi;

import static org.apache.shiro.ee.cdi.ShiroScopeContext.isWebContainerSessions;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.web.mgt.WebSecurityManager;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.mockito.Answers;
import org.mockito.Mock;
import org.mockito.MockedStatic;
import org.mockito.junit.jupiter.MockitoExtension;

import java.io.Serializable;
import java.lang.annotation.Annotation;
import javax.enterprise.context.SessionScoped;
import javax.enterprise.context.spi.CreationalContext;
import javax.enterprise.inject.spi.Bean;
import javax.enterprise.inject.spi.CDI;
import javax.faces.view.ViewScoped;
import java.io.Serializable;
import java.lang.annotation.Annotation;

import org.apache.shiro.SecurityUtils;
import org.apache.shiro.web.mgt.WebSecurityManager;
import org.junit.jupiter.api.AfterEach;

import static org.apache.shiro.ee.cdi.ShiroScopeContext.isWebContainerSessions;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNull;
import static org.junit.jupiter.api.Assertions.assertTrue;

import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
import org.mockito.Answers;

import static org.mockito.ArgumentMatchers.any;

import org.mockito.Mock;
import org.mockito.MockedStatic;

import static org.mockito.Mockito.atLeast;
import static org.mockito.Mockito.lenient;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.mockStatic;
import static org.easymock.EasyMock.verify;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;

import org.mockito.junit.jupiter.MockitoExtension;

/**
* Shiro Scope override tests
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
import static org.hamcrest.Matchers.stringContainsInOrder;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.spy;
import static org.easymock.EasyMock.verify;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,9 @@
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.mockito.Mockito.mock;
import static org.easymock.EasyMock.verify;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;


/**
* Test case for {@link BasicHttpAuthenticationFilter}.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@

import static org.mockito.Mockito.atLeastOnce;
import static org.mockito.Mockito.mock;
import static org.easymock.EasyMock.verify;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
import static org.junit.jupiter.api.Assertions.assertNull;
import static org.junit.jupiter.api.Assertions.assertTrue;
import static org.mockito.Mockito.mock;
import static org.easymock.EasyMock.verify;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
import static org.junit.jupiter.api.Assertions.fail;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.mock;
import static org.easymock.EasyMock.verify;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
import static org.mockito.Mockito.atLeast;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.times;
import static org.easymock.EasyMock.verify;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;

public class ShiroHttpServletRequestTest {
Expand Down

0 comments on commit e6a2521

Please sign in to comment.