Skip to content

Commit

Permalink
Fix venice-common cc issue
Browse files Browse the repository at this point in the history
  • Loading branch information
sushantmane committed Sep 11, 2024
1 parent 65e8341 commit 1f17f5b
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
6 changes: 6 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -501,6 +501,12 @@ subprojects {
value = 'COVEREDRATIO'
minimum = threshold
}

afterEvaluate {
classDirectories.setFrom(files(classDirectories.files.collect { fileTree(dir: it, exclude: [
'**/com/linkedin/venice/protocols/**',
])}))
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package com.linkedin.venice.listener.response;

import static org.testng.Assert.assertEquals;

import io.netty.handler.codec.http.HttpResponseStatus;
import org.testng.annotations.Test;


public class HttpShortcutResponseTest {
@Test
public void testHttpShortcutResponse() {
// Case 1: Test constructor with both message and status
HttpShortcutResponse responseWithMessage = new HttpShortcutResponse("Success", HttpResponseStatus.OK);
assertEquals(responseWithMessage.getMessage(), "Success", "Message should be 'Success'");
assertEquals(responseWithMessage.getStatus(), HttpResponseStatus.OK, "Status should be OK");

// Case 2: Test constructor with empty message and status
HttpShortcutResponse responseWithEmptyMessage = new HttpShortcutResponse("", HttpResponseStatus.BAD_REQUEST);
assertEquals(responseWithEmptyMessage.getMessage(), "", "Message should be empty");
assertEquals(responseWithEmptyMessage.getStatus(), HttpResponseStatus.BAD_REQUEST, "Status should be BAD_REQUEST");

// Case 3: Test constructor with only status (default message)
HttpShortcutResponse responseWithoutMessage = new HttpShortcutResponse(HttpResponseStatus.NOT_FOUND);
assertEquals(responseWithoutMessage.getMessage(), "", "Message should be empty by default");
assertEquals(responseWithoutMessage.getStatus(), HttpResponseStatus.NOT_FOUND, "Status should be NOT_FOUND");
}
}

0 comments on commit 1f17f5b

Please sign in to comment.