Skip to content

Commit 07390b7

Browse files
author
Stephen Powis
committed
stub tests
1 parent 68f73aa commit 07390b7

File tree

3 files changed

+138
-0
lines changed

3 files changed

+138
-0
lines changed
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
/**
2+
* Copyright 2018, 2019 SourceLab.org https://github.com/SourceLabOrg/kafka-connect-client
3+
*
4+
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
5+
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
6+
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit
7+
* persons to whom the Software is furnished to do so, subject to the following conditions:
8+
*
9+
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
10+
* Software.
11+
*
12+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
13+
* WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
14+
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
15+
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
16+
*/
17+
18+
package org.sourcelab.kafka.connect.apiclient.request.get.connector;
19+
20+
import org.junit.Test;
21+
import org.sourcelab.kafka.connect.apiclient.request.AbstractRequestTest;
22+
import org.sourcelab.kafka.connect.apiclient.request.dto.ConnectorsWithExpandedMetadata;
23+
import org.sourcelab.kafka.connect.apiclient.request.get.GetConnectorsExpandAllDetails;
24+
25+
import java.io.IOException;
26+
27+
import static org.junit.Assert.assertNotNull;
28+
import static org.junit.Assert.assertTrue;
29+
30+
public class GetConnectorsExpandAllDetailsTest extends AbstractRequestTest {
31+
32+
/**
33+
* Test Parsing GET /connectors response with all known metadata.
34+
*/
35+
@Test
36+
public void testParseResponse() throws IOException {
37+
final String mockResponse = readFile("getConnectorsWithAllExpandedMetadata.json");
38+
final ConnectorsWithExpandedMetadata result = new GetConnectorsExpandAllDetails().parseResponse(mockResponse);
39+
40+
// Validate
41+
assertNotNull("Should not be null", result);
42+
43+
// TODO write test
44+
assertTrue(false);
45+
}
46+
}
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
/**
2+
* Copyright 2018, 2019 SourceLab.org https://github.com/SourceLabOrg/kafka-connect-client
3+
*
4+
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
5+
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
6+
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit
7+
* persons to whom the Software is furnished to do so, subject to the following conditions:
8+
*
9+
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
10+
* Software.
11+
*
12+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
13+
* WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
14+
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
15+
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
16+
*/
17+
18+
package org.sourcelab.kafka.connect.apiclient.request.get.connector;
19+
20+
import org.junit.Test;
21+
import org.sourcelab.kafka.connect.apiclient.request.AbstractRequestTest;
22+
import org.sourcelab.kafka.connect.apiclient.request.dto.ConnectorsWithExpandedInfo;
23+
import org.sourcelab.kafka.connect.apiclient.request.get.GetConnectorsExpandInfo;
24+
25+
import java.io.IOException;
26+
27+
import static org.junit.Assert.assertNotNull;
28+
import static org.junit.Assert.assertTrue;
29+
30+
public class GetConnectorsWithExpandInfoTest extends AbstractRequestTest {
31+
32+
/**
33+
* Test Parsing GET /connectors response with expanded info metadata.
34+
*/
35+
@Test
36+
public void testParseResponse() throws IOException {
37+
final String mockResponse = readFile("getConnectorsWithExpandedInfo.json");
38+
final ConnectorsWithExpandedInfo result = new GetConnectorsExpandInfo().parseResponse(mockResponse);
39+
40+
// Validate
41+
assertNotNull("Should not be null", result);
42+
43+
// TODO write test
44+
assertTrue(false);
45+
}
46+
}
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
/**
2+
* Copyright 2018, 2019 SourceLab.org https://github.com/SourceLabOrg/kafka-connect-client
3+
*
4+
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
5+
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation the
6+
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit
7+
* persons to whom the Software is furnished to do so, subject to the following conditions:
8+
*
9+
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of the
10+
* Software.
11+
*
12+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
13+
* WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
14+
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
15+
* OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
16+
*/
17+
18+
package org.sourcelab.kafka.connect.apiclient.request.get.connector;
19+
20+
import org.junit.Test;
21+
import org.sourcelab.kafka.connect.apiclient.request.AbstractRequestTest;
22+
import org.sourcelab.kafka.connect.apiclient.request.dto.ConnectorsWithExpandedStatus;
23+
import org.sourcelab.kafka.connect.apiclient.request.get.GetConnectorsExpandStatus;
24+
25+
import java.io.IOException;
26+
27+
import static org.junit.Assert.assertNotNull;
28+
import static org.junit.Assert.assertTrue;
29+
30+
public class GetConnectorsWithExpandStatusTest extends AbstractRequestTest {
31+
32+
/**
33+
* Test Parsing GET /connectors response with expanded info metadata.
34+
*/
35+
@Test
36+
public void testParseResponse() throws IOException {
37+
final String mockResponse = readFile("getConnectorsWithExpandedStatus.json");
38+
final ConnectorsWithExpandedStatus result = new GetConnectorsExpandStatus().parseResponse(mockResponse);
39+
40+
// Validate
41+
assertNotNull("Should not be null", result);
42+
43+
// TODO write test
44+
assertTrue(false);
45+
}
46+
}

0 commit comments

Comments
 (0)