Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
akantcheff committed Oct 25, 2024
2 parents 293872d + c831bae commit 1aac232
Show file tree
Hide file tree
Showing 35 changed files with 106 additions and 99 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ public void archiveUserTaskData_should_not_create_archive_data_if_no_data_define

contractDataService.archiveAndDeleteUserTaskData(usertTaskId, time);

verifyZeroInteractions(archiveService);
verifyNoInteractions(archiveService);
}

@Test(expected = SObjectModificationException.class)
Expand Down Expand Up @@ -360,7 +360,7 @@ public void archiveProcessData_should_not_create_archive_data_if_no_data_defined

contractDataService.archiveAndDeleteProcessData(usertProcessId, time);

verifyZeroInteractions(archiveService);
verifyNoInteractions(archiveService);
}

@Test(expected = SObjectModificationException.class)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ public void createFormMappingWithUndefinedTargetShouldNotAddPageMapping() throws

formMappingService.create(PROCESS_DEFINITION_ID, "someHumanTask", 84, SFormMapping.TARGET_UNDEFINED, null);

verifyZeroInteractions(pageMappingService);
verifyNoInteractions(pageMappingService);
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.entry;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.verify;

Expand All @@ -40,7 +41,6 @@
import org.junit.Test;
import org.junit.rules.TemporaryFolder;
import org.junit.runner.RunWith;
import org.mockito.ArgumentMatchers;
import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.Spy;
Expand Down Expand Up @@ -103,20 +103,20 @@ private BonitaConfiguration conf(String file1, byte[] bytes) {
}

@Test
public void should_context_have_properties_overriden_with_database_properties() throws Exception {
public void should_context_have_properties_overridden_with_database_properties() throws Exception {
//given
Properties databaseProperties = new Properties();
databaseProperties.setProperty("overriddenProperty", "databaseValue");
databaseProperties.setProperty("databaseProperty", "aValueInDb");
ByteArrayOutputStream out = new ByteArrayOutputStream();
databaseProperties.store(out, "");
doReturn(Collections.singletonList(new BonitaConfiguration("myProp.properties", out.toByteArray())))
doReturn(List.of(new BonitaConfiguration("myProp.properties", out.toByteArray())))
.when(configurationService).getPlatformEngineConf();
Properties classPathProperties = new Properties();
classPathProperties.setProperty("overriddenProperty", "classPathValue");
classPathProperties.setProperty("classPathProperty", "aValueInClassPath");
doReturn(classPathProperties).when(bonitaHomeServer)
.getPropertiesFromClassPath(ArgumentMatchers.<String> any());
.getPropertiesFromClassPath(any(String[].class));
//when
Properties allProperties = bonitaHomeServer.getPlatformProperties();
//then
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verifyZeroInteractions;
import static org.mockito.Mockito.verifyNoInteractions;

import java.util.Collections;
import java.util.HashMap;
Expand Down Expand Up @@ -95,7 +95,7 @@ public void should_resolve_process_if_no_defined_parameters_in_process() throws

// then:
assertThat(deployed).isTrue();
verifyZeroInteractions(parameterService);
verifyNoInteractions(parameterService);
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public void merge_a_collection_of_entity_should_not_call_merge_on_bdrService_for
public void merge_a_simple_serializable_should_not_call_merge_on_bdrService() {
final String hello = "Hello";
assertThat(entityMerger.merge("Hello")).isEqualTo(hello);
verifyZeroInteractions(bdrService);
verifyNoInteractions(bdrService);
}

@Test
Expand All @@ -78,7 +78,7 @@ public void merge_a_collection_of_simple_serializable_should_not_call_merge_on_b
listOfEntities.add("Goodbye");
listOfEntities.add("Have a nice day");
entityMerger.merge((Serializable) listOfEntities);
verifyZeroInteractions(bdrService);
verifyNoInteractions(bdrService);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
**/
package org.bonitasoft.engine.api.impl.transaction.process;

import static org.mockito.Mockito.verifyZeroInteractions;
import static org.mockito.Mockito.verifyNoInteractions;
import static org.mockito.Mockito.when;

import java.util.ArrayList;
Expand Down Expand Up @@ -59,7 +59,7 @@ public void execute_should_not_clean_the_classLoader_due_to_its_use_for_running_

disableProcess.execute();

verifyZeroInteractions(classLoaderService);
verifyNoInteractions(classLoaderService);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ public void should_not_check_children_when_complex_input_is_null() throws Except
public void should_not_check_type_validation_when_input_is_null() throws Exception {
final SContractDefinition contract = aContract().withInput(aSimpleInput(TEXT).withName("someNullText")).build();
validator.validate(contract, Collections.<String, Serializable> singletonMap("someNullText", null));
verifyZeroInteractions(typeValidator);
verifyNoInteractions(typeValidator);
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import static org.bonitasoft.engine.business.data.DummyBusinessDataRefBuilder.buildSimpleRefBusinessData;
import static org.mockito.BDDMockito.given;
import static org.mockito.Mockito.spy;
import static org.mockito.Mockito.verifyZeroInteractions;
import static org.mockito.Mockito.verifyNoInteractions;

import java.util.ArrayList;
import java.util.Arrays;
Expand Down Expand Up @@ -79,8 +79,8 @@ public void getSimpleBusinessData_should_return_null_when_ref_business_data_does

//then
assertThat(retrievedEntity).isNull();
verifyZeroInteractions(repository);
verifyZeroInteractions(proxyfier);
verifyNoInteractions(repository);
verifyNoInteractions(proxyfier);
}

@Test
Expand Down Expand Up @@ -111,8 +111,8 @@ public void getMultiBusinessData_should_return_empty_list_when_multi_ref_data_do

//then
assertThat(retrievedEntities).isEmpty();
verifyZeroInteractions(repository);
verifyZeroInteractions(proxyfier);
verifyNoInteractions(repository);
verifyNoInteractions(proxyfier);
}

@Test
Expand All @@ -128,8 +128,8 @@ public void getMultiBusinessData_should_return_empty_Array_list_when_multi_ref_d
retrievedEntities.add(new Employee());
// no exceptions

verifyZeroInteractions(repository);
verifyZeroInteractions(proxyfier);
verifyNoInteractions(repository);
verifyNoInteractions(proxyfier);
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

import static org.mockito.Mockito.doReturn;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.verifyZeroInteractions;
import static org.mockito.Mockito.verifyNoInteractions;

import java.util.Optional;

Expand Down Expand Up @@ -86,8 +86,8 @@ public void should_not_delete_timer_and_event_trigger_when_catch_is_not_a_timer(

waitingEventsInterrupter.interruptWaitingEvents(processDefinition, catchEventInstance, catchEventDefinition);

verifyZeroInteractions(eventInstanceService);
verifyZeroInteractions(schedulerService);
verifyNoInteractions(eventInstanceService);
verifyNoInteractions(schedulerService);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import static org.assertj.core.api.Assertions.fail;
import static org.mockito.BDDMockito.given;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.verifyZeroInteractions;
import static org.mockito.Mockito.verifyNoInteractions;

import java.util.Collections;

Expand Down Expand Up @@ -71,7 +71,7 @@ public void evaluateCondition_should_return_null_when_there_is_no_condition() th
//then
assertThat(value).isNull();

verifyZeroInteractions(expressionResolverService);
verifyNoInteractions(expressionResolverService);
}

@Test
Expand All @@ -94,7 +94,7 @@ public void evaluateCondition_should_throw_SExpressionEvaluationException_when_e
.isEqualTo("Condition expression must return a boolean, on transition: " + transition.getName());
assertThat(e.getExpressionName()).isEqualTo("isTrue");

verifyZeroInteractions(expressionResolverService);
verifyNoInteractions(expressionResolverService);
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
import static org.mockito.Mockito.nullable;
import static org.mockito.Mockito.spy;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.verifyZeroInteractions;
import static org.mockito.Mockito.verifyNoInteractions;
import static org.mockito.Mockito.when;

import java.util.Arrays;
Expand Down Expand Up @@ -233,8 +233,8 @@ public void evaluate_should_first_check_if_expression_already_evaluated_and_avai
context, null, ContainerState.ACTIVE);

