Skip to content

Commit c72e604

Browse files
committed
2293 SF
1 parent 9802bc3 commit c72e604

1 file changed

Lines changed: 5 additions & 10 deletions

File tree

server/libs/modules/components/jenkins/src/test/java/com/bytechef/component/jenkins/action/JenkinsCreateJobActionTest.java

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,15 @@
1919
import static com.bytechef.component.jenkins.constant.JenkinsConstants.CONFIG_XML;
2020
import static com.bytechef.component.jenkins.constant.JenkinsConstants.NAME;
2121
import static org.junit.jupiter.api.Assertions.assertEquals;
22+
import static org.junit.jupiter.api.Assertions.assertNotNull;
2223
import static org.junit.jupiter.api.Assertions.assertNull;
2324
import static org.mockito.Mockito.when;
2425

2526
import com.bytechef.component.definition.Context;
2627
import com.bytechef.component.definition.Context.ContextFunction;
2728
import com.bytechef.component.definition.Context.Http;
2829
import com.bytechef.component.definition.Context.Http.Body;
29-
import com.bytechef.component.definition.Context.Http.Configuration.ConfigurationBuilder;
3030
import com.bytechef.component.definition.Context.Http.Executor;
31-
import com.bytechef.component.definition.Context.Http.Response;
3231
import com.bytechef.component.definition.Parameters;
3332
import com.bytechef.component.test.definition.MockParametersFactory;
3433
import 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

Comments
 (0)