Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
java: [ '8', '11', '16','17','18' ]
java: [ '8', '11', '17', '19' ]
os: [ 'ubuntu-latest', 'macos-latest', 'windows-latest' ]
steps:
- uses: actions/checkout@v3
Expand Down Expand Up @@ -93,7 +93,7 @@ jobs:
file: ./openam-distribution/openam-distribution-docker/Dockerfile
build-args: |
VERSION=${{ env.release_version }}
platforms: linux/amd64,linux/arm64/8
platforms: linux/amd64, linux/arm64/8, linux/arm/v7, linux/ppc64le
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
Expand Down
2 changes: 1 addition & 1 deletion openam-distribution/openam-distribution-docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM tomcat:9.0-jre8-openjdk
FROM tomcat:9-jre8

MAINTAINER Open Identity Platform Community <open-identity-platform-openam@googlegroups.com>

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM tomcat:9.0-jre8-alpine
FROM tomcat:9-jre8-alpine

MAINTAINER Open Identity Platform Community <open-identity-platform-openam@googlegroups.com>

Expand Down
11 changes: 1 addition & 10 deletions openam-entitlements/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -87,33 +87,24 @@
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-all</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-module-testng</artifactId>
<version>1.7.4</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-core</artifactId>
<version>1.7.4</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-module-junit4</artifactId>
<version>1.7.4</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-api-mockito</artifactId>
<version>1.7.4</version>
<artifactId>powermock-api-mockito2</artifactId>
<scope>test</scope>
</dependency>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,8 @@ public void setUp() throws EntitlementException {

// Given (shared test state)

given(pmFactory.createReferralPrivilegeManager(eq(ROOT_REALM), any(Subject.class))).willReturn(pm);
given(applicationServiceFactory.create(any(Subject.class), anyString())).willReturn(applicationService);
given(pmFactory.createReferralPrivilegeManager(eq(ROOT_REALM), any())).willReturn(pm);
given(applicationServiceFactory.create(any(), anyString())).willReturn(applicationService);
given(applicationService.getApplication(anyString())).willReturn(application);
given(application.getResourceComparator()).willReturn(urlResourceName);
given(urlResourceName.compare(anyString(), anyString(), anyBoolean())).willReturn(ResourceMatch.EXACT_MATCH);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ private void setupServiceConfigMock(Set<String> names) throws SMSException, SSOE
Map<String, Set<String>> attributes = new HashMap<>();
attributes.put("name", names);
when(subSubServiceConfig.getAttributes()).thenReturn(attributes);
when(resourceTypeServiceConfig.getOrgConfig(any(Subject.class), anyString())).thenReturn(serviceConfig);
when(resourceTypeServiceConfig.getOrgConfig(any(), anyString())).thenReturn(serviceConfig);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public void setUp() throws Exception {
debug = mock(Debug.class);
applicationServiceFactory = mock(ApplicationServiceFactory.class);
applicationService = mock(ApplicationService.class);
when(applicationServiceFactory.create(any(Subject.class), anyString())).thenReturn(applicationService);
when(applicationServiceFactory.create(any(), anyString())).thenReturn(applicationService);
applicationTypeManagerWrapper = mock(ApplicationTypeManagerWrapper.class);
applicationWrapper = mock(ApplicationWrapper.class);
realmTestHelper = new RealmTestHelper();
Expand Down Expand Up @@ -215,7 +215,7 @@ public void shouldThrowInternalErrorIfResourceWillNotSave() throws EntitlementEx
Subject subject = new Subject();
given(mockSSOTokenContext.getCallerSubject()).willReturn(subject);
given(applicationWrapper.getName()).willReturn("newApplication");
doThrow(new EntitlementException(1)).when(applicationService).saveApplication(any(Application.class));
doThrow(new EntitlementException(1)).when(applicationService).saveApplication(any());

//when
Promise<ResourceResponse, ResourceException> result =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ public void testImportXACMLNoPolicies() throws Exception {
InputStream is = new ByteArrayInputStream("Hello World".getBytes());
doReturn(is).when(representation).getStream();
doReturn(Collections.emptyList()).
when(importExport).importXacml(eq("/"), eq(is), any(Subject.class), eq(false));
when(importExport).importXacml(eq("/"), eq(is), any(), eq(false));

try {
//when
Expand All @@ -237,7 +237,7 @@ public void testImportXACMLNoPolicies() throws Exception {
fail("Expect exception");
} catch (ResourceException e) {
assertThat(e.getStatus().getCode()).isEqualTo(BAD_REQUEST);
assertThat(e.getMessage()).isEqualTo("No policies found in XACML document");
assertThat(e.getMessage()).startsWith("No policies found in XACML document");
}
}

Expand All @@ -248,7 +248,7 @@ public void testImportXACMLImportFailure() throws Exception {
InputStream is = new ByteArrayInputStream("Hello World".getBytes());
doReturn(is).when(representation).getStream();
EntitlementException failure = new EntitlementException(EntitlementException.JSON_PARSE_ERROR);
doThrow(failure).when(importExport).importXacml(eq("/"), eq(is), any(Subject.class), eq(false));
doThrow(failure).when(importExport).importXacml(eq("/"), eq(is), any(), eq(false));

try {
//when
Expand All @@ -258,7 +258,7 @@ public void testImportXACMLImportFailure() throws Exception {
fail("Expect exception");
} catch (ResourceException e) {
assertThat(e.getStatus().getCode()).isEqualTo(BAD_REQUEST);
assertThat(e.getMessage()).isEqualTo("JSON Exception.");
assertThat(e.getMessage()).startsWith("JSON Exception.");
}
}

Expand Down Expand Up @@ -337,7 +337,7 @@ public void testDispositionOfSubSubRealmExport() throws Exception {
public void testExportXACMLEntitlementException() throws Exception {
//given
EntitlementException ee = new EntitlementException(EntitlementException.JSON_PARSE_ERROR);
doThrow(ee).when(importExport).exportXACML(eq("/"), any(Subject.class), any(List.class));
doThrow(ee).when(importExport).exportXACML(eq("/"), any(), any());

try {
//when
Expand All @@ -347,7 +347,7 @@ public void testExportXACMLEntitlementException() throws Exception {
fail("Expect exception");
} catch (ResourceException e) {
assertThat(e.getStatus().getCode()).isEqualTo(INTERNAL_ERROR);
assertThat(e.getMessage()).isEqualTo("JSON Exception.");
assertThat(e.getMessage()).startsWith("JSON Exception.");
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
mock-maker-inline
19 changes: 15 additions & 4 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
<ant.contrib.version>1.0b3</ant.contrib.version>
<guice.version>3.0</guice.version>
<restlet.version>2.4.0</restlet.version>
<powermock.version>2.0.0-RC.4</powermock.version>
<powermock.version>2.0.9</powermock.version>
<!-- <slf4j.version>1.7.25</slf4j.version> -->
<click.version>2.3.0</click.version>
<commons-beanutils.version>1.9.4</commons-beanutils.version>
Expand Down Expand Up @@ -1226,13 +1226,13 @@
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-jsr223</artifactId>
<version>3.0.10</version>
<version>3.0.13</version>
</dependency>
<!-- Groovy JSON parsing support -->
<dependency>
<groupId>org.codehaus.groovy</groupId>
<artifactId>groovy-json</artifactId>
<version>3.0.10</version>
<version>3.0.13</version>
</dependency>
<dependency>
<!-- MIT licensed: http://groovy-sandbox.kohsuke.org/license.html -->
Expand Down Expand Up @@ -1711,6 +1711,12 @@
<scope>test</scope>
</dependency>
<!-- Powermock -->
<dependency>
<groupId>net.bytebuddy</groupId>
<artifactId>byte-buddy</artifactId>
<version>1.12.19</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-api-support</artifactId>
Expand Down Expand Up @@ -1834,7 +1840,12 @@
<artifactId>joda-time</artifactId>
<version>2.10.5</version>
</dependency>

<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>6.14.3</version>
<scope>test</scope>
</dependency>
<!-- Cassandra dependencies -->
<dependency>
<groupId>org.openidentityplatform.openam</groupId>
Expand Down