+func TestControllerDeleteEnbGetNodebInternalError(t *testing.T) {
+ context := controllerDeleteEnbTestContext{
+ getNodebInfoResult: &getNodebInfoResult{
+ nodebInfo: nil,
+ rnibError: common.NewInternalError(errors.New("#reader.GetNodeb - Internal Error")),
+ },
+ expectedStatusCode: http.StatusInternalServerError,
+ expectedJsonResponse: RnibErrorJson,
+ }
+
+ controllerDeleteEnbTestExecuter(t, &context)
+}
+
+func TestControllerDeleteEnbNodebNotExistsFailure(t *testing.T) {
+ context := controllerDeleteEnbTestContext{
+ getNodebInfoResult: &getNodebInfoResult{
+ nodebInfo: nil,
+ rnibError: common.NewResourceNotFoundError("#reader.GetNodeb - Not found"),
+ },
+ expectedStatusCode: http.StatusNotFound,
+ expectedJsonResponse: ResourceNotFoundJson,
+ }
+
+ controllerDeleteEnbTestExecuter(t, &context)
+}
+
+func TestControllerDeleteEnbNodebNotEnb(t *testing.T) {
+ context := controllerDeleteEnbTestContext{
+ getNodebInfoResult: &getNodebInfoResult{
+ nodebInfo: &entities.NodebInfo{RanName: "ran1", NodeType: entities.Node_GNB, ConnectionStatus: entities.ConnectionStatus_DISCONNECTED},
+ rnibError: nil,
+ },
+ expectedStatusCode: http.StatusBadRequest,
+ expectedJsonResponse: ValidationFailureJson,
+ }
+
+ controllerDeleteEnbTestExecuter(t, &context)
+}
+
+func TestControllerDeleteEnbSuccess(t *testing.T) {
+ context := controllerDeleteEnbTestContext{
+ getNodebInfoResult: &getNodebInfoResult{
+ nodebInfo: &entities.NodebInfo{RanName: "ran1", NodeType: entities.Node_ENB, ConnectionStatus: entities.ConnectionStatus_DISCONNECTED},
+ rnibError: nil,
+ },
+ expectedStatusCode: http.StatusNoContent,
+ expectedJsonResponse: "",
+ }
+ controllerDeleteEnbTestExecuter(t, &context)
+}
+