+func TestControllerUpdateEnbExistingEmptyCellsSuccess(t *testing.T) {
+ oldServedCells := []*entities.ServedCellInfo{}
+ context := controllerUpdateEnbTestContext{
+ updateEnbCellsParams: &updateEnbCellsParams{
+ err: nil,
+ },
+ getNodebInfoResult: &getNodebInfoResult{
+ nodebInfo: &entities.NodebInfo{
+ RanName: RanName,
+ ConnectionStatus: entities.ConnectionStatus_CONNECTED,
+ AssociatedE2TInstanceAddress: AssociatedE2TInstanceAddress,
+ NodeType: entities.Node_ENB,
+ Configuration: &entities.NodebInfo_Enb{Enb: &entities.Enb{ServedCells: oldServedCells, EnbType: entities.EnbType_MACRO_ENB}},
+ },
+ rnibError: nil,
+ },
+ requestBody: getUpdateEnbRequest(""),
+ expectedStatusCode: http.StatusOK,
+ expectedJsonResponse: "{\"ranName\":\"test\",\"connectionStatus\":\"CONNECTED\",\"nodeType\":\"ENB\",\"enb\":{\"enbType\":\"MACRO_ENB\",\"servedCells\":[{\"pci\":1,\"cellId\":\"whatever\",\"tac\":\"whatever3\",\"broadcastPlmns\":[\"whatever\"],\"choiceEutraMode\":{\"fdd\":{}},\"eutraMode\":\"FDD\"}]},\"associatedE2tInstanceAddress\":\"10.0.2.15:38000\"}",
+ }
+
+ controllerUpdateEnbTestExecuter(t, &context)
+}
+
+func TestControllerUpdateEnbNgEnbFailure(t *testing.T) {
+
+ requestBody := map[string]interface{}{
+ "enb": map[string]interface{}{
+ "enbType": 3,
+ "servedCells": []interface{}{
+ buildServedCell(""),
+ }},
+ }
+
+ oldServedCells := generateServedCells("whatever1", "whatever2")
+
+ context := controllerUpdateEnbTestContext{
+ getNodebInfoResult: &getNodebInfoResult{
+ nodebInfo: &entities.NodebInfo{
+ RanName: RanName,
+ ConnectionStatus: entities.ConnectionStatus_CONNECTED,
+ AssociatedE2TInstanceAddress: AssociatedE2TInstanceAddress,
+ NodeType: entities.Node_ENB,
+ Configuration: &entities.NodebInfo_Enb{Enb: &entities.Enb{ServedCells: oldServedCells, EnbType: entities.EnbType_MACRO_NG_ENB}},
+ },
+ rnibError: nil,
+ },
+ requestBody: requestBody,
+ expectedStatusCode: http.StatusBadRequest,
+ expectedJsonResponse: ValidationFailureJson,
+ }
+
+ controllerUpdateEnbTestExecuter(t, &context)
+}
+
+func TestControllerUpdateEnbSuccessSetupFromNwFalse(t *testing.T) {