Skip to content

Commit

Permalink
4.x: Use Hamcrest assertions instead of JUnit in webclient/htt1 (#1749)…
Browse files Browse the repository at this point in the history
… (#8914)
  • Loading branch information
Captain1653 authored Jul 1, 2024
1 parent 8a95d96 commit 966c7f3
Showing 1 changed file with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2023 Oracle and/or its affiliates.
* Copyright (c) 2023, 2024 Oracle and/or its affiliates.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -21,23 +21,24 @@

import org.junit.jupiter.api.Test;

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertThrows;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.MatcherAssert.assertThat;

class Http1StatusParserTest {

@Test
public void http10() {
String response = "HTTP/1.0 200 Connection established\r\n";
Status status = Http1StatusParser.readStatus(new DataReader(() -> response.getBytes()), 256);
assertEquals(200, status.code());
assertThat(status.code(), is(200));
}

@Test
public void http11() {
String response = "HTTP/1.1 200 Connection established\r\n";
Status status = Http1StatusParser.readStatus(new DataReader(() -> response.getBytes()), 256);
assertEquals(200, status.code());
assertThat(status.code(), is(200));
}

@Test
Expand Down

0 comments on commit 966c7f3

Please sign in to comment.