Search in sources :

Example 6 with SearchUrisResponse

use of com.google.webrisk.v1beta1.SearchUrisResponse in project java-webrisk by googleapis.

the class SearchUriExampleTest method testSearchWithThreat.

@Test
public void testSearchWithThreat() throws IOException {
    // The URL to be searched
    String uri = "http://testsafebrowsing.appspot.com/s/malware.html";
    SearchUrisResponse actualResponse = SearchUriExample.searchUriExample(uri);
    List<ThreatType> type = actualResponse.getThreat().getThreatTypesList();
    Truth.assertThat(type).contains(ThreatType.MALWARE);
}
Also used : ThreatType(com.google.webrisk.v1.ThreatType) SearchUrisResponse(com.google.webrisk.v1.SearchUrisResponse) Test(org.junit.Test)

Aggregations

SearchUrisResponse (com.google.webrisk.v1.SearchUrisResponse)5 Test (org.junit.Test)4 ThreatType (com.google.webrisk.v1.ThreatType)3 AbstractMessage (com.google.protobuf.AbstractMessage)2 ByteString (com.google.protobuf.ByteString)2 SearchUrisRequest (com.google.webrisk.v1.SearchUrisRequest)2 ArrayList (java.util.ArrayList)2 WebRiskServiceClient (com.google.cloud.webrisk.v1.WebRiskServiceClient)1 SearchUrisRequest (com.google.webrisk.v1beta1.SearchUrisRequest)1 SearchUrisResponse (com.google.webrisk.v1beta1.SearchUrisResponse)1 ThreatType (com.google.webrisk.v1beta1.ThreatType)1