1919import static com .bytechef .component .jenkins .constant .JenkinsConstants .CONFIG_XML ;
2020import static com .bytechef .component .jenkins .constant .JenkinsConstants .NAME ;
2121import static org .junit .jupiter .api .Assertions .assertEquals ;
22+ import static org .junit .jupiter .api .Assertions .assertNotNull ;
2223import static org .junit .jupiter .api .Assertions .assertNull ;
2324import static org .mockito .Mockito .when ;
2425
2526import com .bytechef .component .definition .Context ;
2627import com .bytechef .component .definition .Context .ContextFunction ;
2728import com .bytechef .component .definition .Context .Http ;
2829import com .bytechef .component .definition .Context .Http .Body ;
29- import com .bytechef .component .definition .Context .Http .Configuration .ConfigurationBuilder ;
3030import com .bytechef .component .definition .Context .Http .Executor ;
31- import com .bytechef .component .definition .Context .Http .Response ;
3231import com .bytechef .component .definition .Parameters ;
3332import com .bytechef .component .test .definition .MockParametersFactory ;
3433import com .bytechef .component .test .definition .extension .MockContextSetupExtension ;
@@ -51,9 +50,8 @@ class JenkinsCreateJobActionTest {
5150
5251 @ Test
5352 void testPerform (
54- Context mockedContext , Response mockedResponse , Executor mockedExecutor , Http mockedHttp ,
55- ArgumentCaptor <ContextFunction <Http , Executor >> httpFunctionArgumentCaptor ,
56- ArgumentCaptor <ConfigurationBuilder > configurationBuilderArgumentCaptor ) {
53+ Context mockedContext , Executor mockedExecutor , Http mockedHttp ,
54+ ArgumentCaptor <ContextFunction <Http , Executor >> httpFunctionArgumentCaptor ) {
5755
5856 when (mockedHttp .post (stringArgumentCaptor .capture ()))
5957 .thenReturn (mockedExecutor );
@@ -69,10 +67,7 @@ void testPerform(
6967 assertEquals (
7068 List .of ("/createItem" , "Content-Type" , "application/xml" , NAME , "name" ),
7169 stringArgumentCaptor .getAllValues ());
72-
73- Body body = bodyArgumentCaptor .getValue ();
74-
75- assertEquals ("application/xml" , body .getMimeType ());
76- assertEquals ("configXml" , body .getContent ());
70+ assertNotNull (httpFunctionArgumentCaptor .getValue ());
71+ assertEquals (Body .of ("configXml" , "application/xml" ), bodyArgumentCaptor .getValue ());
7772 }
7873}
0 commit comments