Skip to content

Commit

Permalink
[backend/frontend] Feedbacks
Browse files Browse the repository at this point in the history
  • Loading branch information
savacano28 committed Jan 8, 2025
1 parent e36b132 commit 72c5b24
Showing 1 changed file with 0 additions and 25 deletions.
25 changes: 0 additions & 25 deletions openbas-api/src/test/java/io/openbas/rest/EndpointApiTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,31 +43,6 @@ class EndpointApiTest extends IntegrationTest {
@Autowired private EndpointRepository endpointRepository;
@SpyBean private EndpointService endpointService;

@DisplayName("Given valid Windows endpoint input, should create a Windows endpoint successfully")
@Test
@WithMockAdminUser
void given_validWindowsEndpointInput_should_createWindowsEndpointSuccessfully() throws Exception {
// --PREPARE--
Tag tag = tagRepository.save(getTag());
EndpointInput input = createWindowsEndpointInput(List.of(tag.getId()));

// --EXECUTE--
String response =
mvc.perform(
post(ENDPOINT_URI)
.content(asJsonString(input))
.contentType(MediaType.APPLICATION_JSON)
.accept(MediaType.APPLICATION_JSON))
.andExpect(status().is2xxSuccessful())
.andReturn()
.getResponse()
.getContentAsString();

// --ASSERT--
assertEquals(WINDOWS_ASSET_NAME_INPUT, JsonPath.read(response, "$.asset_name"));
assertEquals(MAC_ADDRESSES[0], JsonPath.read(response, "$.endpoint_mac_addresses[0]"));
}

@DisplayName("Given valid endpoint input, should upsert an endpoint successfully")
@Test
@WithMockAdminUser
Expand Down

0 comments on commit 72c5b24

Please sign in to comment.