Skip to content

Commit

Permalink
- upgrade of testing libraries
Browse files Browse the repository at this point in the history
- removing jakarta servlet-api incompatible profiles
- version bump to 9.0.0? should we use 23.x to make it easier to follow alfresco versions?
  • Loading branch information
dgradecak committed Nov 30, 2023
1 parent b343d51 commit 9ab1dbd
Show file tree
Hide file tree
Showing 9 changed files with 27 additions and 108 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@ local
*.log
*.log.*

private-key.gpg
private-key.gpg
*.factorypath
2 changes: 1 addition & 1 deletion alfresco-mvc-aop/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<parent>
<groupId>com.gradecak.alfresco-mvc</groupId>
<version>8.0.0</version>
<version>9.0.0</version>
<artifactId>alfresco-mvc-parent</artifactId>
<relativePath>../</relativePath>
</parent>
Expand Down
2 changes: 1 addition & 1 deletion alfresco-mvc-aop/src/test/resources/test-aop-context.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<context:property-placeholder location="values.properties" />

<bean id="ServiceRegistry" class="org.mockito.Mockito" factory-method="mock">
<constructor-arg value="org.alfresco.service.ServiceRegistry" />
<constructor-arg value="org.alfresco.service.ServiceRegistry" type="java.lang.Class"/>
</bean>

<import resource="classpath:com/gradecak/alfresco-mvc/alfresco-mvc-aop.xml" />
Expand Down
2 changes: 1 addition & 1 deletion alfresco-mvc-bom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

<parent>
<groupId>com.gradecak.alfresco-mvc</groupId>
<version>8.0.0</version>
<version>9.0.0</version>
<artifactId>alfresco-mvc-parent</artifactId>
<relativePath>../</relativePath>
</parent>
Expand Down
2 changes: 1 addition & 1 deletion alfresco-mvc-rest/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

<parent>
<groupId>com.gradecak.alfresco-mvc</groupId>
<version>8.0.0</version>
<version>9.0.0</version>
<artifactId>alfresco-mvc-parent</artifactId>
<relativePath>../</relativePath>
</parent>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,17 +80,4 @@ public void when_alfrescoMvcDispatcherServletConfigOptionsWithSuffix_expect_suff
String contentAsString = res.getContentAsString();
Assertions.assertEquals("withsufix", contentAsString);
}
//
// @Test
// public void when_alfrescoMvcDispatcherServletConfigOptionsWithoutSuffix_expect_ok() throws Exception {
// DispatcherServlet dispatcherServlet = dispatcherWebscript.getDispatcherServlet().getWebApplicationContext()
// .getBean(DispatcherServlet.class);
// Assertions.assertNotNull(dispatcherServlet);
//
// MockHttpServletResponse res = mockWebscript.withControllerMapping("/test/withoutsufix").execute();
// Assertions.assertEquals(HttpStatus.OK.value(), res.getStatus());
//
// String contentAsString = res.getContentAsString();
// Assertions.assertEquals("withoutsufix", contentAsString);
// }
}
Original file line number Diff line number Diff line change
Expand Up @@ -59,28 +59,6 @@ public void before() throws Exception {
mockWebscript.newRequest();
}

/**
* @deprecated as of Spring 5.2.4. See class-level note in
* {@link RequestMappingHandlerMapping} on the deprecation of path
* extension config options. As there is no replacement for this
* method, in Spring 5.2.x it is necessary to set it to
* {@code false}. In Spring 5.3 the default changes to {@code false}
* and use of this property becomes unnecessary.
*/
// @Deprecated
// @Test
// public void when_alfrescoMvcDispatcherServletConfigOptionsWithSuffix_expect_suffixHandledAndOk() throws Exception {
// DispatcherServlet dispatcherServlet = dispatcherWebscript.getDispatcherServlet().getWebApplicationContext()
// .getBean(DispatcherServlet.class);
// Assertions.assertNotNull(dispatcherServlet);
//
// MockHttpServletResponse res = mockWebscript.withControllerMapping("/test/withsufix.test").execute();
// Assertions.assertEquals(HttpStatus.OK.value(), res.getStatus());
//
// String contentAsString = res.getContentAsString();
// Assertions.assertEquals("withsufix", contentAsString);
// }