assertThat(fetchedBizData).isEqualTo(expectedBizData);
verifyZeroInteractions(businessDataRetriever);
verifyZeroInteractions(refBusinessDataRetriever);
verifyNoInteractions(businessDataRetriever);
verifyNoInteractions(refBusinessDataRetriever);
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public void evaluate_result_should_retrieve_documents_list_when_it_is_not_alread

//then:
assertThat(result).hasSize(1).containsOnly(expectedDocumentList);
verifyZeroInteractions(activityInstanceService);
verifyNoInteractions(activityInstanceService);
}

@Test
Expand All @@ -100,7 +100,7 @@ public void evaluate_should_directly_return_the_documents_list_when_it_is_alread

//then:
assertThat(result).isSameAs(documentListInContext);
verifyZeroInteractions(documentService);
verifyNoInteractions(documentService);
}

// =================================================================================================================
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ public void evaluate_should_directly_return_the_document_when_it_is_already_in_t

//then:
assertThat(result).isSameAs(docInContext);
verifyZeroInteractions(documentService);
verifyNoInteractions(documentService);
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,8 @@ public void should_start_platform_only_once() throws Exception {

boolean started = platformManager.start();

verifyZeroInteractions(platformLifecycleService1);
verifyZeroInteractions(platformLifecycleService2);
verifyNoInteractions(platformLifecycleService1);
verifyNoInteractions(platformLifecycleService2);
verify(platformStateProvider, never()).setStarted();
assertThat(started).isFalse();
}
Expand All @@ -147,8 +147,8 @@ public void should_stop_platform_only_once() throws Exception {

boolean stopped = platformManager.stop();

verifyZeroInteractions(platformLifecycleService1);
verifyZeroInteractions(platformLifecycleService2);
verifyNoInteractions(platformLifecycleService1);
verifyNoInteractions(platformLifecycleService2);
verify(platformStateProvider, never()).setStopped();
assertThat(stopped).isFalse();
}
Expand Down
Loading

0 comments on commit 1aac232

Please sign in to comment.