use of com.github.tomakehurst.wiremock.client.RequestPatternBuilder in project opennms by OpenNMS.
the class MeasurementApiConnectorIT method testAuthentication.
@Test
public void testAuthentication() throws IOException {
Result result = new MeasurementApiClient().execute(false, "http://localhost:9999/opennms/rest/measurements", "admin", "admin", "<dummy request>");
Assert.assertTrue(result.wasSuccessful());
Assert.assertFalse(result.wasRedirection());
Assert.assertEquals(200, result.getResponseCode());
Assert.assertNotNull(result.getInputStream());
Assert.assertNull(result.getErrorStream());
RequestPatternBuilder requestPatternBuilder = createDefaultRequestPatternBuilder("/opennms/rest/measurements");
requestPatternBuilder.withHeader("Authorization", WireMock.matching("Basic .*"));
verifyWiremock(requestPatternBuilder);
}
Aggregations