url = "/policy-schemas?ric_id=ric1&policytype_id=type1";
rsp = restClient().get(url).block();
PolicySchemaList list = gson.fromJson(rsp, PolicySchemaList.class);
- assertThat(list.schemas.size()).isEqualTo(1);
+ assertThat(list.schemas).hasSize(1);
url = "/policy-schemas?ric_id=ric1&policytype_id=type2";
rsp = restClient().get(url).block();
list = gson.fromJson(rsp, PolicySchemaList.class);
- assertThat(list.schemas.size()).isEqualTo(0);
+ assertThat(list.schemas).isEmpty();
// Get schema for non existing RIC
url = "/policy-schemas?ric_id=ric1XXX";
import static org.junit.Assert.fail;
import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.mockito.ArgumentMatchers.anyString;
import static org.mockito.Mockito.verify;
import static org.mockito.Mockito.when;
@Test
void createClientWithWrongProtocol_thenErrorIsThrown() {
- try {
- new SdncOscA1Client(A1ProtocolType.STD_V1_1, null, null, new AsyncRestClient("", null));
- fail("Should have thrown exception.");
- } catch (IllegalArgumentException e) {
- return;
- }
+ AsyncRestClient asyncRestClient = new AsyncRestClient("", null);
+ assertThrows(IllegalArgumentException.class, () -> {
+ new SdncOscA1Client(A1ProtocolType.STD_V1_1, null, null, asyncRestClient);
+ });
}
@Test