Skip to content

Commit

Permalink
Issue #LR-740 chore: Upgraded the scala major version from 2.11 to 2.…
Browse files Browse the repository at this point in the history
…12 (#613)
  • Loading branch information
AmiableAnil authored Mar 20, 2024
1 parent fe809cc commit 6f731a7
Show file tree
Hide file tree
Showing 89 changed files with 452 additions and 2,632 deletions.
6 changes: 2 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,8 @@
version: 2.1
executorType: machine
jobs:
build:
docker:
- image: circleci/openjdk:14-jdk-buster-node-browsers-legacy
- image: circleci/redis:latest
machine:
image: ubuntu-2004:202201-02
steps:
- checkout
- restore_cache:
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.Build
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ ENV M2_HOME /opt/apache-maven-3.3.9
ENV PATH ${M2_HOME}/bin:${PATH}
COPY learner /opt/learner/
WORKDIR /opt/learner/services
RUN mvn clean install -DskipTests -DCLOUD_STORE_GROUP_ID=org.sunbird -DCLOUD_STORE_ARTIFACT_ID=cloud-store-sdk -DCLOUD_STORE_VERSION=1.4.6
RUN mvn clean install -DskipTests -DCLOUD_STORE_GROUP_ID=org.sunbird -DCLOUD_STORE_ARTIFACT_ID=cloud-store-sdk_2.12 -DCLOUD_STORE_VERSION=1.4.7
WORKDIR /opt/learner/services/learning-service
CMD ["mvn", "play2:dist"]
38 changes: 17 additions & 21 deletions course-mw/course-actors-common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<slf4j.version>1.6.1</slf4j.version>
<logback.version>1.0.7</logback.version>
</properties>
<dependencies>
<dependency>
Expand All @@ -26,6 +24,11 @@
<artifactId>logback-classic</artifactId>
<version>1.2.3</version>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-core</artifactId>
<version>1.2.3</version>
</dependency>
<dependency>
<groupId>joda-time</groupId>
<artifactId>joda-time</artifactId>
Expand All @@ -44,13 +47,13 @@
</dependency>
<dependency>
<groupId>com.typesafe.akka</groupId>
<artifactId>akka-actor_2.11</artifactId>
<version>2.5.22</version>
<artifactId>akka-actor_${scala.major.version}</artifactId>
<version>${typesafe.akka.version}</version>
</dependency>
<dependency>
<groupId>com.typesafe.akka</groupId>
<artifactId>akka-slf4j_2.11</artifactId>
<version>2.5.22</version>
<artifactId>akka-slf4j_${scala.major.version}</artifactId>
<version>${typesafe.akka.version}</version>
</dependency>
<dependency>
<groupId>org.sunbird</groupId>
Expand Down Expand Up @@ -80,37 +83,30 @@
</dependency>
<dependency>
<groupId>com.typesafe.akka</groupId>
<artifactId>akka-testkit_2.11</artifactId>
<version>2.5.22</version>
<artifactId>akka-testkit_${scala.major.version}</artifactId>
<version>${typesafe.akka.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>2.10.1</version>
<version>${jackson.version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.10.1</version>
</dependency>
<!-- https://mvnrepository.com/artifact/org.powermock/powermock-api-easymock -->
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>${mockito.core.version}</version>
<scope>test</scope>
<version>${jackson.version}</version>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-api-mockito2</artifactId>
<version>${powermock.api.mockito2.version}</version>
<version>${powermock.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-module-junit4</artifactId>
<version>${powermock.module.junit4.version}</version>
<version>${powermock.version}</version>
<scope>test</scope>
</dependency>

Expand Down Expand Up @@ -163,7 +159,7 @@
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.5</version>
<version>${jacoco-maven-plugin.version}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand All @@ -176,7 +172,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0-M4</version>
<version>3.0.0</version>
<configuration>
<!-- <skipTests>true</skipTests> -->
<includes>
Expand Down
30 changes: 13 additions & 17 deletions course-mw/course-actors/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,21 @@
</parent>
<artifactId>course-actors</artifactId>
<name>Course</name>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>1.2.3</version>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-core</artifactId>
<version>1.2.3</version>
</dependency>
<dependency>
<groupId>net.logstash.logback</groupId>
<artifactId>logstash-logback-encoder</artifactId>
<version>6.3</version>
<version>6.6</version>
</dependency>
<dependency>
<groupId>org.sunbird</groupId>
Expand All @@ -32,32 +34,26 @@
</dependency>
<dependency>
<groupId>com.typesafe.akka</groupId>
<artifactId>akka-testkit_2.11</artifactId>
<version>2.5.22</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>${mockito.core.version}</version>
<artifactId>akka-testkit_${scala.major.version}</artifactId>
<version>${typesafe.akka.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-api-mockito2</artifactId>
<version>${powermock.api.mockito2.version}</version>
<version>${powermock.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.powermock</groupId>
<artifactId>powermock-module-junit4</artifactId>
<version>${powermock.module.junit4.version}</version>
<version>${powermock.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.javassist</groupId>
<artifactId>javassist</artifactId>
<version>3.24.1-GA</version>
<version>3.30.2-GA</version>
</dependency>
</dependencies>
<build>
Expand All @@ -67,7 +63,7 @@
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.5</version>
<version>${jacoco-maven-plugin.version}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand All @@ -80,7 +76,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0-M4</version>
<version>3.0.0</version>
<configuration>
<!-- <skipTests>true</skipTests> -->
<includes>
Expand Down
14 changes: 8 additions & 6 deletions course-mw/enrolment-actor/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,18 @@
<artifactId>enrolment-actor</artifactId>
<version>1.0-SNAPSHOT</version>
<properties>
<scala.version>2.11.12</scala.version>
<scala.major.version>2.11</scala.major.version>
<scala.major.version>2.12</scala.major.version>
<scala.version>2.12.11</scala.version>
<typesafe.akka.version>2.5.22</typesafe.akka.version>
<jackson.version>2.13.5</jackson.version>
<scoverage.plugin.version>1.4.1</scoverage.plugin.version>
</properties>

<dependencies>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.10.1</version>
<version>${jackson.version}</version>
</dependency>
<dependency>
<groupId>org.scala-lang</groupId>
Expand Down Expand Up @@ -48,9 +50,9 @@
<scope>test</scope>
</dependency>
<dependency>
<groupId>it.ozimov</groupId>
<groupId>com.github.codemonstur</groupId>
<artifactId>embedded-redis</artifactId>
<version>0.7.1</version>
<version>1.1.0</version>
<scope>test</scope>
</dependency>
<!-- https://mvnrepository.com/artifact/com.squareup.okhttp3/mockwebserver -->
Expand All @@ -75,7 +77,7 @@
<dependency>
<groupId>com.typesafe.akka</groupId>
<artifactId>akka-testkit_${scala.major.version}</artifactId>
<version>2.5.22</version>
<version>${typesafe.akka.version}</version>
<scope>test</scope>
</dependency>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ class CollectionSummaryAggregate @Inject()(implicit val cacheUtil: RedisCacheUti

def transform(druidResponse: String, groupByKeys: List[String]): util.HashMap[String, AnyRef] = {
val transformedResult = new util.HashMap[String, AnyRef]()
import scala.collection.JavaConversions._
import scala.collection.convert.ImplicitConversions._
val parsedResult: AnyRef = JsonUtil.deserialize(druidResponse, classOf[AnyRef])
if (isArray(druidResponse) && parsedResult.asInstanceOf[util.ArrayList[util.Map[String, AnyRef]]].nonEmpty) {
val groupingObj = parsedResult.asInstanceOf[util.ArrayList[util.Map[String, AnyRef]]].map(x => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
package org.sunbird.enrolments

import java.util
import java.util.{Date, TimeZone, UUID}

import com.fasterxml.jackson.databind.ObjectMapper
import javax.inject.Inject
import org.apache.commons.collections4.{CollectionUtils, MapUtils}
import org.apache.commons.lang3.StringUtils
import org.sunbird.cassandra.CassandraOperation
Expand All @@ -20,8 +16,11 @@ import org.sunbird.kafka.client.{InstructionEventGenerator, KafkaClient}
import org.sunbird.learner.constants.{CourseJsonKey, InstructionEvent}
import org.sunbird.learner.util.Util

import scala.collection.JavaConversions._
import java.util
import java.util.{Date, TimeZone, UUID}
import javax.inject.Inject
import scala.collection.JavaConverters._
import scala.collection.convert.ImplicitConversions._

case class InternalContentConsumption(courseId: String, batchId: String, contentId: String) {
def validConsumption() = StringUtils.isNotBlank(courseId) && StringUtils.isNotBlank(batchId) && StringUtils.isNotBlank(contentId)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,11 @@
package org.sunbird.enrolments

import java.sql.Timestamp
import java.text.{MessageFormat, SimpleDateFormat}
import java.time.format.DateTimeFormatter
import java.time.{LocalDate, LocalDateTime, LocalTime, ZoneId}
import java.util
import java.util.{Comparator, Date}
import akka.actor.ActorRef
import com.fasterxml.jackson.databind.ObjectMapper

import javax.inject.{Inject, Named}
import org.apache.commons.collections4.{CollectionUtils, MapUtils}
import org.apache.commons.collections4.CollectionUtils
import org.apache.commons.lang3.StringUtils
import org.sunbird.cache.util.RedisCacheUtil
import org.sunbird.common.CassandraUtil
import org.sunbird.common.exception.ProjectCommonException
import org.sunbird.common.models.response.Response
import org.sunbird.common.models.util.ProjectUtil.EnrolmentType
Expand All @@ -21,16 +15,20 @@ import org.sunbird.common.responsecode.ResponseCode
import org.sunbird.learner.actors.coursebatch.dao.impl.{CourseBatchDaoImpl, UserCoursesDaoImpl}
import org.sunbird.learner.actors.coursebatch.dao.{CourseBatchDao, UserCoursesDao}
import org.sunbird.learner.actors.group.dao.impl.GroupDaoImpl
import org.sunbird.learner.util.{ContentSearchUtil, ContentUtil, CourseBatchSchedulerUtil, JsonUtil, Util}
import org.sunbird.learner.util._
import org.sunbird.models.course.batch.CourseBatch
import org.sunbird.models.user.courses.UserCourses
import org.sunbird.cache.util.RedisCacheUtil
import org.sunbird.common.CassandraUtil
import org.sunbird.common.models.util.ProjectUtil;
import org.sunbird.telemetry.util.TelemetryUtil

import scala.collection.JavaConversions._
import java.sql.Timestamp
import java.text.SimpleDateFormat
import java.time.format.DateTimeFormatter
import java.time.{LocalDate, LocalDateTime, LocalTime}
import java.util
import java.util.Date
import javax.inject.{Inject, Named}
import scala.collection.JavaConverters._
import scala.collection.convert.ImplicitConversions._

class CourseEnrolmentActor @Inject()(@Named("course-batch-notification-actor") courseBatchNotificationActorRef: ActorRef
)(implicit val cacheUtil: RedisCacheUtil ) extends BaseEnrolmentActor {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
package org.sunbird.group

import java.text.MessageFormat

import javax.inject.Inject
import org.apache.commons.collections.CollectionUtils
import org.apache.commons.lang3.StringUtils
import org.sunbird.actor.base.BaseActor
Expand All @@ -16,8 +13,10 @@ import org.sunbird.keys.SunbirdKey
import org.sunbird.learner.actors.group.dao.impl.GroupDaoImpl
import org.sunbird.learner.util.JsonUtil

import scala.collection.JavaConversions._
import java.text.MessageFormat
import javax.inject.Inject
import scala.collection.JavaConverters._
import scala.collection.convert.ImplicitConversions._

class GroupAggregatesActor @Inject()(implicit val cacheUtil: RedisCacheUtil) extends BaseActor {

Expand Down
16 changes: 11 additions & 5 deletions course-mw/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,16 @@
<packaging>pom</packaging>
<name>Sunbird LMS MW</name>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<scala.major.version>2.12</scala.major.version>
<scala.version>2.12.11</scala.version>
<typesafe.akka.version>2.5.22</typesafe.akka.version>
<play2.plugin.version>1.0.0-beta5</play2.plugin.version>
<mockito.core.version>2.22.0</mockito.core.version>
<powermock.api.mockito2.version>2.0.7</powermock.api.mockito2.version>
<powermock.module.junit4.version>2.0.0-beta.5</powermock.module.junit4.version>
<jackson.version>2.13.5</jackson.version>
<powermock.version>2.0.9</powermock.version>
<jacoco-maven-plugin.version>0.8.8</jacoco-maven-plugin.version>
<scoverage.plugin.version>1.4.1</scoverage.plugin.version>
<slf4j.version>1.6.1</slf4j.version>
</properties>
<modules>
<module>sunbird-util</module>
Expand Down Expand Up @@ -49,7 +55,7 @@
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.4</version>
<version>${jacoco-maven-plugin.version}</version>
<configuration>
<destFile>${basedir}/target/coverage-reports/jacoco-unit.exec</destFile>
<dataFile>${basedir}/target/coverage-reports/jacoco-unit.exec</dataFile>
Expand Down Expand Up @@ -93,7 +99,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0-M4</version>
<version>3.0.0</version>
</plugin>
</plugins>
</pluginManagement>
Expand Down
Loading

0 comments on commit 6f731a7

Please sign in to comment.