@Test
public void when_alfrescoMvcDispatcherServletConfigOptionsWithoutSuffix_expect_ok() throws Exception {
DispatcherServlet dispatcherServlet = dispatcherWebscript.getDispatcherServlet().getWebApplicationContext()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,16 @@
</bean>

<bean id="ServiceRegistry" class="org.mockito.Mockito" factory-method="mock">
<constructor-arg value="org.alfresco.service.ServiceRegistry" />
<constructor-arg value="org.alfresco.service.ServiceRegistry" type="java.lang.Class"/>
</bean>

<bean id="NamespaceService" class="org.mockito.Mockito" factory-method="mock">
<constructor-arg value="org.alfresco.service.namespace.NamespaceService" />
<constructor-arg value="org.alfresco.service.namespace.NamespaceService" type="java.lang.Class"/>
</bean>


<bean id="webscriptHelper" class="org.mockito.Mockito" factory-method="mock">
<constructor-arg value="org.alfresco.rest.framework.webscripts.ResourceWebScriptHelper" />
<constructor-arg value="org.alfresco.rest.framework.webscripts.ResourceWebScriptHelper" type="java.lang.Class"/>
</bean>

<!-- bean class="org.springframework.mock.web.MockServletContext" id="mockServletContext" />
Expand Down
83 changes: 18 additions & 65 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

<modelVersion>4.0.0</modelVersion>

<groupId>com.gradecak.alfresco-mvc</groupId>
<version>8.0.0</version>
<version>9.0.0</version>
<artifactId>alfresco-mvc-parent</artifactId>
<packaging>pom</packaging>

Expand Down Expand Up @@ -40,9 +42,8 @@
<maven.compiler.target>17</maven.compiler.target>
<maven.build.sourceVersion>17</maven.build.sourceVersion>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<dependency.jakarta.servlet-api.version>6.0.0</dependency.jakarta.servlet-api.version>
<dependency.mockito.version>4.8.1</dependency.mockito.version>
<dependency.junit-jupiter.version>5.9.1</dependency.junit-jupiter.version>
<dependency.mockito.version>5.7.0</dependency.mockito.version>
<dependency.junit-jupiter.version>5.10.1</dependency.junit-jupiter.version>
</properties>

<modules>
Expand All @@ -62,6 +63,15 @@
<optional>true</optional>
</dependency>

<dependency>
<groupId>org.alfresco</groupId>
<artifactId>alfresco-community-repo</artifactId>
<version>${dependency.alfresco-community-repo.version}</version>
<type>pom</type>
<scope>import</scope>
<optional>true</optional>
</dependency>

<dependency>
<groupId>com.gradecak.alfresco-mvc</groupId>
<artifactId>alfresco-mvc-rest</artifactId>
Expand All @@ -76,32 +86,13 @@
<scope>compile</scope>
</dependency>

<dependency>
<groupId>jakarta.servlet</groupId>
<artifactId>jakarta.servlet-api</artifactId>
<version>${dependency.jakarta.servlet-api.version}</version>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>${dependency.mockito.version}</version>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<version>${dependency.spring-test.version}</version>
<scope>test</scope>
<exclusions>
<exclusion>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
Expand All @@ -118,7 +109,8 @@
</repository>
<repository>
<id>alfresco-public-snapshots</id>
<url>https://artifacts.alfresco.com/nexus/content/groups/public-snapshots</url>
<url>
https://artifacts.alfresco.com/nexus/content/groups/public-snapshots</url>
<snapshots>
<enabled>true</enabled>
<updatePolicy>daily</updatePolicy>
Expand Down Expand Up @@ -192,53 +184,14 @@
</build>

<profiles>
<profile>
<id>community-6.1.2-ga</id>
<properties>
<dependency.acs-community-packaging.version>6.1.2-ga</dependency.acs-community-packaging.version>
<dependency.spring-test.version>5.1.3.RELEASE</dependency.spring-test.version>
</properties>
</profile>

<profile>
<id>community-6.2.0-ga</id>
<properties>
<dependency.acs-community-packaging.version>6.2.0-ga</dependency.acs-community-packaging.version>
<dependency.spring-test.version>5.1.8.RELEASE</dependency.spring-test.version>
</properties>
</profile>

<profile>
<id>community-7.1.0.1</id>
<properties>
<dependency.acs-community-packaging.version>7.1.0.1</dependency.acs-community-packaging.version>
<dependency.spring-test.version>5.3.9</dependency.spring-test.version>
</properties>
</profile>

<profile>
<id>community-7.2.0</id>
<properties>
<dependency.acs-community-packaging.version>7.2.0</dependency.acs-community-packaging.version>
<dependency.spring-test.version>5.3.15</dependency.spring-test.version>
</properties>
</profile>

<profile>
<id>community-7.3.0</id>
<properties>
<dependency.acs-community-packaging.version>7.3.0</dependency.acs-community-packaging.version>
<dependency.spring-test.version>5.3.23</dependency.spring-test.version>
</properties>
</profile>
<profile>
<id>community-23.1.0</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<properties>
<dependency.acs-community-packaging.version>23.1.0</dependency.acs-community-packaging.version>
<dependency.spring-test.version>6.1.0</dependency.spring-test.version>
<dependency.alfresco-community-repo.version>23.1.0.255</dependency.alfresco-community-repo.version>
</properties>
</profile>
</profiles>
Expand Down

0 comments on commit 9ab1dbd

Please sign in to comment.