2020import com .microsoft .durabletask .TaskOptions ;
2121import com .microsoft .durabletask .TaskOrchestrationContext ;
2222
23+ import io .dapr .workflows .runtime .DaprWorkflowContext ;
2324import io .dapr .workflows .saga .Saga ;
2425import io .dapr .workflows .saga .SagaContext ;
2526
4344import static org .mockito .Mockito .when ;
4445import static org .junit .jupiter .api .Assertions .assertThrows ;
4546
46- public class DaprWorkflowContextImplTest {
47- private DaprWorkflowContextImpl context ;
47+ public class DaprWorkflowContextTest {
48+ private DaprWorkflowContext context ;
4849 private TaskOrchestrationContext mockInnerContext ;
4950 private WorkflowContext testWorkflowContext ;
5051
5152 @ BeforeEach
5253 public void setUp () {
5354 mockInnerContext = mock (TaskOrchestrationContext .class );
54- context = new DaprWorkflowContextImpl (mockInnerContext );
55+ context = new DaprWorkflowContext (mockInnerContext );
5556 testWorkflowContext = new WorkflowContext () {
5657 @ Override
5758 public Logger getLogger () {
@@ -190,13 +191,13 @@ public void callActivityTest() {
190191 @ Test
191192 public void DaprWorkflowContextWithEmptyInnerContext () {
192193 assertThrows (IllegalArgumentException .class , () -> {
193- context = new DaprWorkflowContextImpl (mockInnerContext , (Logger )null );
194+ context = new DaprWorkflowContext (mockInnerContext , (Logger )null );
194195 }); }
195196
196197 @ Test
197198 public void DaprWorkflowContextWithEmptyLogger () {
198199 assertThrows (IllegalArgumentException .class , () -> {
199- context = new DaprWorkflowContextImpl (null , (Logger )null );
200+ context = new DaprWorkflowContext (null , (Logger )null );
200201 });
201202 }
202203
@@ -216,7 +217,7 @@ public void getIsReplayingTest() {
216217 public void getLoggerReplayingTest () {
217218 Logger mockLogger = mock (Logger .class );
218219 when (context .isReplaying ()).thenReturn (true );
219- DaprWorkflowContextImpl testContext = new DaprWorkflowContextImpl (mockInnerContext , mockLogger );
220+ DaprWorkflowContext testContext = new DaprWorkflowContext (mockInnerContext , mockLogger );
220221
221222 String expectedArg = "test print" ;
222223 testContext .getLogger ().info (expectedArg );
@@ -228,7 +229,7 @@ public void getLoggerReplayingTest() {
228229 public void getLoggerFirstTimeTest () {
229230 Logger mockLogger = mock (Logger .class );
230231 when (context .isReplaying ()).thenReturn (false );
231- DaprWorkflowContextImpl testContext = new DaprWorkflowContextImpl (mockInnerContext , mockLogger );
232+ DaprWorkflowContext testContext = new DaprWorkflowContext (mockInnerContext , mockLogger );
232233
233234 String expectedArg = "test print" ;
234235 testContext .getLogger ().info (expectedArg );
@@ -322,15 +323,15 @@ public void newUuidTestNoImplementationExceptionTest() {
322323 @ Test
323324 public void getSagaContextTest_sagaEnabled () {
324325 Saga saga = mock (Saga .class );
325- WorkflowContext context = new DaprWorkflowContextImpl (mockInnerContext , saga );
326+ WorkflowContext context = new DaprWorkflowContext (mockInnerContext , saga );
326327
327328 SagaContext sagaContext = context .getSagaContext ();
328329 assertNotNull ("SagaContext should not be null" , sagaContext );
329330 }
330331
331332 @ Test
332333 public void getSagaContextTest_sagaDisabled () {
333- WorkflowContext context = new DaprWorkflowContextImpl (mockInnerContext );
334+ WorkflowContext context = new DaprWorkflowContext (mockInnerContext );
334335 assertThrows (UnsupportedOperationException .class , () -> {
335336 context .getSagaContext ();
336337 });
0 commit comments