Skip to content

Commit 4698024

Browse files
getting tests to run in ide
1 parent 745bd92 commit 4698024

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@ subprojects {
5050
apply plugin: 'me.champeau.gradle.jmh'
5151
apply plugin: 'nebula.optional-base'
5252

53-
sourceCompatibility = 1.6
54-
targetCompatibility = 1.6
53+
sourceCompatibility = 1.7
54+
targetCompatibility = 1.7
5555

5656
repositories {
5757
jcenter()

core-api/src/main/java/com/optimizely/ab/bucketing/DecisionService.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ public DecisionService(@Nonnull Bucketer bucketer,
8282
@Nonnull String userId,
8383
@Nonnull Map<String, String> filteredAttributes) {
8484

85-
if (!ExperimentUtils.isExperimentActive(experiment)) {
85+
if (experiment == null || !ExperimentUtils.isExperimentActive(experiment)) {
8686
return null;
8787
}
8888

@@ -104,7 +104,7 @@ public DecisionService(@Nonnull Bucketer bucketer,
104104
if (userProfileService != null) {
105105
try {
106106
Map<String, Object> userProfileMap = userProfileService.lookup(userId);
107-
if (userProfileMap == null) {
107+
if (userProfileMap == null || userProfileMap.isEmpty()) {
108108
logger.info("We were unable to get a user profile map from the UserProfileService.");
109109
} else if (UserProfileUtils.isValidUserProfileMap(userProfileMap)) {
110110
userProfile = UserProfileUtils.convertMapToUserProfile(userProfileMap);

core-api/src/test/java/com/optimizely/ab/internal/LogbackVerifier.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,8 @@ private void verify() throws Throwable {
8181
for (final ExpectedLogEvent expectedEvent : expectedEvents) {
8282
Mockito.verify(appender, expectedEvent.times).doAppend(argThat(new ArgumentMatcher<ILoggingEvent>() {
8383
@Override
84-
public boolean matches(final Object argument) {
85-
return expectedEvent.matches((ILoggingEvent) argument);
84+
public boolean matches(final ILoggingEvent argument) {
85+
return expectedEvent.matches(argument);
8686
}
8787
}));
8888
}

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,4 @@ findbugsVersion = 3.0.1
2424

2525
# Test Packages
2626
junitVersion = 4.12
27-
mockitoVersion = 1.10.19
27+
mockitoVersion = 2.11.0

0 commit comments

Comments
 (0)